Rapid ship classification and identification method for overwater checkpoint

By introducing an image preprocessing module and a structural reparameterization bottleneck unit in ship detection, combining a multi-scale agent attention module and rejection loss function, the YOLOv8 network is improved, and the image blur and missed detection errors of ship detection in water bayonet environment is solved. The inspection problem has achieved high-precision ship classification identification.

CN119169387AInactive Publication Date: 2024-12-20GUANGZHOU SHANGSAI ELECTRONIC TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411367277.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2024-12-20
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art is difficult to deal with the problem of image blur and mis-checking caused by factors such as weather, background complexity and ship overlap in ship detection, especially in water mount environments, which are difficult to accurately identify and classify ships.

Method used

A RAR-YOLOv8 network including image preprocessing module, structural reparameterization bottleneck unit, multi-scale proxy attention module and rejection loss were designed. By pre-training the image preprocessing module and constructing the SRLAN network, the DDPM model and the YOLOv8 network are used. The improved version of the company combines the agent attention mechanism and rejection loss function to achieve clarity and accurate classification of rain fog ship images.

Benefits of technology

Effectively remove weather interference information, improve the accuracy of ship detection, reduce mis-checking, and accurately identify and classify mount ships in complex environments, improving detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119169387A_ABST
    Figure CN119169387A_ABST
Patent Text Reader

Abstract

The invention discloses a rapid ship classification and identification method for an overwater checkpoint. The method comprises the following steps: constructing a clear ship data set and a rain and fog ship image data set; an image preprocessing module based on a DDPM model is pre-trained, and is used for inputting a noise image and a rain and fog ship image, outputting a predicted clear ship image, constructing an SRLAN network and an RAR-YOLOv8 network, and training to obtain a ship classification and recognition model which is used for classification and recognition of a target in the rain and fog ship image to be recognized. The image preprocessing module designed by the invention can remove various interference information generated by weather reasons in the ship image, and solves the problem of image blurring. An SRLAN network and a multi-scale agency attention mechanism are added in an RAR-YOLOv8 network, and rejection loss is used, so that information related to a small target is effectively reserved while a multi-scale receptive field is realized, multi-scale feature fusion is promoted, and calculation complexity is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image processing, and in particular to a method for rapid classification and identification of ships for water checkpoints. Background Art

[0002] With the increasing development of transportation, river transportation, as an economical and environmentally friendly inland transportation mode, plays an indispensable role in the modern logistics system with its advantages of low transportation costs, environmental friendliness, large-scale cargo carrying capacity, stability and energy efficiency. At the same time, monitoring and detecting ships can not only improve the safety of transportation, prevent and reduce accidents, but also effectively control water transportation, optimize ship scheduling, and protect the water environment, thereby improving the overall maritime management and service level and promoting the prosperity and development of the regional economy.

[0003] Early ship detection used aperture radar (SAR) images. Although SAR images have advantages such as strong anti-interference ability and strong penetration, they also have prominent disadvantages, such as high difficulty in image processing and detection, and low image resolution. With the development of remote sensing technology, the emergence of high-resolution optical remote sensing images, remote sensing images with richer details, and the use of satellite visible light images for ship detection has attracted more and more attention. However, due to the influence of natural conditions such as weather and lighting, as well as the effects of various factors such as imaging equipment and satellite attitude changes, satellite visible light images are prone to blur, shadows, noise, and bright spots. At the same time, due to geographical conditions (such as water fluctuations, shoals, etc.), as well as interference from clouds and complex land edges, ship targets are often difficult to distinguish from the background, and may even be submerged in the complex background, which brings certain difficulties to the detection of ship targets.

[0004] The traditional detection method is to use the physical parameters of the target itself, manually set the constraint range of the parameters, and then screen out the target to be detected for ship detection. However, this method has low anti-interference ability and is difficult to meet the actual use needs. In recent years, deep learning has made great progress in the fields of target detection and recognition. The deep learning method can directly process and analyze image data without relying on additional equipment, and can handle different types of ships through training models, greatly improving the detection efficiency. However, due to the complex background near the coast and changeable weather, the collected images are easily interfered by weather factors such as rain and fog, resulting in image blur, which increases the difficulty of detection. In addition, there are many types of ships, and there are small targets and ships overlapping, which can cause missed detection and false detection. Therefore, it is difficult to accurately identify and classify ships passing through the bayonet using general target detection methods.

