Vessel detection method based on ViT architecture and visual state space model

By adopting the ship detection method based on ViT architecture and visual state space model in the target detection method, the problem of unsatisfactory ship target detection effect in remote sensing images is solved, and high-precision and efficient ship target detection are achieved.

CN119600408APending Publication Date: 2025-03-11DALIAN MARITIME UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411646578.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The existing target detection methods perform well in natural scene images, but the ship target detection effect is not ideal in remote sensing images, mainly due to difficulties such as multi-scale targets, complex backgrounds, and large and dense distribution of small targets.

Method used

Using ship detection methods based on ViT architecture and visual state space model, we use a brand new visual Transformer block and VSS Attention block based on visual state space to process Backbone network output features, enhance global and local feature fusion, and improve the fitting ability of the model.

Benefits of technology

Without adding a large amount of parameters, the accuracy and speed of ship target detection were improved. AP50 reached 95.2%, and mAP was improved by 10.2%, which significantly improved the detection effect in complex backgrounds, multi-scale and densely arranged scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119600408A_ABST
    Figure CN119600408A_ABST
Patent Text Reader

Abstract

The invention provides a ship detection method based on a ViT architecture and a visual state space model, and the method comprises the steps: improving a backbone network: designing a brand-new visual Transform block, employing a part of convolution as a token mixer, and fusing different spatial position information at lower cost; and feature enhancement is improved: a VSS Attention block based on a visual state space is designed, and the VSS Attention block is composed of a state space model series with a feed-forward network and is used for enhancing global and local features through residual connection, so that the feature fusion module better fuses the features. According to the method, a Backbone network output feature is processed by adopting a VSS Attention block based on an SSM, and nonlinear transformation is carried out on a fused global feature through a forward network, so that the fitting capability of a model is improved. Meanwhile, an experimental verification result shows that the detection effect of the method is greatly improved compared with that of an algorithm before optimization no matter in ship target detection under complex background, multi-scale and dense arrangement scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of target detection technology, and in particular to a ship detection method based on a ViT architecture and a visual state space model. Background Art

[0002] Existing target detection methods have achieved good detection results in natural scene images, but these methods are not ideal when applied to ship detection. The reason is that the characteristics of ship targets in remote sensing images bring a series of detection difficulties and challenges to the target detection task. The difficulties and challenges in the task of ship target detection in remote sensing images mainly include the following aspects:

[0003] 1) Multi-scale: There are huge differences in the scales of targets of different categories. The same category of targets also has differences in their own sizes. For example, a large cargo ship and a small yacht belong to the same category, but the target scale difference can be about ten times.

[0004] 2) There are many small targets and they are densely distributed. There are many small targets in remote sensing images, and they are densely distributed when viewed from a bird’s-eye view. For example, ships docked at ports are prone to inaccurate positioning, which can easily lead to missed detections and false detections.

[0005] 3) Complex background. Ship targets in remote sensing images are in complex scenes and are easily interfered by complex background information such as waves and clouds. These redundant information make it difficult for the detector to accurately distinguish between the target and the background, thus affecting the detection performance.

[0006] Traditional target detection methods are manually designed and feature extracted, which have weak feature expression ability, large amount of calculation, and high time complexity, and cannot meet the real-time and accuracy requirements of ship target detection tasks in complex scenes. High-resolution remote sensing images contain richer information such as shape, texture, and contour, which provides broad prospects for the development of modern remote sensing technology. Traditional target detection methods can be divided into the following four methods:

[0007] 1) The method based on grayscale statistical features is mainly because there is a certain difference in the grayscale values ​​of ships and backgrounds. Therefore, this difference can be used to select a suitable threshold to extract the ship target area in the remote sensing image. Shuai et al. based on the grayscale histogram of the ship image, by calculating the maximum inter-class variance criterion between the ship and the background, this method maximizes the grayscale difference between the divided ship target and the background, thereby solving the threshold selection problem in the threshold division, and further accurately extracts the ship target area through morphological calculation and other operations. Corbane et al. proposed an automatic detection ship model based on mathematical morphology, and through pre-processing and post-processing methods, to reduce the calculation time and the false alarm rate of the ship. The method based on grayscale statistical features is relatively simple to implement and has a fast detection speed, but it has poor adaptability in the face of complex scenes and is prone to more missed detection and false alarm problems.

