Yangtze river surface ship identification method and system based on MSA-CropNet double-branch network

By using the MSA-CropNet dual-branch network for multi-scale feature fusion and hierarchical linear attention modules, the problems of high computational overhead and insufficient generalization ability in the identification of ships on the Yangtze River are solved, achieving efficient and accurate ship identification results.

CN121838145APending Publication Date: 2026-04-10JIANGSU AVIATION VOCATIONAL & TECH COLLEGE +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-17
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing deep learning methods for identifying vessels on the Yangtze River suffer from high computational overhead, difficulty in meeting real-time requirements, sensitivity to complex lighting changes and interference, insufficient generalization ability, and limited training and evaluation of models due to insufficient datasets.

Method used

We employ an MSA-CropNet dual-branch network, combined with the multi-scale feature fusion module MSFF and the hierarchical linear attention module HLA. Through adaptive weighted feature fusion, we enhance the robustness and feature representation ability of the model. We use a self-built dataset for training and validation.

Benefits of technology

The model's recognition accuracy and real-time performance in the complex environment of the Yangtze River have been improved, its ability to identify small vessels and dense groups of vessels has been enhanced, and its generalization ability and computational efficiency have been improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121838145A_ABST
    Figure CN121838145A_ABST
Patent Text Reader

Abstract

The invention discloses a Yangtze river surface ship identification method and system based on an MSA-CropNet double-branch network, and the method comprises the steps: dividing a pre-obtained Yangtze river surface ship data set into a training set and a verification set according to a preset proportion, and carrying out the preprocessing, and obtaining the preprocessed data; a ship segmentation model based on an MSA-CropNet double-branch network is constructed; training a ship segmentation model based on an MSA-CropNet double-branch network, and continuously adjusting training parameters of the model until an optimal network model weight is obtained; verifying and evaluating the performance of the obtained optimal network model weight; loading an optimal network model weight after verification and evaluation, and segmenting a water surface ship navigation image which is actually shot to obtain a ship identification result; according to the method, the light multi-scale feature fusion module and the hierarchical linear attention module are utilized, so that the recognition accuracy of the model on the river surface ship is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision image processing and water surface vessel recognition technology, and particularly relates to a method and system for recognizing vessels on the Yangtze River based on the MSA-CropNet dual-branch network. Background Technology

[0002] As one of the busiest inland waterways, the Yangtze River's shipping management and traffic safety are of paramount importance. Rapid and accurate automatic identification and positioning of vessels on the river is a key technology for applications such as intelligent maritime supervision, traffic flow statistics, monitoring of restricted areas, and emergency rescue. In recent years, with the rapid development of computer vision and deep learning technologies, image segmentation-based vessel recognition methods have become the mainstream technology in this field, evolving primarily from traditional methods to deep learning approaches.

[0003] Before the rise of deep learning, vessel identification on the Yangtze River primarily relied on traditional digital image processing techniques. These methods typically began by preprocessing remotely sensed or surveillance images, such as converting them to grayscale, filtering for noise reduction, and enhancing contrast to improve quality. Subsequently, threshold segmentation or edge detection was used to segment the land and water regions, focusing the analysis on the river surface. Based on this, algorithms like region growing and level sets were employed, utilizing background modeling, frame differencing, or handcrafted features such as shape and texture, to separate vessel targets from the water. However, these methods heavily depended on manually designed features, exhibiting poor robustness. Faced with the complex lighting variations on the Yangtze River and interference from factors like building reflections, they were prone to false positives and false negatives, failing to meet the accuracy and stability requirements of practical applications.

[0004] With breakthroughs in convolutional neural networks (CNNs), deep learning-based image segmentation technology has fundamentally changed the technological landscape of vessel identification on the Yangtze River. These methods can automatically learn deep features of vessels from massive amounts of data, demonstrating strong robustness and accuracy. Semantic segmentation models, represented by fully convolutional networks (FCNs), U-Net, and the DeepLab series, can classify pixels in an image and output segmentation masks for categories such as "water area" and "vessel," effectively addressing the diverse scales of vessel shapes and complex interference from river waves and reflections. In scenarios requiring differentiation of individual vessels, instance segmentation models, such as Mask R-CNN, offer even greater advantages. By integrating object detection and semantic segmentation, they can generate independent masks and bounding boxes for each vessel instance, supporting refined regulatory tasks such as vessel density statistics and encounter situation analysis. However, despite the remarkable achievements of these deep learning methods, they still face many challenges when applied to practical applications. On the one hand, general-purpose models such as DeepLabv3+ and Mask R-CNN have complex structures and high computational costs, making them difficult to deploy efficiently on edge devices with high real-time requirements, such as Yangtze River waterway monitoring. On the other hand, the Yangtze River surface scene has its own unique characteristics, and the generalization ability of existing models to recognize small vessels, dense groups of vessels, and different weather and lighting conditions still needs to be improved.

