Ship identification method based on SHIPMAA model
By introducing BWA and LWB modules into the U-Net model, the ability to focus on channel and spatial features and the adaptive fusion of multi-scale features are enhanced. This solves the problems of small target feature loss and poor scale adaptability in the segmentation of ships in aerial photography on the river, and achieves higher segmentation accuracy and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAIYIN INSTITUTE OF TECHNOLOGY
- Filing Date
- 2026-04-07
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies for segmenting ships in aerial photography on rivers suffer from problems such as loss of small target features, poor scale adaptability, and weak resistance to background interference. Conventional attention mechanisms and lightweight convolutions cannot effectively handle changes in ship scale and interference from similar backgrounds, resulting in low segmentation accuracy, incomplete edges, and easy omission of small targets.
A BWA module with three-way parallel pooling and convolution is introduced to enhance channel and spatial features. Combined with an LWB module, multi-scale feature adaptive fusion is achieved. Through optimized loss function and data augmentation strategy, the model's ability to perceive ship edges and details and its robustness to scale changes are improved.
It significantly improves the accuracy and completeness of aerial photography of ships on the river, solves the problem of segmenting small targets, is more adaptable, has better anti-interference ability, and is suitable for water area supervision and port navigation management.
Smart Images

Figure CN122454447A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision and image segmentation technology, specifically relating to a method for identifying ships in aerial photography of rivers based on the SHIPMAA model. Background Technology
[0002] In recent years, with the rapid development of drone technology, drone aerial images have been widely used in scenarios such as river vessel monitoring and port management.
[0003] There are three major technical challenges in aerial photography of ship segmentation on the river:
[0004] 1) Small targets have a very low pixel ratio, and their detailed features are quickly lost after being downsampled by the encoder;
[0005] 2) The ships and the water surface are highly similar in grayscale and texture, making it difficult to distinguish the foreground from the background in the model;
[0006] 3) When ships are sailing or docking in close proximity, their boundaries come into contact with each other, and conventional feature fusion cannot effectively separate independent targets.
[0007] Existing channel attention and spatial attention are general structures that do not provide specific solutions for the characteristics of small targets on the river surface; traditional multi-scale fusion and lightweight convolution are only general improvement methods and cannot adaptively handle changes in ship scale and similar background interference.
[0008] Conventional attention mechanisms only achieve simple concatenation or parallel connection of channel and spatial features, which is insufficient for capturing small target features and has weak anti-interference ability. Conventional lightweight convolution and multi-scale fusion are also mostly general technology integrations, which are difficult to solve the unique segmentation difficulties in the aerial photography scene of the river, and are prone to problems such as low segmentation accuracy, incomplete edges, and easy to miss small targets. Summary of the Invention
[0009] The purpose of this invention is to address the shortcomings of existing technologies in the segmentation of small targets of ships in aerial photography of rivers, such as loss of small target features, poor scale adaptability, weak background interference resistance, and conventional integration of attention mechanisms and lightweight structures. This invention provides a method for identifying ships in aerial photography of rivers based on the SHIPPAA model. By introducing a BWA module with an original three-way parallel pooling and convolution structure into the encoder, dual-dimensional feature enhancement of both channels and space is achieved, improving the model's ability to perceive ship edges and details. An LWB module is designed in the decoder to achieve adaptive fusion of multi-scale features, enhancing the model's robustness to scale changes. Simultaneously, combined with an optimized loss function and data augmentation strategies, the method effectively improves the segmentation accuracy and completeness of ships in high-resolution UAV aerial images of rivers.
[0010] To achieve the above objectives, the technical solution of the present invention is: a method for identifying ships in aerial photography of river surfaces based on the SHIPMAA model, comprising:
[0011] Obtain the drone aerial image dataset, perform uniform formatting on the dataset's label files, and convert them into the standardized format required for model training;
[0012] The formatted image data is augmented, and the augmented dataset is divided into training and validation sets proportionally.
[0013] A ship segmentation network based on an improved U-Net, SHIPPAA, is constructed. The BWA module is introduced into the backbone network to enhance the model's ability to focus on channel and spatial features. The LWB module is used to improve the adaptive modeling ability of space and channel. In the neck structure, a multi-scale feature fusion structure is constructed by combining multi-scale pooling and upsampling mechanisms to enhance the semantic interaction of features at different scales.
[0014] The SHIPPAA ship segmentation network is trained using the training set to obtain the optimal model weights; the optimal model is then used to segment small targets in the input UAV aerial images to output the ship segmentation results.
[0015] Furthermore, the data augmentation process includes the following operations performed in sequence: a random scaling transformation with a scaling factor ranging from 0.4 to 0.9, a random horizontal flip transformation with a probability of 0.5, a random vertical flip transformation with a probability of 0.5, and a random cropping transformation to crop the image to a preset size.
[0016] Furthermore, the processing procedure of the BWA module includes:
[0017] For the input feature map F in After batch normalization, the input is processed in three parallel branches. The first branch performs max pooling, the second branch performs global average pooling, and the third branch performs 3x3 convolution, batch normalization, and ReLU activation in sequence.
[0018]
[0019]
[0020]
[0021] in, Indicates batch normalization; , These represent max pooling, global average pooling, and 3x3 convolution, respectively. Represents the ReLU activation function;
[0022] The output features of the three branches are concatenated along the channel dimension to obtain the concatenated features. :
[0023]
[0024] splicing features Global average pooling is performed, and the weights are processed through two fully connected layers and a ReLU activation function in between. Finally, an adaptive attention weight W is generated by a sigmoid activation function, calculated as follows:
[0025]
[0026] in, It is a fully connected layer;
[0027] The attention weight W is compared with the original input feature map F. in Multiply element by element, then multiply with F in The residuals are summed to obtain the output features. The calculation formula is:
[0028]
[0029] Furthermore, the LWB module is used to fuse decoder features. Multi-scale raw features output from each stage of the encoder Its processing includes:
[0030] Encoder features for each scale The process involves sequentially performing 1x1 convolution, batch normalization, and ReLU activation, followed by bilinear interpolation to adjust the number of channels and spatial size to match the decoder features. Consistent;
[0031]
[0032]
[0033] in, This represents a 1×1 convolution; Indicates batch normalization; Represents the ReLU activation function; Indicates bilinear interpolation; This represents the spatial dimensions of the decoder features; This represents the aligned encoder features;
[0034] The adjusted encoder features are subjected to channel compression and grouped convolution. Then, a module consisting of adaptive average pooling, a one-dimensional convolution kernel with a size of 3 and padding of 1, and sigmoid activation is applied for channel weighting to obtain... ;
[0035] Decoder features Two 3x3 convolutions are performed sequentially, followed by batch normalization and ReLU activation after each convolution, and residual connections are used. Then, a module consisting of adaptive average pooling, one-dimensional convolution with a kernel size of 3 and padding of 1, and sigmoid activation is applied for channel weighting to obtain the desired result. ;
[0036] Processed encoder features Through a set of learnable, Softmax-normalized learnable weights Perform weighted fusion and combine it with the processed decoder features. Residual fusion yields :
[0037]
[0038]
[0039] in, Represents a 1+K dimensional real space. θ represents the number of multi-scale features of the encoder involved in the fusion, and θ is a learnable parameter vector.
[0040] right Channel weights are generated and weighted using a module consisting of adaptive average pooling, 1×1 convolution, ReLU, and 1×1 convolution with Sigmoid activation. Then, spatial weights are generated and weighted using a module consisting of global average pooling and global max pooling along the channel dimension, concatenation, 7×7 convolution, and sigmoid activation, to obtain... ;
[0041] The weighted features are then subjected to a series of operations: grouped convolution, batch normalization, ReLU activation, 1x1 convolution, batch normalization, ReLU activation, and 3x3 convolution and batch normalization, resulting in... ;
[0042] The obtained fusion features Features of the original decoder The final output features of the LWB module are obtained by residual fusion using residual weights initialized to a trainable scalar parameter of 0.3. The calculation formula is:
[0043] .
[0044] Furthermore, the multi-scale feature fusion structure specifically comprises: the decoder includes four upsampling stages; the first upsampling stage upsamples the deepest features of the encoder, fuses them with the third-stage features of the encoder via skip connections, and then inputs them into the LWB module, which simultaneously uses the second and first-stage features of the encoder as auxiliary inputs for multi-scale fusion; the second upsampling stage upsamples the fusion result of the first stage, fuses it with the second-stage features of the encoder, and then uses the first-stage features of the encoder as an auxiliary for fusion by the LWB module; the third upsampling stage upsamples the fusion result of the second stage, fuses it with the first-stage features of the encoder, and then processes it by the LWB module; the fourth upsampling stage upsamples the fusion result of the third stage, fuses it with the initial features of the encoder, and then processes it by the LWB module to output the final fused features.
[0045] Furthermore, the segmentation head of the SHIPMAA network consists of a 1x1 convolutional layer, which maps the number of channels of the final fused features to the number of target categories to generate an initial segmentation map; the segmentation head also includes a bilinear interpolation upsampling layer, which restores the spatial size of the initial segmentation map to the original input image size to obtain the final segmentation mask.
[0046] Furthermore, when dividing the training and validation sets, the images and their corresponding label files are divided in an 8:2 ratio and stored in the directory structure of train / images, train / labels, val / images, and val / labels respectively.
[0047] Furthermore, the Adam optimizer was used during model training, with the hyperparameters set as follows: initial learning rate of 0.001, beta1=0.9, beta2=0.999; cosine annealing was used to decay the learning rate, and learning rate warm-up was performed in the early stages of training.
[0048] Furthermore, the batch size during model training is configured based on the GPU memory capacity, set to 4 or 8, and mixed precision training is used to accelerate the training process.
[0049] Furthermore, the method uses the Dice coefficient and intersection-union ratio (IUU) as evaluation metrics for model segmentation performance, wherein the Dice coefficient is calculated using the following formula: The formula for calculating the intersection-union ratio is: , where TP represents a true positive, FP represents a false positive, and FN represents a false negative.
[0050] Compared to existing technologies, this invention offers the following advantages: Specifically addressing the three core technical challenges of small-target segmentation in aerial river photography—extremely small target scale, highly similar water surface textures, and the tendency for densely distributed ships to exhibit edge adhesion—this invention proposes a river aerial ship recognition method based on the SHIPMAA model. This invention integrates a self-designed BWA module into the backbone network. This module is not a simple combination or conventional variation of existing channel attention and spatial attention, but rather an original structure employing three-way parallel pooling and convolution. It can dynamically and adaptively adjust the weights of the three branches according to image content (ship size, background complexity), achieving more accurate and intelligent feature focusing. The module first performs BatchNorm2d batch normalization on the input feature map, then extracts significant local features, global average features, and detail features through the three branches respectively. Attention weights are generated using Sigmoid and weighted with the original features. Combined with the residual structure, gradient-friendly feature enhancement is achieved, significantly strengthening the model's ability to capture ship edge contours and subtle textures, effectively overcoming the problems of weak small-target features, strong background interference, and difficulty in segmenting edge adhesion. Meanwhile, this invention introduces an innovative LWB module into the decoder. This module is not a conventional integration of depthwise separable convolution, attention mechanisms, and multi-scale fusion techniques. Instead, it significantly improves the model's robustness to changes in the scale of ships on the river surface and its spatial and channel-based adaptive capabilities through multi-scale feature adaptive fusion and a learnable weighting mechanism, further optimizing the segmentation results. Furthermore, this invention constructs a multi-scale feature fusion structure based on skip connections and the LWB module, and outputs the results through a 1×1 convolutional layer in the segmentation head, achieving full interaction and deep fusion of high- and low-level features, effectively improving the model's segmentation accuracy and completeness for small-scale ships on the river surface. Compared to existing ship segmentation methods, the model proposed in this invention achieves more targeted and superior small-target segmentation through the synergistic effect of the BWA and LWB modules, significantly improving the accuracy of ship identification and segmentation in aerial river photography, and has broad application prospects in practical scenarios such as waterway supervision and port navigation management. Attached Figure Description
[0051] Figure 1 This is an operation flowchart of the present invention;
[0052] Figure 2 This is a schematic diagram of the SHIPMAA network structure in this invention;
[0053] Figure 3 This is a structural diagram of the BWA module in this invention;
[0054] Figure 4 This is a structural diagram of the LWB module in this invention. Detailed Implementation
[0055] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings.
[0056] This invention provides a method for identifying vessels in aerial photography of rivers based on the SHIPMAA model, including:
[0057] Obtain the drone aerial image dataset, perform uniform formatting on the dataset's label files, and convert them into the standardized format required for model training;
[0058] The formatted image data is augmented, and the augmented dataset is divided into training and validation sets proportionally.
[0059] A ship segmentation network based on an improved U-Net, SHIPPAA, is constructed. The BWA module is introduced into the backbone network to enhance the model's ability to focus on channel and spatial features. The LWB module is used to improve the adaptive modeling ability of space and channel. In the neck structure, a multi-scale feature fusion structure is constructed by combining multi-scale pooling and upsampling mechanisms to enhance the semantic interaction of features at different scales.
[0060] The SHIPPAA ship segmentation network is trained using the training set to obtain the optimal model weights; the optimal model is then used to segment small targets in the input UAV aerial images to output the ship segmentation results.
[0061] The following is a detailed implementation process of the present invention.
[0062] like Figure 1 As shown, the present invention provides a method for identifying vessels in aerial photography of rivers based on the SHIPMAA model, comprising the following steps:
[0063] (1) The labels in the pre-acquired drone aerial image dataset are uniformly formatted and converted into the standard format required for model training;
[0064] (2) Perform data augmentation on the labeled dataset images, and then divide the augmented image dataset into training set and test set;
[0065] (3) Improve the Unet model and construct a river surface aerial photography ship identification network based on the SHIPMAA model; introduce the BWA module into the backbone network to enhance the model's ability to focus on channel and spatial features; use the LWB module to improve the adaptive modeling ability of space and channel; in the neck structure, combine multi-scale pooling and upsampling mechanisms to construct a multi-scale feature fusion structure to enhance the semantic interaction of features at different scales.
[0066] (4) Input the training set images into the SHIPPMAA model for training to obtain the pre-trained SHIPPMAA model weights; use the pre-trained SHIPPMAA model weights to segment small targets in the UAV aerial images.
[0067] The specific implementation process of dividing the dataset into training and validation sets in step (1) is as follows: First, obtain the labeled drone aerial image dataset, and divide the images and corresponding label files in the dataset into training and validation sets in a ratio of 8:2; create train and val folders respectively, and create images and labels subfolders under each folder; store the divided image files in the corresponding images subfolder, and store the label files in the corresponding labels subfolder.
[0068] The data augmentation process in step (2) includes random scaling with a scaling factor ranging from 0.4 to 0.9; random horizontal flipping with a probability of 0.5; random vertical flipping with a probability of 0.5; and random cropping to a preset training size.
[0069] like Figure 2 As shown, the segmentation model in step (3) includes the BWA module for enhancing the ability to extract channel and spatial features, and the LWB module for improving the model’s spatial and channel adaptability.
[0070] The implementation process of the BWA module for enhancing channel and spatial feature extraction capabilities is as follows: The BWA module is introduced into the backbone network of the U-Net model, such as... Figure 3 As shown, the working principle of this module is as follows: First, the input feature map is batch normalized by BatchNorm2d and then distributed to three parallel branches: the left branch extracts significant local features through MaxPool2D, the middle branch extracts global average features through AvgPool2D, and the right branch completes local feature extraction and activation through 3×3 convolution, BatchNorm2d, and ReLU; the three feature maps are input together into the Sigmoid function to generate an attention weight map in the [0,1] interval, which is then multiplied element-wise with the original input feature map to obtain a weighted feature map; this weighted feature map... Figure 1 On the one hand, it directly participates in residual fusion. On the other hand, after compressing the spatial dimension through AvgPool2D, it obtains more refined weights through two layers of Linear (with ReLU activation in the middle) and Sigmoid. Finally, it is added element by element to the original input feature map to complete feature enhancement and gradient-friendly residual fusion, and outputs the final features of the module.
[0071] Core implementation formula:
[0072] The input feature map is denoted as F. in The module first extracts features through three different paths:
[0073] (13)
[0074] (14)
[0075] (15)
[0076] (16)
[0077] Then, adaptive weights W are computed using a lightweight channel attention mechanism:
[0078] (17)
[0079] Finally, the learned weights are multiplied element-wise with the original input features, and residual connections are added:
[0080] (18)
[0081] In the formula: and These are max pooling and average pooling operations, respectively. This represents a 3×3 convolution; For channel-dimensional splicing; It is a fully connected layer (linear transformation); Use the Sigmoid activation function; Represents element-wise multiplication; residual join This ensures stable gradient flow.
[0082] The implementation process of the LWB module is as follows: In the decoder, the upsampled decoder features are fused with the encoder multi-scale features. First, each encoder feature is mapped to the number of decoder channels using 1×1 convolution, BatchNorm, and ReLU. Then, it is scaled to the same size as the decoder features using bilinear interpolation. After being enhanced by a lightweight feature enhancement sequence composed of group convolution and channel fusion convolution, channel weighting is applied using a module consisting of adaptive average pooling, a one-dimensional convolution with a kernel size of 3 and padding of 1, and Sigmoid activation. The decoder features are enhanced by two 3×3 convolutions, each followed by BatchNorm and ReLU, and then reinforced with residual connections. Similarly, channel weighting is applied using a module consisting of adaptive average pooling, a one-dimensional convolution with a kernel size of 3 and padding of 1, and Sigmoid activation. Finally, the enhanced decoder features are fused with each encoder feature... The features are weighted and concatenated using trainable parameter vectors normalized by Softmax. The concatenated features are then weighted by channel weights generated by a module consisting of adaptive average pooling, 1×1 convolution, ReLU, 1×1 convolution, and Sigmoid activation. Spatial weights are then generated by a module consisting of global average pooling and global max pooling, concatenation, 7×7 convolution, and Sigmoid activation. Finally, the features are grouped into groups equal to the number of input channels, followed by BatchNorm and ReLU activation, then 1×1 convolution to reduce the dimensionality to the number of decoder channels, followed by BatchNorm and ReLU activation, and finally a 3×3 convolution with BatchNorm to output a fused feature with the same number of decoder channels. The residual weights, initialized to 0.3 by a trainable scalar parameter, are added to the original decoder features to achieve adaptive fusion and enhancement of multi-scale features.
[0083] Core implementation formula:
[0084] (19)
[0085] (20)
[0086] (twenty one)
[0087] (twenty two)
[0088] (twenty three)
[0089] (twenty four)
[0090] Then through learnable weights Multi-scale features are weighted and fused, and then fused with the decoder feature residuals:
[0091] (25)
[0092] (26)
[0093] (27)
[0094] (28)
[0095] (29)
[0096] (30)
[0097] (31)
[0098] (32)
[0099] (33)
[0100] (34)
[0101] In the formula: This represents a 1×1 convolution, used for encoder feature channel compression; Grouped convolutions reduce computation and enhance feature diversity; This represents a 3×3 convolution, which forms the core layer of the decoder's residual convolution. Indicates batch normalization; Represents the ReLU activation function; This represents the spatial dimensions of the decoder features; The multi-scale raw features output by the encoder at each stage; These are the original features after upsampling by the decoder; The Sigmoid activation function is used to generate various attention weights. This indicates adaptive average pooling (output 1×1). This represents a one-dimensional convolution (kernel size 3, padding 1). These represent global average pooling and global max pooling at the channel dimension, respectively. Represents a 7×7 convolution; Indicates tensor splicing (channel dimension); This represents tensor splicing (channel dimension), enabling multi-scale feature dimension expansion; This represents the number of multi-scale features of the encoder involved in the fusion. This represents the number of channels after encoder feature alignment; This represents the total number of channels after multi-scale feature stitching; These are trainable scalar residual weights that control the residual contribution of the original decoder features; Represents a 1+K dimensional real space (weight parameters) (value space) Represents the space of positive real numbers (residual weights) (value space) Let θ be a learnable parameter vector. After Softmax normalization, the multi-scale fusion weights are obtained. ; Features of the original decoder; This refers to the final enhanced features after fusion.
[0102] like Figure 4 As shown, the implementation process of the LWB module, which enhances the model's spatial and channel adaptability, is as follows: An LWB module is integrated into the model's decoder. This module primarily enhances the model's adaptive fusion capability for multi-scale features, while simultaneously strengthening the adaptive modeling effect across both spatial and channel dimensions. The LWB module first performs preliminary fusion of the upsampled decoder features with the encoder's multi-scale features. The encoder's multi-scale features are first mapped to the decoder's channel count via a 1×1 convolution, then scaled to a size identical to the decoder features using bilinear interpolation. Subsequently, feature enhancement is achieved through a lightweight feature enhancement structure composed of grouped convolutions and channel fusion convolutions, and an efficient channel attention module is applied to achieve accurate channel weighting. Simultaneously, the decoder features are processed through two layers of 3×1 convolutions with residual connections. After the convolutional module enhances the features, it is also connected to an efficient channel attention module to complete channel weighting. Then, the enhanced and channel-weighted decoder features are concatenated with the encoder features using learnable adaptive weights to form regular multi-scale fusion features. The concatenated multi-scale fusion features are then processed sequentially. First, global channel attention is used to generate corresponding channel weights and perform channel dimension weighting. Then, spatial attention is used to generate spatial weights and perform spatial dimension weighting. Finally, the features are processed sequentially through a fusion convolutional layer composed of group convolution and channel fusion convolution. The output fusion features have the same number of channels as the decoder. The fusion features are then added element-wise to the original decoder features using learnable residual weights, ultimately achieving efficient adaptive fusion of multi-scale features and comprehensive feature enhancement.
[0103] In step (4), in order to make full use of the performance of the experimental equipment, the model is trained on the training set. The batch size is configured according to the device's video memory capacity. When using the small memory mode, the batch size is set to 4, and when using the large memory mode, the batch size is set to 8 to balance training efficiency and video memory usage. The number of iterations is set to 200 rounds, and the initial learning rate is set to 0.001. The Adam optimizer is used, and the momentum parameters beta1 and beta2 of the Adam optimizer are set to 0.9 and 0.999, respectively. Mixed precision training is used during training to improve training efficiency, and a cosine annealing learning rate scheduling strategy is used to warm up the model in the early stage of training and then gradually decay the learning rate. After training, the model weights with the best segmentation performance on the validation set are saved for ship target segmentation in UAV aerial images.
[0104] This invention uses common standards for evaluating the performance of image segmentation algorithms: Dice coefficients, Intersection over Union (IoU), and Mean IoU.
[0105] (41) Dice coefficient: used to measure the degree of overlap between the predicted segmentation result and the true label, with a value ranging from 0 to 1. The larger the value, the better the segmentation effect; the formula is as follows:
[0106] (25)
[0107] (42) Intersection over Union (IoU): This measures the ratio of the intersection to the union of the predicted segmented region and the actual segmented region, reflecting the model's accuracy in locating the target region; the formula is shown below:
[0108] (26)
[0109] (43) Mean IoU: Represents the average of the intersection-union ratios of all classes, used to comprehensively evaluate the segmentation performance of the model across multiple classes; the formula is shown below:
[0110] (27)
[0111] 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, and IoU represents the total number of classes. i : Crossover ratio of the i-th category.
[0112] The specific experimental comparison results are shown in Table 1.
[0113] Table 1 Comparison results before and after improvement
[0114]
[0115] As shown in Table 1, compared with the U-Net model, the Dice coefficient, foreground IoU, class IoU and Mean IoU of the SHIPMAA model are improved by 9.4, 1.2, 12.2 and 6.7 percentage points respectively, which significantly improves the accuracy of ship segmentation in aerial photography of the river.
[0116] This method integrates a BWA module into the backbone network, optimizing the U-Net model's ability to extract features for ship edges and details through a structure of BatchNorm2d batch normalization, three-way parallel feature extraction, and attention-weighted residual fusion. An LWB module is introduced into the decoder to achieve adaptive fusion of multi-scale features and learnable feature weighting, improving the model's spatial and channel adaptability and enhancing its robustness to scale changes. A multi-scale feature fusion structure based on skip connections and the LWB module is designed, and the segmentation result is output through a 1×1 convolutional layer in the segmentation head, achieving full fusion of multi-scale features and significantly improving the model's segmentation accuracy and completeness for small-scale ships.
[0117] The above are preferred embodiments of the present invention. Any changes made to the technical solution of the present invention that do not exceed the scope of the technical solution of the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for identifying vessels in aerial river photography based on the SHIPPAA model, characterized in that, include: Obtain the drone aerial image dataset, perform uniform formatting on the dataset's label files, and convert them into the standardized format required for model training; The formatted image data is augmented, and the augmented dataset is divided into training and validation sets proportionally. A ship segmentation network based on an improved U-Net, SHIPPAA, is constructed. The BWA module is introduced into the backbone network to enhance the model's ability to focus on channel and spatial features. The LWB module is used to improve the adaptive modeling ability of space and channel. In the neck structure, a multi-scale feature fusion structure is constructed by combining multi-scale pooling and upsampling mechanisms to enhance the semantic interaction of features at different scales. The SHIPPAA ship segmentation network is trained using the training set to obtain the optimal model weights; the optimal model is then used to segment small targets in the input UAV aerial images to output the ship segmentation results.
2. The method for identifying vessels in aerial photography of rivers based on the SHIPMAA model according to claim 1, characterized in that, The data augmentation process includes the following operations performed in sequence: random scaling transformation with a scaling factor ranging from 0.4 to 0.9, random horizontal flip transformation with a probability of 0.5, random vertical flip transformation with a probability of 0.5, and random cropping transformation to crop the image to a preset size.
3. The method for identifying vessels in aerial photography of a river surface based on the SHIPPAA model according to claim 1, characterized in that, The processing procedure of the BWA module includes: For the input feature map F in After batch normalization, the input is processed in three parallel branches. The first branch performs max pooling, the second branch performs global average pooling, and the third branch performs 3x3 convolution, batch normalization, and ReLU activation in sequence. in, Indicates batch normalization; , These represent max pooling, global average pooling, and 3x3 convolution, respectively. Represents the ReLU activation function; The output features of the three branches are concatenated along the channel dimension to obtain the concatenated features. : splicing features Global average pooling is performed, and the weights are processed through two fully connected layers and a ReLU activation function in between. Finally, an adaptive attention weight W is generated by a sigmoid activation function, calculated as follows: in, It is a fully connected layer; The attention weight W is compared with the original input feature map F. in Multiply element by element, then multiply with F in The residuals are summed to obtain the output features. The calculation formula is:
4. The method for identifying vessels in aerial photography of a river surface based on the SHIPMAA model according to claim 1, characterized in that, The LWB module is used to fuse decoder features. Multi-scale raw features output from each stage of the encoder Its processing includes: Encoder features for each scale The process involves sequentially performing 1x1 convolution, batch normalization, and ReLU activation, followed by bilinear interpolation to adjust the number of channels and spatial size to match the decoder features. Consistent; in, This represents a 1×1 convolution; Indicates batch normalization; Represents the ReLU activation function; Indicates bilinear interpolation; This represents the spatial dimensions of the decoder features; This represents the aligned encoder features; The adjusted encoder features are subjected to channel compression and grouped convolution processing. A module consisting of adaptive average pooling, a one-dimensional convolution kernel with a size of 3 and padding of 1, and sigmoid activation is applied for channel weighting to obtain... ; Decoder features Two 3x3 convolutions are performed sequentially, followed by batch normalization and ReLU activation after each convolution, and residual connections are used. Then, a module consisting of adaptive average pooling, one-dimensional convolution with a kernel size of 3 and padding of 1, and sigmoid activation is applied for channel weighting to obtain the desired result. ; Processed encoder features Through a set of learnable, Softmax-normalized learnable weights Perform weighted fusion and combine it with the processed decoder features. Residual fusion yields : in, Represents a 1+K dimensional real space. θ represents the number of multi-scale features of the encoder involved in the fusion, and θ is a learnable parameter vector. right Channel weights are generated and weighted using a module consisting of adaptive average pooling, 1×1 convolution, ReLU, and 1×1 convolution with Sigmoid activation. Then, spatial weights are generated and weighted using a module consisting of global average pooling and global max pooling along the channel dimension, concatenation, 7×7 convolution, and sigmoid activation, to obtain... ; The weighted features are then subjected to a series of operations: grouped convolution, batch normalization, ReLU activation, 1x1 convolution, batch normalization, ReLU activation, and 3x3 convolution and batch normalization, resulting in... ; The obtained fusion features Features of the original decoder The final output features of the LWB module are obtained by residual fusion using residual weights initialized to a trainable scalar parameter of 0.
3. The calculation formula is: 。 5. The method for identifying vessels in aerial photography of a river surface based on the SHIPMAA model according to claim 1, characterized in that, The multi-scale feature fusion structure is as follows: the decoder includes four upsampling stages; the first upsampling stage upsamples the deepest features of the encoder, fuses them with the third-stage features of the encoder through a skip connection, and then inputs them into the LWB module, which simultaneously uses the second and first-stage features of the encoder as auxiliary inputs for multi-scale fusion; the second upsampling stage upsamples the fusion result of the first stage, fuses it with the second-stage features of the encoder, and then uses the first-stage features of the encoder as an auxiliary input for fusion by the LWB module; The third upsampling stage upsamples the fusion result from the second stage and fuses it with the features from the first stage of the encoder, then processes it through the LWB module; the fourth upsampling stage upsamples the fusion result from the third stage and fuses it with the initial features from the encoder, then processes it through the LWB module to output the final fused features.
6. The method for identifying vessels in aerial photography of a river surface based on the SHIPMAA model according to claim 5, characterized in that, The segmentation head of the SHIPMAA network consists of a 1x1 convolutional layer, which maps the number of channels of the final fused features to the number of target categories to generate an initial segmentation map. The segmentation head also includes a bilinear interpolation upsampling layer, which restores the spatial size of the initial segmentation map to the original input image size to obtain the final segmentation mask.
7. The method for identifying vessels in aerial photography of a river surface based on the SHIPMAA model according to claim 1, characterized in that, When dividing the training and validation sets, the images and their corresponding label files are divided in an 8:2 ratio and stored in the directory structure of train / images, train / labels, val / images, and val / labels respectively.
8. The method for identifying vessels in aerial photography of a river surface based on the SHIPMAA model according to claim 1, characterized in that, The Adam optimizer was used during model training. The hyperparameters of the optimizer were set as follows: initial learning rate of 0.001, beta1=0.9, beta2=0.999; cosine annealing was used to decay the learning rate, and learning rate warm-up was performed in the early stage of training.
9. The method for identifying vessels in aerial photography of a river surface based on the SHIPMAA model according to claim 1, characterized in that, The batch size during model training is configured based on the GPU memory capacity, set to 4 or 8, and mixed precision training is used to accelerate the training process.
10. The method for identifying vessels in aerial photography of a river surface based on the SHIPMAA model according to claim 1, characterized in that, The method uses the Dice coefficient and intersection-over-union ratio (IoU) as evaluation metrics for model segmentation performance, where the Dice coefficient is calculated using the following formula: The formula for calculating the intersection-union ratio is: , where TP represents a true positive, FP represents a false positive, and FN represents a false negative.