[0005] The DDPM model (Denoising Diffusion Probabilistic Model) is also called the denoising diffusion probability model. The training process of the DDPM model is mainly divided into two processes: the forward (diffusion) process and the learning denoising process. The forward process is to gradually add Gaussian noise to a given real image x0 to obtain x0, x1, ..., which is obviously a Markov chain process. After a sufficient number of T noise additions, the image will be submerged by Gaussian noise and can be considered as an image of independent Gaussian noise in all directions. The learning denoising process is essentially the process of generating a new image from a pure noise image by gradually removing noise. For the noisy image x T , let the neural network model gradually denoise it and get X T-1 , X T-2 , ..., and finally restore the real image x0 without noise.

[0006] The YOLOv8 network is a common target detection network, including the backbone network Backbone, the neck network Neck and the detection head Head. The backbone network mainly uses the C2f module. The C2f module (CSP Bottleneck with 2Convolutions) is a key component for realizing cross-stage partial fusion. The C2f module consists of Conv1, Bottleneck, Concat, and Conv2. Conv1: First, a convolution is performed on the input feature map to double the number of channels; Bottleneck: Next are multiple Bottleneck modules to gradually extract features. Each Bottleneck module contains multiple convolutional layers, and you can configure whether to use shortcut connections (residual connections); Concat: The output feature maps of multiple Bottleneck modules are spliced ​​with the original feature maps; Conv2: Finally, the spliced ​​feature map is compressed again through a convolution to output the feature map of the target number of channels. The role of the C2f module: Feature aggregation: By splicing the output of different Bottleneck modules and the original feature map together, the C2F module can better aggregate multi-scale information. Model compression: The convolution operation in the C2F module can effectively compress the feature map and reduce the amount of calculation while maintaining or enhancing the expressiveness of the model.

[0007] Agent Attention is an attention mechanism in deep learning, also known as the agent attention mechanism. Agent Attention introduces an additional set of agent vectors A in the traditional attention triple (Q, K, V), and defines a new four-tuple attention mechanism (Q, A, K, V). In agent attention, the similarity between Q and K is not directly calculated. Instead, a small number of agent vectors A are used to collect information in K and V, and then presented to Q, so as to achieve global information modeling at a very low computational cost. Among them, Q, K, and V are the Query matrix, the Key matrix, and the Value matrix, respectively. From the overall structure, the agent attention consists of two conventional Softmax attention operations, and is equivalent to a generalized linear attention, which realizes the natural fusion of high-performance Softmax attention and efficient linear attention, and thus has the advantages of low computational complexity and strong model expression ability. In the present invention, Agent Attention is described as an agent attention unit.

[0008] Repulsion Loss is a loss function used to improve the occlusion problem in target detection. It is very useful when detecting targets in crowded scenes. Summary of the invention

[0009] The purpose of the present invention is to provide a method for quickly classifying and identifying ships at water checkpoints, which can solve the above-mentioned problems and overcome the defects of image blur caused by factors such as changeable weather, complex near-shore background, and overlapping ships causing missed detection and false detection.