[0008] 2) The template matching-based method is to establish a module library based on the ship data set and compare the representative template of the target of interest with the image. Harvey et al. used a template matching method based on mathematical morphology to reduce the problem of false detection and missed detection of ships, and rotated the ship data set at multiple angles to improve the accuracy of ship target detection. Xu et al. used a ship detection method based on Hough transform to solve the problem of easy missed detection of offshore ships in high-resolution remote sensing images. During the training process, the robust shape model is automatically learned through continuous iterations to improve the adaptability to shape-deformed targets, reduce the problem of false detection of ships, and improve the detection performance of ship targets. The template matching-based method is relatively simple and easy to implement, but the execution efficiency is low, the robustness is poor, and the detection effect is poor when facing complex environments.

[0009] 3) The method based on visual saliency essentially utilizes the rapid focusing ability of the human visual system, which will quickly focus on the area of ​​interest and ignore irrelevant background information. Based on the unsupervised ship detection method, Qi et al. used visual saliency to extract candidate target areas, adopted isomorphic filters to completely extract candidate targets, and proposed a new S-HOG descriptor to characterize ship targets. This method has certain robustness in complex scenes and effectively improves the performance of ship target detection. Based on the visual attention method of dual quaternions, Ding et al. used dual quaternions to represent high-dimensional data, and performed visual saliency detection through frequency domain characteristics to extract ship target areas. The computational complexity of this method is low, which improves the detection speed of ships. The method based on visual saliency has good detection ability in complex background conditions and has certain robustness. However, when the brightness of the target area is lower than the background brightness and the ships are densely arranged, it is easy to have the problem of false detection.

[0010] 4) The classification learning-based method uses the shape, texture and other features of the target to train the classifier, and then classifies and identifies the target. Yang et al. proposed a ship detection algorithm based on the visual search mechanism. By performing simple shape and texture analysis on the ship target, the false detection of the ship target was reduced, thereby improving the speed and accuracy of ship detection. Zhu et al. proposed a detection method based on the shape and texture features of the ship target. By performing image segmentation and target shape and texture analysis, the candidate area of ​​the ship target was obtained, and a semi-supervised hierarchical classification method of various shape and texture features was used to eliminate most of the false detection targets, thereby improving the ship detection performance. The ship detection performance of the classification learning-based method is good, but it consumes a lot of time and resources and has high complexity.

[0011] Generic object detection method based on deep learning

[0012] General object detection methods can be divided into two-stage detection methods and single-stage detection methods. The two-stage detection method first extracts features and generates candidate regions, and then classifies and locates them. RCNN first uses the selective search algorithm to generate candidate target boxes, and uses CNN to extract features and SVM to classify and locate the candidate boxes. SPPNet proposes a spatial pyramid pooling layer to generate a fixed-length representation in a feature map of any scale without considering the size of the input image. FastR-CNN combines the advantages of R-CNN and SPPNet and further improves them. When the network parameters are consistent, the bounding box regressor and detector can be trained at the same time. Faster R-CNN uses the Region Proposal Network (RPN) to extract candidate regions, realizes the sharing of convolutional features, converts bounding box generation into a regression task, and greatly improves the accuracy of object detection. R-FCN uses the Fully Convolutional Network (FCN) to improve Faster R-CNN, realizes parameter sharing, integrates the target position sensitive score map into the RoI pooling layer, and improves the detection speed of the target. FPN proposes a horizontally connected top-down structure, which has great advantages in detecting multi-scale objects by building high-level semantic information on multi-scale feature maps. Mask R-CNN further extends Faster R-CNN by adding a mask branch to refine detection details with the help of multi-task learning, thereby improving object detection performance. Cascade R-CNN cascades three RCNN networks, expands Faster R-CNN into a multi-level detector, and trains the detector using the gradual increase of the IoU threshold to further optimize the detection box and improve detection accuracy. Light-Head R-CNN further improves detection accuracy by reducing the imbalance problem at the sample, feature, and object levels through sampling, feature pyramid, and loss function.