[0005] Furthermore, the number of publicly available visible light ship segmentation datasets is relatively small, which further limits the training and evaluation of models. There is an urgent need to explore and make breakthroughs in data acquisition and network structure improvement. Summary of the Invention

[0006] Purpose of the invention: The purpose of this invention is to provide a method and system for identifying vessels on the Yangtze River based on the MSA-CropNet dual-branch network, which can improve the robustness of the model.

[0007] Technical solution: The present invention provides a method for identifying vessels on the Yangtze River based on an MSA-CropNet dual-branch network, comprising:

[0008] (1) Divide the pre-obtained Yangtze River vessel dataset into a training set and a validation set according to a preset ratio, and preprocess it to obtain the preprocessed data;

[0009] (2) Construct a ship segmentation model based on the MSA-CropNet dual-branch network;

[0010] (3) Train a ship segmentation model based on the MSA-CropNet dual-branch network, and continuously adjust the training parameters of the model until the optimal network model weights are obtained;

[0011] (4) Verify and evaluate the performance of the obtained optimal network model weights;

[0012] (5) Load the optimal network model weights after verification and evaluation, segment the real-shot images of ships sailing on the water, and obtain the ship recognition results.

[0013] Furthermore, the preprocessing in step (1) includes normalization and scaling operations, specifically:

[0014] First, iterate through the entire dataset, processing all the label files in each subset, which consists of the training set and the validation set. The labels are divided into background labels and ship labels. The pixel values ​​of the background labels are set to the first color pixel values, and the pixel values ​​of the ship labels are set to the second color pixel values. The colors corresponding to the first color pixel values ​​and the second color pixel values ​​are preset colors.

[0015] Secondly, based on the label image size H×W and the cutting parameters Calculate the cropping window size as and Set the sliding step size to one-quarter of the window size to create a clipped window; the formula is as follows:

[0016]

[0017]

[0018] In the formula, W is the width of the image, and H is the height of the image. This is the width of the cropped image. This represents the height of the cropped image.

[0019] Then, the positions in the label image whose pixel values ​​are exactly equal to the second color pixels are regarded as target pixels, a binary mask is generated, and the overall density of the second color pixels in the label image is calculated and recorded in the log.

[0020] Finally, the proportion of the second color pixels is calculated within each sliding window. If the local density is greater than the proportion of the second color pixels in the window to the total number of pixels in the window, the window area is cropped from the label image and the original image simultaneously and saved to the output directory.

[0021] Furthermore, the ship segmentation model based on the MSA-CropNet dual-branch network described in step (2) includes a multi-scale feature fusion module MSFF and a hierarchical linear attention module HLA.

[0022] Furthermore, the implementation process of the multi-scale feature fusion module MSFF is as follows: The following three branches of operations are performed on the input feature map.

[0023] The first branch is a standard convolution branch, which captures local feature details through 1×1 convolution;

[0024] The second branch is the scale-aware module branch, which includes three parallel branches. These branches use 3×3 dilated convolutions with dilation rates of 1, 3, and 5, and strides of 1, 1, and 2, respectively, to expand the receptive field and capture contextual information at different scales. Each branch is followed by a normalization layer with a ReLU activation function, and then by an SE module. The channel attention mechanism is used to suppress redundant information and enhance effective information. The three parallel branches are then subjected to 1×1 convolutions to obtain three new features. These three new features are summed pixel by pixel and then passed through a 3×3 convolutional layer and softmax to generate a pixel-level attention map. Finally, the attention map is used to perform weighted fusion of the multi-scale features.

[0025] The third branch is the global pooling branch, which obtains global context information through the global average pooling layer;