[0010] In order to achieve the above-mentioned object, the technical solution adopted by the present invention is as follows: a method for rapid classification and identification of ships for water checkpoints, comprising the following steps; S1, constructs a clear ship dataset D1 and a rainy and foggy ship image dataset D2; D1 includes clear ship images with manually marked targets, D2 includes rain and fog ship images, and the rain and fog ship images in D2 correspond one to one with the clear ship images in D1; S2, pre-training an image preprocessing module, the image preprocessing module is based on the DDPM model, including a diffusion process and a denoising process, the diffusion process is used to gradually add noise to a clear ship image x to obtain a first noisy image , the denoising process is used to input the first noisy image The rainy and foggy ship image corresponding to the clear ship image x ,according to from Noise is predicted in S3, constructing an SRLAN network, including steps S31-S32; S31, construct a structural reparameterization bottleneck unit, the structural reparameterization bottleneck unit is used to input its feature The first RPconv feature is obtained through a 1×1 convolutional layer , and then After two pooling operations and two point convolution operations, four features of different scales are obtained, which are marked as the second RPconv features. ~Fifth RPconv feature , respectively ~ Perform batch normalization to obtain the corresponding batch normalization features ~ , and then , ~ Add together and pass through a 1×1 convolutional layer to obtain the output features of the structurally reparameterized bottleneck unit ; S32, the SRLAN network includes a segmentation layer, N series-connected structural reparameterized bottleneck units, and a connection layer. The input features of the SRLAN network are First, the first SRLAN feature is obtained by 1×1 convolution , and then segmented by the segmentation layer to obtain the second SRLAN feature 、Third SRLAN characteristics , The bottleneck unit is reparameterized by N series structures, and the connection layer is used to The output features of the N structural reparameterized bottleneck units are connected through the connection layer, and then the output features of the SRLAN network are obtained through 1×1 convolution. ; S4, constructing a RAR-YOLOv8 network, including steps S41 to S44; S41, obtaining a YOLOv8 network, including a backbone network, a neck network and a detection head, wherein the backbone network and the neck network each include a plurality of C2f modules, the neck network includes three neck output terminals, and the detection head includes three detection modules, each detection module includes a classification branch and a regression branch; S42, the input end of the backbone network is connected to the output end of the image preprocessing module, and the C2f module in the backbone network and the neck network is replaced by the SRLAN network; S43, adding a multi-scale proxy attention module after the SRLAN network of the neck network, and the three neck output ends are respectively connected to a detection module via a multi-scale proxy attention module; S44, replace the regression loss of the regression branch with the rejection loss, and finally obtain the RAR-YOLOv8 network; S5, freeze the parameters of the image preprocessing module, use the clear image dataset D1 to train the RAR-YOLOv8 network until convergence, and obtain the ship classification and recognition model; S6, ship classification and identification; Get the image of the ship to be identified in rain and fog , randomly sample a noise image from the standard normal distribution as the second noise image ,Will and The image is sent to the image preprocessing module, and the predicted noise is obtained through the denoising process. After removing the predicted noise, the predicted clear ship image is obtained, and then the ship classification and recognition result is obtained through the backbone network, backbone network, neck network and detection head of the ship classification and recognition model.

[0011] As a preferred embodiment: S1 is specifically: Obtain clear ship images in different water camera scenes, manually annotate the targets in each clear ship image to obtain clear samples, and all clear samples constitute the clear ship dataset D1; Rain or fog is added to each clear sample to obtain rain and fog ship images. All rain and fog ship images constitute the rain and fog ship dataset D2.

[0012] Preferably: in S2, the image preprocessing module includes an improved DDPM model; The improved DDPM model includes a noise adding module and a noise prediction network. The noise adding module is used to gradually add noise to a clear ship image x to obtain a first noise image. ; The noise prediction network includes a conditional network and a residual network; The conditional network includes L layers of sequentially connected downsampling modules for inputting rainy and foggy ship images. , and downsample in sequence to obtain L downsampled images, where the first The downsampled image is , 1≤ ≤L; The residual network includes L layers of down-sampling residual blocks, self-attention convolution modules and L layers of up-sampling residual blocks arranged in sequence, wherein the first The down-sampled residual block is used to The output of the downsampled residual block is -1 Downsample and then Add together and get The output of the downsampled residual block , and when =1, for ; The improved DDPM model is trained, with the clear ship dataset D1 and the rainy and foggy ship image D2 as input, and the noise added by the denoising module as the predicted output. The model is trained until convergence to obtain the image preprocessing module.

[0013] Preferably, in S31, the two pooling operations are respectively performed by an average pooling layer and a maximum pooling layer, and the two point convolutions are respectively performed by a 3×3 point convolution layer and a 7×7 point convolution layer.

[0014] Preferably, the rejection loss L is obtained according to the following formula: , Where, L Attr is the loss value generated by the predicted box and the true target box, L RepGT is the loss value generated by the predicted box and the adjacent real target box, L ReBox is the loss value generated by the predicted box and the adjacent predicted box that does not predict the same real target, α and β are L RepGT and L ReBox The weight of .

[0015] As a preference: the multi-scale proxy attention module M SCAA It includes three proxy attention units, marked as M A1 、M A2 and M A3 ;M SCAA Input features After a fully connected layer, the first M SCAA feature , It is divided into three paths, one of which is passed through a 3×3 deep convolution layer and M A1 Get the second M SCAA feature , all the way through M A2 Get the third M SCAA feature , all the way through the 5×5 deep convolution layer and M A3 Get the fourth M SCAA feature , ~ After concatenation, it passes through a fully connected layer to obtain M SCAA Output characteristics .