[0013] The detection efficiency of the two-stage detection method is low and it is difficult to meet the real-time requirements. To address this problem, the single-stage detection method directly classifies and locates the target in the image. YOLO divides the image into many different regions and predicts the bounding box and category probability of each region at the same time. Although the detection speed is significantly improved, its positioning accuracy has decreased, especially for some densely distributed small targets. With the development of target detection, the YOLO series continues to pursue the best balance between speed and accuracy in real-time applications, among which YOLOv5 maintains the best detection performance on public datasets. SSD uses the improved VGG as the backbone network and uses feature maps of different scales to generate anchor boxes of different sizes for detection, thereby improving the performance of multi-target detection. RetinaNet proposes a Focal loss function to make positive and negative samples more balanced. The weight of the anchor box is dynamically adjusted according to the difficulty of the classification sample to achieve a balance between detection speed and accuracy. RefineDet regresses the bounding box from coarse to fine, and uses the idea of ​​refining the anchor box to alleviate the imbalance problem of positive and negative anchor boxes, which not only meets the real-time detection requirements, but also achieves good detection results. M2Det uses a multi-layer feature pyramid to detect targets of various scales and embeds an attention mechanism to further enhance the model's feature expression capabilities.

[0014] Remote sensing image target detection method based on deep learning

[0015] Due to the rapid development of deep learning technology in recent years, object detection technology based on convolutional neural networks has also flourished, and many general object detection models have achieved relatively good performance in various tasks. Therefore, many researchers have improved the CNN-based object detection model according to the characteristics of remote sensing image ship detection scenes, effectively improving the accuracy of ship detection. In recent years, many neural network-based ship target detection models have emerged. In 2022, Ren Z et al. proposed a high-resolution optical remote sensing image ship detection model based on saliency information. By designing the FES feature enhancement structure, SSM saliency screening mechanism, and SPB saliency prediction branch, they obtained good results on the optical remote sensing ship image dataset. In 2021, Fang JL et al. divided the image by automatic clustering technology, and used targeted saliency enhancement for different image categories, and obtained considerable detection accuracy on the SAR remote sensing image dataset. Wen XS et al. proposed an improved SSD algorithm based on feature fusion in 2020. By designing the DFF module and PFF module, the semantic information of deep network features and the detail information of shallow features are fully integrated.

[0016] In actual application scenarios, target detection models are often required to have not only high accuracy but also high detection speed. Therefore, lightweight network models have gradually developed. The mobilenet series of networks proposed by Howard AG et al. replace the ordinary convolution in the previous network with a depth-separable convolution, which greatly reduces the number of model parameters and improves the efficiency of convolution calculation, thereby achieving faster detection speed and a lighter network model. The shufflenet series proposed by Zhang X et al. further proposed the channel shuffle operation, which greatly improved the efficiency of the network. In 2023, Chen J et al. proposed FasterNet, a new family of neural networks based on the newly proposed Partial Convolution (PConv) that reduces redundant calculations and memory accesses, and can run faster on multiple processing platforms, which is better than networks such as MobileVit. On this basis, nonadet-plus integrates a variety of excellent lightweight networks and advanced technologies to obtain a lightweight target detection model that takes into account accuracy, speed and volume.

[0017] In recent years, deep learning technology has made great breakthroughs and progress in the fields of target detection, target segmentation, and target tracking. Deep convolutional neural networks can effectively extract richer features through training and learning with rich sample data to meet target detection tasks in different scenarios. At present, ship target detection based on optical remote sensing images has attracted widespread attention from many researchers and has great application value. However, due to the huge difference in the imaging methods of remote sensing images and natural images, ship targets in remote sensing images have complex backgrounds, many small targets, variable target scales, arbitrary directions, and dense distribution, which brings great challenges to target detection tasks. The existing target detection methods have achieved good detection results in natural scene images, but the ship target detection effect in optical remote sensing scenes is not ideal. Therefore, in order to solve the above problems, it is necessary to study how to transfer the target detection method in natural images to optical remote sensing images, and improve the relevant methods according to the characteristics of ship targets, so as to solve a series of difficult problems in ship target detection tasks and further improve the performance of ship target detection. This has important research significance and is of great help and role in promoting the development and progress of remote sensing technology in my country. Summary of the invention

[0018] According to the technical problems raised above, a ship detection method based on ViT architecture and visual state space model is provided. The present invention uses SSM-based VSS Attention block to process the output features of Backbone network, and performs nonlinear transformation on the fused global features through forward network to improve the fitting ability of the model.

[0019] The technical means adopted by the present invention are as follows:

[0020] A ship detection method based on ViT architecture and visual state space model,S1. Design a new visual Transformer block, use partial convolution as a token mixer, and use less cost to fuse different spatial position information;