[0026] Finally, the standard convolution branch, scale-aware module branch, and global pooling branch are concatenated along the channel dimension to supplement local details and global context information.

[0027] Furthermore, the implementation process of the hierarchical linear attention module (HLA) is as follows:

[0028] First, multi-scale feature extraction is performed on the input feature map. The input feature map is divided into four parts along the channel dimension. Each part is extracted with multi-scale features through 3×3, 5×5, 7×7 and 9×9 depth convolutions respectively. Then, a normalization layer is applied to improve gradient propagation. Then, it is fused with the original input features through residual connections and passed through the GELU activation function to increase the multi-scale feature expressive power.

[0029] Secondly, after completing the multi-scale feature extraction, the Multi-head Efficient Attention module is used to perform global context modeling of the multi-scale features;

[0030] Finally, the four output feature maps are fused by channel concatenation, and then further fused by 1×1 convolution to achieve multi-scale feature fusion.

[0031] Furthermore, the specific structure of the ship segmentation model based on the MSA-CropNet dual-branch network is as follows:

[0032] In the first branch, the original feature image is input first, and multi-scale features are extracted through the backbone network. Then, the extracted multi-scale features are fed into a multi-scale variable row attention Transformer, which contains 6 layers. Through a deformable attention mechanism, it focuses on the corresponding spatial location, thereby enhancing the feature representation and capturing global context and local details. Then, a simple upsampling layer and lateral connections are applied to the 1 / 8 resolution feature map after convolution and channel transformation to produce a higher resolution output as new features. The The features are fed into the Multi-Scale Feature Fusion (MSFF) module. MSFF uses dilated convolutions with dilation rates of 1, 3, and 5 and strides of 1, 1, and 2 to capture multi-scale spatial context. This is followed by a normalization layer and a ReLU activation function, combined with SE blocks for adaptive weighted channel importance, outputting an enhanced feature map to replace the original mask features. The enhanced feature map is then fed into the Transformer Decoder, which consists of 3L layers. Features are input in a polling manner: the first three layers receive progressively higher resolution features, and each layer's processing includes mask attention, self-attention, and a feedforward network. The operations of the first three layers are repeated to obtain the final output feature map. Finally, the features processed by the Transformer Decoder are fed into the Hierarchical Linear Attention (HLA) module to execute the HLA implementation process.

[0033] In the second branch, all label files in the training and validation sets are traversed; based on the size and specified ratio of the label images, a fixed-size cropping window is determined, and a number of candidate windows with overlapping regions are generated with a sliding step of one-quarter of the window size; then, pure red pixels in the label images are identified as target regions, corresponding binary masks are generated, and the density of red pixels in the entire image is calculated; for each sliding window, the proportion of red pixels inside it is calculated; if the proportion exceeds a preset threshold, the window region is cropped from the label image and its corresponding original image, and the result is saved; then the same operation as in the first branch is performed.

[0034] Next, the Associonation Module is used to embed from the image level. Generate shared query vectors This associates the same entities across two paths; specifically, the Associonation Module is a Transformer architecture that includes cross-attention and self-attention, embedding EIo as a query, all As keys and values; subsequently The batch-level view is processed by the batch-level decoder. Then, batch-level entity scores and masks are generated by the prediction head and fused to improve the robustness of the overall model.

[0035] Further, step (4) includes:

[0036] The optimal network model weights are used as the pre-trained model to validate images in the validation set, and the accuracy is measured. Precision Average crossover ratio The model's performance is evaluated using four metrics: intersection-over-union ratio (IoU), and the calculation formula is as follows:

[0037]

[0038]

[0039]

[0040]

[0041] In the formula, Indicates a real example, Indicates a false positive example. Indicates a false negative. Indicates a true negative example. Indicates the total number of categories. Represents the c-th category value, Indicates the prediction area. Represents the actual area.

[0042] Further, step (5) includes: first, loading the optimized network model weights to ensure the best prediction accuracy; then, inputting the image to be processed into the ship segmentation model based on the MSA-CropNet dual-branch network, and analyzing the image based on the learned features; finally, outputting the ship segmentation result to accurately identify and segment the ship region in the image.

[0043] Based on the same inventive concept, this invention also provides a vessel identification system for the Yangtze River based on an MSA-CropNet dual-branch network, comprising:

[0044] The initialization module is used to divide the pre-obtained dataset of ships on the Yangtze River into training and validation sets according to a preset ratio, and to preprocess the data to obtain preprocessed data.

[0045] Build modules are used to construct ship segmentation models based on the MSA-CropNet dual-branch network;

[0046] The training module is used to train a ship segmentation model based on the MSA-CropNet dual-branch network, continuously adjusting the model's training parameters until the optimal network model weights are obtained.

[0047] The verification and evaluation module is used to verify and evaluate the performance of the obtained optimal network model weights;

[0048] The recognition module is used to load the optimal network model weights after verification and evaluation, segment the real-shot images of ships sailing on the water, and obtain the ship recognition results.

[0049] Based on the same inventive concept, the present invention also provides a computing device, comprising: one or more processors, one or more memories, and one or more programs, wherein the programs are stored in the memory and configured to be executed by the processor, and when the programs are loaded onto the processor, they implement the steps of the method for identifying ships on the Yangtze River surface based on the MSA-CropNet dual-branch network as described in any of the preceding claims.

[0050] Beneficial Effects: Compared with existing technologies, this invention has the following significant advantages: 1. This invention utilizes an edge detection algorithm to process a self-built Yangtze River vessel dataset. This method effectively extracts densely populated vessel areas based on pixel density through cropping, which improves the robustness of the model; 2. This invention proposes a multi-scale feature fusion module (MSFF), which extracts different features through three different branches. The standard convolution branch extracts local subtle features through 1×1 convolution; the scale-aware branch uses multiple dilated convolutions with different dilation rates to capture multi-scale contextual information and achieves adaptive weighted fusion of features through a dual channel and pixel attention mechanism; the global context branch uses global average pooling. The invention aggregates image-level semantics; three branches work together to achieve multi-scale feature extraction, enhancing the model's feature extraction capabilities; 3. This invention proposes a linear attention module (HLA), which first divides the input feature map into four parts along the channels, and uses 3×3, 5×5, 7×7 and 9×9 depth convolutions for multi-scale feature extraction, and enhances gradient flow and feature fusion through normalization layers and residual connections, and then strengthens the expressive power through the GELU activation function; subsequently, a multi-head efficient attention module is introduced for global context modeling; finally, the four feature parts are concatenated and multi-scale feature fusion is achieved through 1×1 convolution; this enhances the model's feature expression capabilities and improves the overall segmentation effect of the model. Attached Figure Description

[0051] Figure 1 This is a flowchart of a method according to an embodiment of the present invention;

[0052] Figure 2 This is a schematic diagram of the MSFF module network structure according to an embodiment of the present invention;

[0053] Figure 3 This is a schematic diagram of the HLA module network structure according to an embodiment of the present invention;

[0054] Figure 4 This is a schematic diagram of a ship segmentation model based on the MSA-CropNet dual-branch network according to an embodiment of the present invention;

[0055] Figure 5 This is a diagram illustrating the training and fitting process in an embodiment of the present invention. Detailed Implementation

[0056] To enable those skilled in the art to better understand the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.

[0057] This implementation involves a large number of variables, which are described below as shown in Table 1.

[0058] Table 1 Variable Description Table

[0059]

[0060]

[0061] As attached Figure 1 As shown, the method for identifying vessels on the Yangtze River based on the MSA-CropNet dual-branch network in this embodiment includes:

[0062] (1) Divide the pre-obtained Yangtze River vessel dataset into a training set and a validation set according to a preset ratio, and preprocess it to obtain the preprocessed data;

[0063] (2) Construct a ship segmentation model based on the MSA-CropNet dual-branch network;

[0064] (3) Train a ship segmentation model based on the MSA-CropNet dual-branch network, and continuously adjust the training parameters of the model until the optimal network model weights are obtained;

[0065] (4) Verify and evaluate the performance of the obtained optimal network model weights;

[0066] (5) Load the optimal network model weights after verification and evaluation, segment the real-shot images of ships sailing on the water, and obtain the ship recognition results.