[0016] Compared with the prior art, the advantages of the present invention are: (1) The present invention designs an image preprocessing module. During pre-training, the module introduces a conditional network into the existing DDPM network. During the denoising process, the rainy and foggy ship image with information such as rain and fog is input into the network as a condition to guide the prediction of noise so as to sample a clear picture without rain and fog. The module can remove various interference information caused by weather in the ship image and solve the problem of image blur.

[0017] (2) The present invention designs a structural reparameterization bottleneck unit and constructs an SRLAN network based on the unit. The input of the structural reparameterization bottleneck unit is sequentially subjected to 1×1 convolution to expand the number of channels, and then divided into 4 paths, respectively, through the average pooling layer, the maximum pooling layer, the 3×3 point convolution layer, and the 7×7 point convolution layer to extract information at different scales, and finally through the 1×1 point convolution to reduce the number of channels and compensate for the information loss that may be caused by the above operations. The SRLAN network is constructed based on N structural reparameterization bottleneck units and can effectively integrate multiple scale features. Using it to replace the C2f module in the YOLOv8 network can reduce the complexity of the model, expand the receptive field, and is conducive to preserving small target information.

[0018] (3) Based on the existing proxy attention unit, the present invention proposes a multi-scale proxy attention module. The input first passes through a fully connected layer, and then passes through three different branches to use convolution to extract information of different scales, thereby achieving global receptive field and multi-scale learning. It can achieve a natural fusion of high-performance Softmax attention and efficient linear attention, with low computational complexity and strong model expression ability.

[0019] (4) During training, the idea of ​​replacing the regression loss of the regression branch with the exclusion loss is proposed. This loss function is very useful when detecting targets in crowded scenes and can effectively solve the problem of multiple ship types and overlapping ship targets at the checkpoint.

[0020] Finally, the ship classification and recognition model obtained based on the above improvements can accurately classify and detect ships at bayonet points, which are faced with problems such as image blurring caused by weather conditions and the presence of small targets and target overlap, thereby avoiding missed detections and false detections of river ships and greatly improving the accuracy of ship detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 This is a schematic diagram of the training process of the image preprocessing module; Figure 2 Schematic diagram of the reasoning process of the image preprocessing module; Figure 3 Reparameterize bottleneck cells for structures; Figure 4 It is a schematic diagram of the SRLAN network structure; Figure 5Schematic diagram of the agent attention unit structure; Figure 6 Schematic diagram of the multi-scale agent attention module structure; Figure 7 This is a schematic diagram of the RAR-YOLOv8 network structure; Figure 8 A schematic diagram of the structure of a noise prediction network. DETAILED DESCRIPTION

[0022] The present invention will be further described below in conjunction with the accompanying drawings.