[0021] S2. Design a VSS Attention block based on visual state space, which consists of a series of state space models with a feedforward network, and is used to enhance global and local features through residual connections, so that the feature fusion module can better fuse features.

[0022] Furthermore, in step S1, the new visual Transformer block is designed by replacing the backbone network ShuffleNetV2 1.0x of nanodet-plus with PConvFormer, where the downsampling ratios of the three stages are 1 / 4, 1 / 8, and 1 / 16 respectively, and each stage is composed of different PconvFormer blocks stacked together, which are connected by Embedding layers.

[0023] Furthermore, each Block of the PconvFormer block includes two residual sub-blocks, where:

[0024] The first residual sub-block consists of a normalization operation and a token mixer. In order to transfer information between tokens, the first residual sub-block is expressed as:

[0025] Y=PConv(Norm(X))+X

[0026] The second residual sub-block consists of a 2-layer Channel MLP and a nonlinear operation. In order to transfer information between channels, the second residual sub-block is represented as:

[0027] Z=A(Norm(Y)W1)W2+Y

[0028] Among them, W1 and W2 represent learnable parameters, and A(·) represents a nonlinear activation function.

[0029] Furthermore, in step S2, the designed VSS Attention block is based on the SS2D module and the feed-forward network, including residual connections and normalization layers, to stabilize gradient training and accelerate model convergence.

[0030] Furthermore, the SS2D module ensures the realization of the global receptive field at the cost of linear complexity, specifically including:

[0031] scan expand flattens a 2D feature into a 1D vector along 4 different directions;

[0032] S6block independently feeds the obtained 4 1D vectors in different directions into S6 operation;

[0033] Scan merge fuses the four 1D vectors in different directions into a 2D feature output.

[0034] Compared with the prior art, the present invention has the following advantages:

[0035] 1. A ship detection method based on ViT architecture and visual state space model is provided in the present invention. The VSS Attention block based on SSM is used to process the output features of the Backbone network, and the fused global features are nonlinearly transformed through a forward network to improve the fitting ability of the model.

[0036] 2. The present invention provides a ship detection method based on the ViT architecture and the visual state space model. Under the condition of the same input image resolution, the AP50 can reach 95.2% without increasing a large number of parameters, which improves the accuracy by about 10% and the mAP by 10.2%.

[0037] 3. The ship detection method based on the ViT architecture and the visual state space model provided by the present invention has a higher detection effect than the algorithm before optimization, whether it is ship target detection in complex backgrounds, multi-scales or densely arranged scenes.

[0038] Based on the above reasons, the present invention can be widely promoted in the fields of target detection and the like. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0040] Figure 1 This is a schematic diagram of the improved backbone network structure of the present invention.

[0041] Figure 2 Schematic diagram of the structure of the VSS Attention block of the present invention.

[0042] Figure 3 These are three sets of example comparison diagrams provided by the present invention. DETAILED DESCRIPTION

[0043] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only 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.

[0044] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0045] The present invention provides a ship detection method based on ViT architecture and visual state space model, comprising:

[0046] S1. Improve the backbone network:

[0047] Design a new visual Transformer block, using partial convolution (PConv) as a token mixer (TokenMixer) to fuse different spatial position information with less cost;

[0048] In this embodiment, since most of the targets in remote sensing ship detection are small in size, they are easily disturbed by noise and other ground objects, which makes the detection model prone to errors. In response to this problem, this embodiment optimizes and adjusts the NanoDet network model. According to the research of Yu WH et al., each Block of the general visual model represented by Transformer generally consists of two parts. One is the Token Mixer module for fusing spatial position information, and the other is the Channel MLP module for fusing channel information. When the token mixer takes different forms, the general visual model also changes to different types. For example, in ViT, Token Mixer is the self-attention module (Self-Attention); in MLP-Mixer, Token Mixer is Spatial MLP; in Swin Transformer, Token Mixer is Window-based Self-Attention; in GFNet, Token Mixer is 2D-FFT. The current general view is that the token mixer (Token Mixer) based on the self-attention mechanism (Self-Attention) contributes the most to the ability of the visual Transformer architecture. However, many recent studies have also shown that the Self-Attention module can actually be replaced by a simpler MLP module, and the resulting model still performs well. Therefore, it is concluded that the general macro-architecture of the visual Transformer, rather than the Token Mixer, is more important to the performance of the model. Therefore, this embodiment proposes a new visual Transformer block that uses partial convolution (PConv) as a Token Mixer to fuse different spatial position information at a lower cost.