[0067] Specifically, in step (1), firstly, the entire dataset is traversed, and all label files in each subset of the training set and validation set are processed in a loop. The labels are divided into background labels and ship labels. The pixel values ​​of the background labels are completely equal to the black pixel values, and the pixel values ​​of the ship labels are completely equal to the red pixel values. Secondly, the cropping window size is calculated as window_h and window_w according to the label image size H×W and the parameter window_size_ratio. The sliding step size is set to one-quarter of the window size to generate the cropping window. Then, the position in the label image where the pixel value is completely equal to the red pixel ([0,0,255]) is regarded as the target pixel, a binary mask is generated, and the overall density of red pixels in the label image is calculated and recorded in the log. Finally, the proportion of red pixels is calculated in each sliding window. If the local density is greater than the proportion of red pixels in the window to the total number of pixels in the window, the window area is cropped from the label image and the original image and saved to the output directory.

[0068] The calculation formulas are as follows:

[0069]

[0070]

[0071] In the formula, W is the width of the image, H is the height of the image, and window_size_ratio is the cropping parameter. This is the width of the cropped image. This is the height of the cropped image.

[0072] In step (2), the ship segmentation network includes a multi-scale feature fusion module MSFF and a hierarchical linear attention module HLA;

[0073] like Figure 2 As shown, the Multi-Scale Feature Fusion (MSFF) module comprises three core components: a standard convolution branch extracts subtle local features through 1×1 convolution; a scale-aware branch captures multi-scale contextual information using multiple dilated convolutions with different dilation rates and achieves adaptive weighted fusion of features through a dual channel and pixel attention mechanism; and a global context branch aggregates image-level semantics through global average pooling. Finally, the three outputs are concatenated along the channel dimension to fuse local details, multi-scale semantics, and global representations, enhancing the model's ability to express complex visual patterns.

[0074] like Figure 3As shown, the hierarchical linear attention module (HLA) first divides the input feature map into four sub-features along the channel dimension, and uses depthwise separable convolutions of 3×3, 5×5, 7×7, and 9×9 for multi-scale feature extraction. Each branch is followed by a normalization layer to optimize the gradient flow, and then fused with the original input features through residual connections. The GELU activation function further enhances the nonlinear representation capability. Subsequently, a multi-head efficient attention module is introduced to perform global context modeling of the multi-scale features, effectively capturing long-range dependencies. Finally, the output features of the four scales are concatenated along the channel dimension, and cross-scale feature fusion is achieved through 1×1 convolution, thereby constructing a unified representation with local detail awareness and global semantic understanding capabilities.

[0075] The implementation process of constructing the ship segmentation model based on the MSA-CropNet dual-branch network in step (3) is as follows:

[0076] In the first branch, the preprocessed features are used as input to the convolutional network for a kernel_size=1 convolution operation, followed by ReLU6 activation and layer normalization to obtain the feature vector S1. In the second branch, the preprocessed features are used as input to the convolutional network for a kernel_size=1 convolution operation, followed by ReLU6 activation and layer normalization to obtain the feature vector L1.

[0077] First, in the first branch, in the backbone network, input S1 is processed through patch merging, layer normalization, multi-head self-attention, and residual connection to obtain S12; S12 is processed through layer normalization and a fully connected feedforward network and added with residual connection to obtain S13; S13 is fed into the second block, processed through layer normalization, multi-head self-attention, and residual connection to obtain S14; S14 is processed through layer normalization and a fully connected feedforward network and added with residual connection to obtain S15;

[0078] Next, S15 is patched to obtain downsampled feature map S21; S21 is normalized, multi-head self-attention, and then residually connected to obtain S22; S22 is normalized and added to a fully connected feedforward network with residual connections to obtain S23; S23 is fed into the second block, normalized, multi-head self-attention, and then residually connected to obtain S24; S24 is normalized and added to a fully connected feedforward network with residual connections to obtain S25;

[0079] Then, S25 is patched to obtain downsampled feature map S31; S31 undergoes repeated processes of layer normalization, multi-head self-attention, re-residual connection and layer normalization, fully connected feedforward network, and residual connection to obtain S32; after entering Stage 4, S32 is patched to obtain downsampled feature map S41; S41 undergoes repeated processes of layer normalization, multi-head self-attention, re-residual connection and layer normalization, fully connected feedforward network, and residual connection to obtain S42;