[0023] Example 1: See Figures 1 to 7 ,A method for rapid classification and identification of ships for water checkpoints, includes the following steps; S1, constructs a clear ship dataset D1 and a rainy and foggy ship image dataset D2; D1 includes clear ship images with manually marked targets, and D2 includes rain and fog ship images, and the rain and fog ship images in D2 correspond one to one with the clear ship images in D1; S2, pre-training an image preprocessing module, the image preprocessing module is based on the DDPM model, including a diffusion process and a denoising process, the diffusion process is used to gradually add noise to a clear ship image x to obtain a first noisy image , the denoising process is used to input the first noisy image The rainy and foggy ship image corresponding to the clear ship image x ,according to from Noise is predicted in S3, constructing an SRLAN network, including steps S31-S32; S31, construct a structural reparameterization bottleneck unit, the structural reparameterization bottleneck unit is used to input its feature The first RPconv feature is obtained through a 1×1 convolutional layer , and then After two pooling operations and two point convolution operations, four features of different scales are obtained, which are marked as the second RPconv features. ~Fifth RPconv feature , respectively ~ Perform batch normalization to obtain the corresponding batch normalization features ~ , and then , ~ Add together and pass through a 1×1 convolutional layer to obtain the output features of the structurally reparameterized bottleneck unit ; S32, the SRLAN network includes a segmentation layer, N series-connected structural reparameterized bottleneck units, and a connection layer. The input features of the SRLAN network are First, the first SRLAN feature is obtained by 1×1 convolution , and then segmented by the segmentation layer to obtain the second SRLAN feature 、Third SRLAN characteristics , The bottleneck unit is reparameterized by N series structures, and the connection layer is used to The output features of the N structural reparameterized bottleneck units are connected through the connection layer, and then the output features of the SRLAN network are obtained through 1×1 convolution. ; S4, constructing a RAR-YOLOv8 network, including steps S41 to S44; S41, obtaining a YOLOv8 network, including a backbone network, a neck network and a detection head, wherein the backbone network and the neck network each include a plurality of C2f modules, the neck network includes three neck output terminals, and the detection head includes three detection modules, each detection module includes a classification branch and a regression branch; S42, the input end of the backbone network is connected to the output end of the image preprocessing module, and the C2f module in the backbone network and the neck network is replaced by the SRLAN network; S43, adding a multi-scale proxy attention module after the SRLAN network of the neck network, and the three neck output ends are respectively connected to a detection module via a multi-scale proxy attention module; S44, replace the regression loss of the regression branch with the rejection loss, and finally obtain the RAR-YOLOv8 network; S5, freeze the parameters of the image preprocessing module, use the clear image dataset D1 to train the RAR-YOLOv8 network until convergence, and obtain the ship classification and recognition model; S6, ship classification and identification; Get the image of the ship to be identified in rain and fog , randomly sample a noise image from the standard normal distribution as the second noise image ,Will and The image is sent to the image preprocessing module, and the predicted noise is obtained through the denoising process. After removing the predicted noise, the predicted clear ship image is obtained, and then the ship classification and recognition result is obtained through the backbone network, backbone network, neck network and detection head of the ship classification and recognition model.

[0024] Among them, S1 is specifically: Obtain clear ship images in different water camera scenes, manually annotate the targets in each clear ship image to obtain clear samples, and all clear samples constitute the clear ship dataset D1; Rain or fog is added to each clear sample to obtain rain and fog ship images. All rain and fog ship images constitute the rain and fog ship dataset D2.

[0025] In S2, the image preprocessing module includes an improved DDPM model; The improved DDPM model includes a noise adding module and a noise prediction network. The noise adding module is used to gradually add noise to a clear ship image x to obtain a first noise image. ; The noise prediction network includes a conditional network and a residual network; The conditional network includes L layers of sequentially connected downsampling modules for inputting rainy and foggy ship images. , and downsample in sequence to obtain L downsampled images, where the first The downsampled image is , 1≤ ≤L; The residual network includes L layers of down-sampling residual blocks, self-attention convolution modules and L layers of up-sampling residual blocks arranged in sequence, wherein the first The down-sampled residual block is used to The output of the downsampled residual block is -1 Downsample and then Add together and get The output of the downsampled residual block , and when =1, for ; The improved DDPM model is trained, with the clear ship dataset D1 and the rainy and foggy ship image D2 as input, and the noise added by the denoising module as the predicted output. The model is trained until convergence to obtain the image preprocessing module.

[0026] In S31, the two pooling operations are performed by the average pooling layer and the maximum pooling layer respectively, and the two point convolutions are performed by the 3×3 point convolution layer and the 7×7 point convolution layer respectively.

[0027] The rejection loss L is obtained according to the following formula: , Where, L Attr is the loss value generated by the predicted box and the true target box, L RepGT is the loss value generated by the predicted box and the adjacent real target box, L ReBox is the loss value generated by the predicted box and the adjacent predicted box that does not predict the same real target, α and β are L RepGT and L ReBox The weight of .

[0028] The multi-scale agent attention module M SCAA It includes three proxy attention units, marked as M A1 、M A2 and M A3 ;M SCAA Input features After a fully connected layer, the first M SCAA feature , It is divided into three paths, one of which is passed through a 3×3 deep convolution layer and M A1 Get the second M SCAA feature , all the way through M A2 Get the third M SCAA feature , all the way through the 5×5 deep convolution layer and M A3 Get the fourth M SCAA feature , ~ After concatenation, it passes through a fully connected layer to obtain M SCAA Output characteristics .