[0049] S2. Improved feature enhancement:

[0050] The VSS Attention block based on the Visual State Space Model (VSS) is designed, which consists of a series of State Space Models (SMM) with a feed-forward network, and is used to enhance global and local features through residual connections, so that the feature fusion module can better fuse features.

[0051] In this embodiment, although Neck in Nanodet-plus uses multi-scale feature fusion to classify and locate targets, the module used in Nanodet-plus to process multi-layer feature fusion cannot fully fuse features of different scales. This causes Nanodet-plus to detect ship targets in remote sensing images, resulting in the problem of missed detection of small target objects due to the lack of more abstract semantic information in the shallow network and the problem of repeated detection due to the lack of detailed features in the deep network. In order to solve the above problems and achieve good detection performance, this embodiment designs an attention module based on the visual state space (Visual State Space Model, VSS). This block consists of a series of state space models (SMM) with a feedforward network, which effectively enhances global and local features through residual connections, so that the following feature fusion module can better fuse features.

[0052] In specific implementation, as a preferred embodiment of the present invention, in step S1, Figure 1 As shown in the figure, the designed new visual Transformer block replaces the backbone network ShuffleNetV21.0x of nanodet-plus with PConvFormer, where the downsampling ratios of the three stages are 1 / 4, 1 / 8, and 1 / 16 respectively. Each stage is composed of different PconvFormer blocks stacked together, which are connected by Embedding layers.

[0053] When specifically implemented, as a preferred embodiment of the present invention, Figure 1 As shown in (b), each Block of the PconvFormer block includes two residual sub-blocks, where:

[0054] The first residual sub-block consists of a normalization operation (Norm, which can be BN or LN, etc.) and a token mixer (TokenMixer). In order to transmit information between tokens, the first residual sub-block is represented as:

[0055] Y=PConv(Norm(X))+X

[0056] The second residual sub-block consists of a 2-layer Channel MLP and a nonlinear operation. In order to transfer information between channels, the second residual sub-block is represented as:

[0057] Z=A(Norm(Y)W1)W2+Y

[0058] Among them, W1 and W2 represent learnable parameters, and A(·) represents a nonlinear activation function.

[0059] In specific implementation, as a preferred embodiment of the present invention, in step S2, Figure 2 As shown, the designed VSSAttention block is based on the SS2D (2D-selective-scan) module and a feed-forward network, including residual connections and normalization layers, to stabilize gradient training and accelerate model convergence.

[0060] In specific implementation, as a preferred embodiment of the present invention, the SS2D module ensures the realization of the global receptive field at the cost of linear complexity, specifically including:

[0061] Scan expand flattens a 2D feature into a 1D vector along 4 different directions (upper left, lower right, lower left, upper right);

[0062] S6block independently feeds the obtained 4 1D vectors in different directions into S6 operation;

[0063] Scan merge fuses the four 1D vectors in different directions into a 2D feature output.

[0064] In summary, the model before improvement directly transmits the features extracted by the Backbone network to the Neck network for feature communication. Although this method effectively enhances the saliency of local features, it ignores the feature dependencies within the global receptive field. Previous studies have shown that increasing the receptive field can help improve model performance. In view of the large size of the feature map of the shallow network, the above embodiment of the present invention uses the SSM-based VSS Attention block to process the output features of the Backbone network, and performs nonlinear transformation on the fused global features through the forward network, thereby improving the fitting ability of the model.

[0065] In order to verify the effectiveness of the method of the present invention, the following experiments were conducted on the method of the present invention:

[0066] Experimental environment:

[0067] The experimental environment of this embodiment is: 2nd Gen Intel(R) Core(TM) i5-12400F@2.50GHz, NVIDIAGeForce RTX 3060 12G GPU, Windows 10 64-bit operating system, CUDA 12.1.1 and CUDNN8.8.1.3 GPU acceleration libraries, deep learning framework is PyTorch, version: torch1.13.1, torchvision 0.14.1; development environment: Pycharm, programming language Python 3.10.

[0068] Dataset:

[0069] The DIOR optical remote sensing dataset contains 23,463 images and 192,472 instances, covering 20 object classes. The DIOR dataset is large-scale in terms of object categories, number of object instances, and total number of images, and has a wide range of target size variations, not only in terms of spatial resolution, but also in terms of inter-class and intra-class size variations across targets. The images obtained by the DIOR dataset under different imaging conditions, weather, seasons, and image quality vary greatly. This embodiment extracts a ship dataset from the large-scale remote sensing image dataset DIOR. Since this embodiment is mainly aimed at small target ship detection, 2,702 ORS images containing ship targets are extracted from the original dataset after screening, and the images are divided into training set, verification set, and test set according to the quantity ratio of 8:1:1.

[0070] Training settings:

[0071] During the training phase, the AdamW optimizer was used, the batch size was 8, 300 epochs were trained, the learning rate was 0.001, and the weight decay was 0.05.

[0072] Verification results:

[0073] In order to better test the performance of the proposed method, it is compared with the original NanoDet-Plus of different sizes. It can be found that under the same input image resolution, the AP50 of the proposed method can reach 95.2% without increasing a large number of parameters, which improves the accuracy by about 10% and the mAP by 10.2%, which proves that the improvement of this paper is effective. As shown in the following table:

[0074] Model InputSize AP50 mAP Param(M) Ours 640 95.2 64.1 1.94 NanoDet-Plus-shufflenetv2-1.0x 640 85.0 53.9 1.17 NanoDet-Plus-shufflenetv2-1.5x 640 85.1 54.8 2.44

[0075] In order to verify the detection performance of the present invention, three groups of example images are selected for comparison: Figure 3 As shown, Figure 3 (a) is small target detection; Figure 3 (b) is multi-scale target detection; Figure 3 (c) is densely arranged target detection. The upper part of the figure shows the detection result of the method using Nanodet-Plus, and the lower part shows the detection result of the improved method of the present invention. From the analysis of the three groups of detection results, it can be concluded that the detection effect of the method of the present invention is higher than that of the algorithm before optimization, whether it is ship target detection in complex backgrounds, multi-scales, and densely arranged scenes, thereby verifying the effectiveness of the method of the present invention in practical applications.

[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A ship detection method based on ViT architecture and visual state space model, characterized in that: include: S1. Design a new visual Transformer block, use partial convolution as a token mixer, and use less cost to fuse different spatial position information; S2. Design a VSS Attention block based on visual state space, which consists of a series of state space models with a feedforward network, and is used to enhance global and local features through residual connections, so that the feature fusion module can better fuse features.

2. According to claim 1, a ship detection method based on ViT architecture and visual state space model is characterized in that: In step S1, the new visual Transformer block is designed by replacing the backbone network ShuffleNetV2 1.0x of nanodet-plus with PConvFormer. The downsampling ratios of the three stages are 1 / 4, 1 / 8, and 1 / 16 respectively. Each stage is composed of different PconvFormer blocks stacked together, which are connected by Embedding layers.

3. According to claim 2, a ship detection method based on ViT architecture and visual state space model is characterized in that: Each Block of the PconvFormer block includes two residual sub-blocks, where: The first residual sub-block consists of a normalization operation and a token mixer. In order to transfer information between tokens, the first residual sub-block is expressed as: Y=PConv(Norm(X))+X The second residual sub-block consists of a 2-layer Channel MLP and a nonlinear operation. In order to transfer information between channels, the second residual sub-block is represented as: Z=A(Norm(Y)W1)W2+Y Among them, W1 and W2 represent learnable parameters, and A(·) represents a nonlinear activation function.

4. According to claim 1, a ship detection method based on ViT architecture and visual state space model is characterized in that: In step S2, the designed VSS Attention block is based on the SS2D module and the feed-forward network, including residual connections and normalization layers, to stabilize gradient training and accelerate model convergence.

5. According to claim 4, a ship detection method based on ViT architecture and visual state space model is characterized in that: The SS2D module ensures the global receptive field at the cost of linear complexity, specifically including: scan expand flattens a 2D feature into a 1D vector along 4 different directions; The S6 block independently feeds the obtained 4 1D vectors in different directions into the S6 operation; Scan merge fuses the four 1D vectors in different directions into a 2D feature output.

Citation Information

Cited By

  • Stereoscopic target detection method and system of transformer substation inspection robot and computer equipment

    CN120495642A