[0080] Finally, the features are fed into the encoder for feature extraction to obtain S5. S5 is then fed into the MSFF (Multi-Functional Filtering), where it undergoes a 1×1 convolution in the first MSFF branch to obtain S6. In the second MSFF branch, it passes through 3×3 convolutions of different scales, normalization layers, and ReLU activation functions, followed by the SE (Search Engine) module. Subsequently, the three parallel branches undergo 1×1 convolutions (with the third branch undergoing bilinear interpolation) to obtain S511, S512, and S513. These three new features are then summed pixel-wise to obtain S7. S7 is then passed through a 3×3 convolutional layer and softmax to generate a pixel-level attention map. Finally, the attention map is used to perform weighted fusion of the multi-scale features to obtain S1. 8; In the third MSFF branch, S5 is processed by a global pooling layer to obtain S9; S6, S8, and S9 are concatenated by channels to obtain S10; S10 is processed by a 1×1 convolution to obtain S11; S11 is fed into the decoder to obtain S12; S12 is fed into the HLA module, where the feature vector is split into four branches. Each branch is processed by depthwise separable convolutions of 3×3, 5×5, 7×7, and 9×9 respectively, then processed by BatchNorm2d and residually linked with the original input, and finally processed by the GELU function to obtain four new features S121, S122, S123, and S124. Multi-head is then used... The Efficient Attention module performs global context modeling on multi-scale features to obtain S131, S132, S133, and S134. These four feature maps are fused through channel concatenation, and then further fused using a 1×1 convolution to obtain S14. The computation process of the second branch is consistent with the first branch in structure and operation, ultimately yielding feature L14. S14 and L14 are linked by an association module to obtain E1. E1 is then used by a prediction head to obtain E2. Finally, the fusion module generates E3. The overall structure of the ship segmentation model based on the MSA-CropNet dual-branch network in this embodiment is as follows: Figure 4 As shown

[0081] In step (4), the performance of the obtained optimal network model weights is verified and evaluated: the pre-built ship segmentation model based on the MSA-CropNet dual-branch network is trained, and the network model is trained iteratively multiple times, and the training parameters of the model are adjusted: learning rate, batch size, number of iterations and optimizer, until the optimal model parameters are obtained.

[0082] The best training model weights are used as the pre-trained model to validate the images in the validation set, and the results are evaluated based on accuracy, precision, and mean intersection-over-union (MIU). and intersection Four metrics are used to evaluate the model's performance;

[0083] The calculation formulas for each indicator are as follows:

[0084]

[0085]

[0086]

[0087]

[0088] In the formula, TP represents true positives, FP represents false positives, FN represents false negatives, TN represents true negatives, represents the total number of classes, IoUc represents the IoU value of the c-th class, A represents the predicted region, and B represents the true region. The training and fitting process in this embodiment is as follows: Figure 5 As shown.

[0089] In step (5), the process of predicting the navigation image of ships on the water surface is as follows: First, the optimized network model weights are loaded to ensure that the prediction accuracy reaches the best; then, the image to be processed is input into the deep learning model, which analyzes the image based on its learned features; finally, the model outputs the ship segmentation result, that is, the ship region in the image is accurately identified and segmented.

[0090] Based on the same inventive concept, this embodiment also provides a Yangtze River vessel identification system based on an MSA-CropNet dual-branch network, including:

[0091] The initialization module is used to divide the pre-obtained dataset of ships on the Yangtze River into training and validation sets according to a preset ratio, and to preprocess the data to obtain preprocessed data.

[0092] Build modules are used to construct ship segmentation models based on the MSA-CropNet dual-branch network;

[0093] The training module is used to train a ship segmentation model based on the MSA-CropNet dual-branch network, continuously adjusting the model's training parameters until the optimal network model weights are obtained.

[0094] The verification and evaluation module is used to verify and evaluate the performance of the obtained optimal network model weights;

[0095] The recognition module is used to load the optimal network model weights after verification and evaluation, segment the real-shot images of ships sailing on the water, and obtain the ship recognition results.

[0096] Based on the same inventive concept, this embodiment also provides a computing device, including: one or more processors, one or more memories, and one or more programs, wherein the programs are stored in the memory and configured to be executed by the processor, and when the programs are loaded onto the processor, they implement the steps of the Yangtze River vessel identification method based on the MSA-CropNet dual-branch network as described above.

Claims