[0029] Example 2: See Figures 1 to 8 Based on Example 1, this example is specifically as follows: Regarding the construction of the rain and fog ship dataset D2 in S1, when adding rain or fog to each clear sample, it can be achieved by using the existing image fogging algorithm or the rainfall imaging model described in the paper Depth-attentional Features for Single-image Rain Removal.

[0030] For the training process of the DDPM model in the image preprocessing module, see Figure 1 , which is completed by the noise adding module. The noise adding process is a mathematical process with a maximum of 1000 steps. During training, the time steps of adding noise to different images are random. The diffusion process requires a for loop to predict the noise at each time step, and then use mathematical formulas to subtract the noise from the first noise image step by step, so that the predicted clear ship image output by the image preprocessing module is as equal to the real clear ship image as possible. After the training is completed, its inference process can be seen in Figure 2 In practical applications, we only need to obtain the image of the ship to be identified in rain and fog , and randomly sample a noise image from a standard normal distribution as the second noise image , use the denoising process of the image preprocessing module to get the predicted noise, and then use the mathematical formula to subtract the second noise image The mathematical process of subtracting the prediction noise at each step is Figure 2It is represented by a denoising module.

[0031] See also Figure 8 , a specific noise prediction network structure is given. In this figure, the image input to the conditional network and the residual network is first convolved by the convolution block, and then subjected to subsequent downsampling, upsampling and other operations.

[0032] Example 3: In order to evaluate the performance of the proposed algorithm in the target detection task, a series of comparative experiments were conducted, and the classic target detection algorithm models recognized in the current field, such as EfficientDet, SSD, FastR-CNN, YOLOv7, and YOLOv8, were selected as benchmarks. Through these comparative experiments, the advantages and effects of the proposed model can be more comprehensively evaluated. The experimental results are shown in Table 1.

[0033] Table 1. Comparison of multi-model experimental results Model Accuracy Recall Mean average precision mAP EfficientDet 75.6 63.2 71.8 SSD 78.4 67.4 76.3 Fast R-CNN 83.7 78.0 82.0 YOLOv7 86.5 82.5 83.4 YOLOv8 91.6 86.4 89.5 The present invention 93.4 90.7 91.3 It can be seen from Table 1 that compared with other target detection methods, the accuracy, recall rate and average precision mean index of the present invention are better than all the compared existing technologies, indicating that our method can accurately detect ship images.

[0034] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for rapid classification and identification of ships for waterborne bayonet, characterized in that: The steps include: S1, constructs a clear ship dataset D1 and a rainy and foggy ship image dataset D2; D1 includes clear ship images with manually marked targets, and D2 includes rain and fog ship images, and the rain and fog ship images in D2 correspond one to one with the clear ship images in D1; S2, pre-training an image preprocessing module, the image preprocessing module is based on the DDPM model, including a diffusion process and a denoising process, the diffusion process is used to gradually add noise to a clear ship image x to obtain a first noisy image , the denoising process is used to input the first noisy image The rainy and foggy ship image corresponding to the clear ship image x ,according to from Noise is predicted in S3, constructing an SRLAN network, including steps S31-S32; S31, construct a structural reparameterization bottleneck unit, the structural reparameterization bottleneck unit is used to input its feature The first RPconv feature is obtained through a 1×1 convolutional layer , and then After two pooling operations and two point convolution operations, four features of different scales are obtained, which are marked as the second RPconv features. ~Fifth RPconv feature , respectively ~ Perform batch normalization to obtain the corresponding batch normalization features ~ , and then , ~ Add together and pass through a 1×1 convolutional layer to obtain the output features of the structurally reparameterized bottleneck unit ; S32, the SRLAN network includes a segmentation layer, N series-connected structural reparameterized bottleneck units, and a connection layer. The input features of the SRLAN network are First, the first SRLAN feature is obtained by 1×1 convolution , and then segmented by the segmentation layer to obtain the second SRLAN feature 、Third SRLAN characteristics , The bottleneck unit is reparameterized by N series structures, and the connection layer is used to The output features of the N structural reparameterized bottleneck units are connected through the connection layer, and then the output features of the SRLAN network are obtained through 1×1 convolution. ; S4, constructing a RAR-YOLOv8 network, including steps S41 to S44; S41, obtaining a YOLOv8 network, including a backbone network, a neck network and a detection head, wherein the backbone network and the neck network each include a plurality of C2f modules, the neck network includes three neck output terminals, and the detection head includes three detection modules, each detection module includes a classification branch and a regression branch; S42, the input end of the backbone network is connected to the output end of the image preprocessing module, and the C2f module in the backbone network and the neck network is replaced by the SRLAN network; S43, adding a multi-scale proxy attention module after the SRLAN network of the neck network, and the three neck output ends are respectively connected to a detection module via a multi-scale proxy attention module; S44, replace the regression loss of the regression branch with the rejection loss, and finally obtain the RAR-YOLOv8 network; S5, freeze the parameters of the image preprocessing module, use the clear image dataset D1 to train the RAR-YOLOv8 network until convergence, and obtain the ship classification and recognition model; S6, ship classification and identification; Get the image of the ship to be identified in rain and fog , randomly sample a noise image from the standard normal distribution as the second noise image ,Will and The image is sent to the image preprocessing module, and the predicted noise is obtained through the denoising process. After removing the predicted noise, the predicted clear ship image is obtained, and then the ship classification and recognition result is obtained through the backbone network, backbone network, neck network and detection head of the ship classification and recognition model.

2. A method for rapid classification and identification of ships for waterborne bayonet according to claim 1, characterized in that: S1 specifically includes: Obtain clear ship images in different water camera scenes, manually annotate the targets in each clear ship image to obtain clear samples, and all clear samples constitute the clear ship dataset D1; Rain or fog is added to each clear sample to obtain rain and fog ship images. All rain and fog ship images constitute the rain and fog ship dataset D2.

3. A method for rapid classification and identification of ships for waterborne bayonet according to claim 1, characterized in that: In S2, the image preprocessing module includes an improved DDPM model; The improved DDPM model includes a noise adding module and a noise prediction network. The noise adding module is used to gradually add noise to a clear ship image x to obtain a first noise image. ; The noise prediction network includes a conditional network and a residual network; The conditional network includes L layers of sequentially connected downsampling modules for inputting rainy and foggy ship images. , and downsample in sequence to obtain L downsampled images, where the first The downsampled image is , 1≤ ≤L; The residual network includes L layers of down-sampling residual blocks, self-attention convolution modules and L layers of up-sampling residual blocks arranged in sequence, wherein the first The down-sampled residual block is used to -1 The output of the downsampled residual block Downsample and then Add together and get The output of the downsampled residual block , and when =1, for ; The improved DDPM model is trained, with the clear ship dataset D1 and the rainy and foggy ship image D2 as input, and the noise added by the denoising module as the predicted output. The model is trained until convergence to obtain the image preprocessing module.

4. A method for rapid classification and identification of ships for waterborne bayonet according to claim 1, characterized in that: In S31, the two pooling operations are performed by the average pooling layer and the maximum pooling layer respectively, and the two point convolutions are performed by the 3×3 point convolution layer and the 7×7 point convolution layer respectively.

5. The method for rapid classification and identification of ships for waterborne bayonet according to claim 1, characterized in that: The rejection loss L is obtained according to the following formula: , Where, L Attr is the loss value generated by the predicted box and the true target box, L RepGT is the loss value generated by the predicted box and the adjacent real target box, L ReBox is the loss value generated by the predicted box and the adjacent predicted box that does not predict the same real target, α and β are L RepGT and L ReBox The weight of .

6. A method for rapid classification and identification of ships for waterborne bayonet according to claim 1, characterized in that: The multi-scale agent attention module M SCAA It includes three proxy attention units, marked as M A1 、M A2 and M A3 ;M SCAA Input features After a fully connected layer, the first M SCAA feature , It is divided into three paths, one of which is passed through a 3×3 deep convolution layer and M A1 Get the second M SCAA feature , all the way through M A2 Get the third M SCAA feature , all the way through the 5×5 deep convolution layer and M A3 Get the fourth M SCAA feature , ~ After concatenation, it passes through a fully connected layer to obtain M SCAA Output characteristics .

Citation Information

Patent Citations

  • Improved Yolo underwater image small target and occlusion target detection method

    CN112733929A

  • Optical remote sensing image cloud removal method and system based on diffusion model

    CN116777764A

  • Ship defogging method and system based on atmospheric scattering prior diffusion model

    CN117789041A

  • Diffusion model defogging method fusing parallel multi-convolution attention

    CN117994167A

  • Remote sensing vessel detection method based on lightweight model

    CN118447410A