1. A method for identifying vessels on the Yangtze River based on an MSA-CropNet dual-branch network, characterized in that, include: (1) Divide the pre-obtained Yangtze River vessel dataset into a training set and a validation set according to a preset ratio, and preprocess it to obtain the preprocessed data; (2) Construct a ship segmentation model based on the MSA-CropNet dual-branch network; (3) Train a ship segmentation model based on the MSA-CropNet dual-branch network, and continuously adjust the training parameters of the model until the optimal network model weights are obtained; (4) Verify and evaluate the performance of the obtained optimal network model weights; (5) Load the optimal network model weights after verification and evaluation, segment the real-shot images of ships sailing on the water, and obtain the ship recognition results.

2. The method for identifying vessels on the Yangtze River based on the MSA-CropNet dual-branch network according to claim 1, characterized in that, The preprocessing in step (1) includes normalization and scaling operations, specifically: First, iterate through the entire dataset, processing all the label files in each subset, which consists of the training set and the validation set. The labels are divided into background labels and ship labels. The pixel values ​​of the background labels are set to the first color pixel values, and the pixel values ​​of the ship labels are set to the second color pixel values. The colors corresponding to the first color pixel values ​​and the second color pixel values ​​are preset colors. Secondly, based on the label image size H×W and the cutting parameters Calculate the cropping window size as and Set the sliding step size to one-quarter of the window size to create a clipped window; the formula is as follows: ; ; In the formula, W is the width of the image, and H is the height of the image. This is the width of the cropped image. This represents the height of the cropped image. Then, the positions in the label image whose pixel values ​​are exactly equal to the second color pixels are regarded as target pixels, a binary mask is generated, and the overall density of the second color pixels in the label image is calculated and recorded in the log. Finally, the proportion of the second color pixels is calculated within each sliding window. If the local density is greater than the proportion of the second color pixels in the window to the total number of pixels in the window, the window area is cropped from the label image and the original image simultaneously and saved to the output directory.

3. The method for identifying vessels on the Yangtze River based on the MSA-CropNet dual-branch network according to claim 1, characterized in that, The ship segmentation model based on the MSA-CropNet dual-branch network described in step (2) includes a multi-scale feature fusion module MSFF and a hierarchical linear attention module HLA.

4. The method for identifying vessels on the Yangtze River based on the MSA-CropNet dual-branch network according to claim 3, characterized in that, The multi-scale feature fusion module MSFF is implemented as follows: the following three branches of operations are performed on the input feature map. The first branch is a standard convolution branch, which captures local feature details through 1×1 convolution; The second branch is the scale-aware module branch, which includes three parallel branches. These branches use 3×3 dilated convolutions with dilation rates of 1, 3, and 5, and strides of 1, 1, and 2, respectively, to expand the receptive field and capture contextual information at different scales. Each branch is followed by a normalization layer with a ReLU activation function, and then by an SE module. The channel attention mechanism is used to suppress redundant information and enhance effective information. The three parallel branches are then subjected to 1×1 convolutions to obtain three new features. These three new features are summed pixel by pixel and then passed through a 3×3 convolutional layer and softmax to generate a pixel-level attention map. Finally, the attention map is used to perform weighted fusion of the multi-scale features. The third branch is the global pooling branch, which obtains global context information through the global average pooling layer; Finally, the standard convolution branch, scale-aware module branch, and global pooling branch are concatenated along the channel dimension to supplement local details and global context information.

5. The method for identifying vessels on the Yangtze River based on the MSA-CropNet dual-branch network according to claim 3, characterized in that, The implementation process of the hierarchical linear attention module (HLA) is as follows: First, multi-scale feature extraction is performed on the input feature map. The input feature map is divided into four parts along the channel dimension. Each part is extracted with multi-scale features through 3×3, 5×5, 7×7 and 9×9 depth convolutions respectively. Then, a normalization layer is applied to improve gradient propagation. Then, it is fused with the original input features through residual connections and passed through the GELU activation function to increase the multi-scale feature expressive power. Secondly, after completing the multi-scale feature extraction, the Multi-head Efficient Attention module is used to perform global context modeling of the multi-scale features; Finally, the four output feature maps are fused by channel concatenation, and then further fused by 1×1 convolution to achieve multi-scale feature fusion.

6. The method for identifying vessels on the Yangtze River based on the MSA-CropNet dual-branch network according to claim 3, characterized in that, The specific structure of the ship segmentation model based on the MSA-CropNet dual-branch network is as follows: In the first branch, the original feature image is input first, and multi-scale features are extracted through the backbone network. Then, the extracted multi-scale features are fed into a multi-scale variable row attention Transformer, which contains 6 layers. Through a deformable attention mechanism, it focuses on the corresponding spatial location, thereby enhancing the feature representation and capturing global context and local details. Then, a simple upsampling layer and lateral connections are applied to the 1 / 8 resolution feature map after convolution and channel transformation to produce a higher resolution output as new features. The The data is fed into the Multi-Scale Feature Fusion (MSFF) module. MSFF uses dilated convolutions with dilation rates of 1, 3, and 5 and strides of 1, 1, and 2 to capture multi-scale spatial context. It is then followed by a normalization layer and a ReLU activation function, combined with SE blocks to adaptively weight channel importance, and outputs an enhanced feature map to replace the original mask_features. Subsequently, the enhanced feature map is fed into the Transformer Decoder, which consists of 3L layers. The features are input in a polling manner: the first three layers receive progressively higher resolution features, and each layer's processing includes mask attention, self-attention, and a feedforward network; the operations of the first three layers are repeated to finally obtain the output feature map; finally, the features processed by the Transformer Decoder are fed into the Hierarchical Linear Attention (HLA) module to execute the HLA implementation process. In the second branch, all label files in the training and validation sets are traversed; based on the size of the label image and the specified ratio, a fixed-size cropping window is determined, and a number of candidate windows with overlapping regions are generated with a sliding step of one-quarter of the window size; then, pure red pixels in the label image are identified as target regions, corresponding binary masks are generated, and the density of red pixels in the entire image is counted. For each sliding window, calculate the proportion of red pixels inside it; if the proportion exceeds a preset threshold, crop the window area from the label image and its corresponding original image, and save the result; then perform the same operation as the first branch. Next, the Associonation Module is used to embed from the image level. Generate shared query vectors This associates the same entities across two paths; specifically, the Associonation Module is a Transformer architecture that includes cross-attention and self-attention, embedding EIo as a query, all As keys and values; subsequently The batch-level view is processed by the batch-level decoder. Then, batch-level entity scores and masks are generated by the prediction head and fused to improve the robustness of the overall model.

7. The method for identifying vessels on the Yangtze River based on the MSA-CropNet dual-branch network according to claim 1, characterized in that, Step (4) includes: The optimal network model weights are used as the pre-trained model to validate images in the validation set, and the accuracy is measured. Precision Average crossover ratio The model's performance is evaluated using four metrics: intersection-over-union ratio (IoU), and the calculation formula is as follows: ; ; ; ; In the formula, Indicates a real example, Indicates a false positive example. Indicates a false negative. Indicates a true negative example. Indicates the total number of categories. Represents the c-th category value, Indicates the prediction area. Represents the actual area.

8. The method for identifying vessels on the Yangtze River based on the MSA-CropNet dual-branch network according to claim 1, characterized in that, Step (5) includes: first, loading the optimized network model weights to ensure the best prediction accuracy; then, inputting the image to be processed into the ship segmentation model based on the MSA-CropNet dual-branch network, and analyzing the image based on the learned features; finally, outputting the ship segmentation result to accurately identify and segment the ship region in the image.

9. A vessel identification system for the Yangtze River based on an MSA-CropNet dual-branch network, characterized in that, include: The initialization module is used to divide the pre-obtained dataset of ships on the Yangtze River into training and validation sets according to a preset ratio, and to preprocess the data to obtain preprocessed data. Build modules are used to construct ship segmentation models based on the MSA-CropNet dual-branch network; The training module is used to train a ship segmentation model based on the MSA-CropNet dual-branch network, continuously adjusting the model's training parameters until the optimal network model weights are obtained. The verification and evaluation module is used to verify and evaluate the performance of the obtained optimal network model weights; The recognition module is used to load the optimal network model weights after verification and evaluation, segment the real-shot images of ships sailing on the water, and obtain the ship recognition results.

10. A computing device, characterized in that, include: One or more processors, one or more memories, and one or more programs, said programs being stored in the memory and configured to be executed by the processor, said programs being loaded onto the processor to implement the steps of the method for identifying vessels on the Yangtze River surface based on the MSA-CropNet dual-branch network according to any one of claims 1 to 8.