A bank collapse identification method based on adaptive multi-scale context modeling and related device

By employing an adaptive multi-scale context modeling approach, and utilizing gating networks and multi-head supervision techniques, the problems of scale adaptability and rigid context fusion in existing technologies are solved, enabling high-precision identification and monitoring of bank collapses in complex waterfront scenarios.

CN122156961APending Publication Date: 2026-06-05HUNAN INSTITUTE OF SCIENCE AND TECHNOLOGY +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUNAN INSTITUTE OF SCIENCE AND TECHNOLOGY
Filing Date
2026-02-10
Publication Date
2026-06-05

Smart Images

  • Figure CN122156961A_ABST
    Figure CN122156961A_ABST
Patent Text Reader

Abstract

The application discloses a bank collapse identification method based on adaptive multi-scale context modeling and related devices, belonging to the technical field of computer vision. The method comprises: acquiring a bank collapse image to be identified; inputting the bank collapse image to be identified into a pre-trained bank collapse identification model to obtain a bank collapse identification result; wherein the bank collapse identification model extracts context information of deep semantic features through parallel multi-receptive field branches, quantifies feature contribution degree based on a temperature parameter gated network, and adaptively weights and fuses the context information to obtain multi-scale context enhanced features; in the decoding stage, the multi-scale context enhanced features and shallow detail features are cross-layer fused and restored to the input image scale; the model training adopts a multi-head supervision mechanism and a combined loss function to realize joint optimization. Under the condition that the bank collapse target scale span is large, the boundary is fine and narrow, and the background interference is complex, the model improves the multi-scale adaptive ability and overall segmentation precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision technology, and in particular relates to a method and related device for recognizing bank collapse based on adaptive multi-scale context modeling. Background Technology

[0002] Bank collapses are typically caused by a coupling effect of hydrodynamic scouring (toe scouring, main channel oscillation, and channel differentiation) and the stability of the bank slope soil and rock (seepage pore pressure, structural surfaces, and soil strength reduction), and are driven by factors such as rainfall infiltration, reservoir water level fluctuations, wind and waves, ship waves, and human activities such as mining and shoreline engineering modifications. Typical forms include sinkhole collapses, strip collapses, landslides / traction slips, and cantilever collapses. Currently, the observation and monitoring of bank collapses has formed a multi-source system combining manual inspection, survey lines / sections, remote sensing / UAVs, and video and sensor technology: differential GPS is used to obtain shoreline setback distances, and UAVs are used for shoreline and disaster element identification. In recent years, image-based element extraction and semantic segmentation have also been used to automatically identify bank collapse signs and quantify their scale and evolution trends.

[0003] However, existing methods still suffer from insufficient adaptability to scale and morphological changes, reflection / ripple interference, seasonal water level fluctuations, and cross-regional generalization in complex waterfront scenes. Furthermore, the extraction of fine-grained elements (cracks, trailing edges of minor collapses) needs improvement. For example, semantic segmentation networks like DeepLabv3+ are used for bank collapse recognition. These methods typically overlay a fixed-drillion-rate combination of void space pyramid pooling modules onto a standard convolutional backbone to model multi-scale contexts. While these network structures perform well in general scenarios, they exhibit significant limitations when facing complex scenes with varying scales and blurred boundaries of bank collapse targets: 1) Poor scale adaptability: Fixed void ratio combinations cannot adaptively adapt to the vast scale changes from centimeter-level cracks to meter-level sinkholes, leading to undersegmentation of small targets and oversegmentation of large targets; 2) Rigid context fusion: The contributions of different branches are treated equally, failing to adaptively weight them according to specific image content. Under background interference such as reflections and ripples, invalid context information is easily fused. Summary of the Invention

[0004] The purpose of this invention is to provide a method and related device for identifying bank collapse based on adaptive multi-scale context modeling. By quantifying the feature contribution through a gating network with temperature parameters, adaptively weighting the context features of multiple receptive fields, and introducing multi-head supervision and combination loss, the overall segmentation accuracy and stability of bank collapse categories are improved under complex waterfront backgrounds, lighting changes, and cross-regional conditions.

[0005] To achieve the above objectives, the present invention is implemented using the following technical solution:

[0006] In a first aspect, the present invention provides a method for identifying bank collapse based on adaptive multi-scale context modeling, comprising:

[0007] Obtain the image of the collapsed bank to be identified;

[0008] The image of the collapsed bank to be identified is input into a pre-trained collapsed bank recognition model to obtain the collapsed bank recognition result;

[0009] In the aforementioned bank collapse recognition model, multi-level features are extracted from the input image during the encoding stage; contextual information of deep semantic features in the multi-level features is extracted through parallel multi-receptive field branches; feature contribution is quantified based on a temperature-parameter-gated network; and multi-scale context-enhanced features are obtained by adaptively weighting and fusing the contextual information. During the decoding stage, the multi-scale context-enhanced features and shallow detail features in the multi-level features are fused across layers to restore the scale to the input image scale. The model training adopts a multi-head supervision mechanism and a combined loss function to achieve joint optimization.

[0010] Optionally, the bank collapse identification result includes an encoder network, a selective multi-scale context aggregation module, and a decoder network;

[0011] The encoder network includes multiple layers of serially connected convolutional residual blocks, including shallow residual blocks and deep residual blocks;

[0012] The selective multi-scale context aggregation module includes a serially connected feature extraction network and a gated network;

[0013] The feature extraction network includes parallel-connected 1×1 convolutional branches, multiple 3×3 dilated convolutional branches with differentiated dilation rates, and a context branch based on global average pooling.

[0014] The gated network includes a global average pooling layer, a multilayer perceptron, and a softmax function with temperature parameters connected in sequence.

[0015] The decoder network includes an upsampling layer, a 1×1 convolutional layer, a feature splicing layer, and multiple 3×3 convolutional layers connected in sequence.

[0016] Optionally, the training method for the bank collapse recognition model includes:

[0017] Obtain historical images of riverbank collapses;

[0018] The historical bank collapse images are preprocessed to obtain standard historical bank collapse images;

[0019] The standard historical bank collapse images are labeled with bank collapse boundaries and bank collapse types to obtain a sample set;

[0020] Input the sample set into the pre-built bank collapse recognition model to obtain the trained bank collapse recognition model.

[0021] Optionally, the method for preprocessing the historical bank collapse images includes: adjusting the size and number of channels of each historical bank collapse image to be consistent.

[0022] Optionally, the step of inputting the sample set into a pre-built bank collapse recognition model to obtain a trained bank collapse recognition model includes:

[0023] The input sample image is subjected to multi-level feature extraction through an encoder network to obtain deep semantic features and shallow detail features;

[0024] By using a selective multi-scale context aggregation module to enhance the context of deep semantic features, multi-scale context-enhanced features are obtained.

[0025] The multi-scale context enhancement features and shallow detail features are fused across layers and upsampled through a decoder network to obtain the landslide boundary segmentation result; wherein, the landslide boundary segmentation result includes the predicted segmentation map output by the main segmentation head and the intermediate layer supervision signal output by the auxiliary head; the intermediate layer supervision signal is the boundary label generated by the annotation mask;

[0026] Loss calculation is performed based on the bank collapse identification type and the real bank collapse type pre-labeled in the sample image; wherein, the bank collapse type includes at least artificial embankment, bank collapse and background; the loss calculation includes the combined loss of the main segmentation head and the auxiliary head, and the combined loss is composed of cross-entropy loss, Dice loss, Focal loss and the enhancement loss based on boundary label weighting;

[0027] The parameters of the bank collapse recognition model are adjusted based on the loss calculation results to obtain a trained bank collapse recognition model.

[0028] Optionally, the step of performing multi-level feature extraction on the input sample image through the encoder network to obtain deep semantic features and shallow detail features includes:

[0029] The input sample image is downsampled by shallow residual blocks to extract shallow detail features; the shallow residual blocks reduce the spatial size of the feature map by setting the convolution stride to 2.

[0030] Deep semantic features are extracted by performing dilated convolution on shallow detail features through deep residual blocks, and the resolution of deep semantic features is maintained by configuring dilated convolution in the convolutional layer of the deep residual blocks and setting the convolution stride to 1.

[0031] Optionally, the step of performing context enhancement on deep semantic features through a selective multi-scale context aggregation module to obtain multi-scale context-enhanced features includes:

[0032] The deep semantic features are convolved pointwise by a 1×1 convolution branch to obtain the first branch features; multiple parallel 3×3 dilated convolution branches are used to perform dilated convolutions with different dilation rates on the deep semantic features to obtain multiple second branch features; global average pooling is used to extract global information of the spatial dimension of the deep semantic features to obtain the third branch features; the third branch features are upsampled to restore the third branch features to the same spatial size as the first and second branch features.

[0033] Global average pooling is applied to the first branch features, each of the second branch features and the third branch features with the same spatial size through a global average pooling layer. The branch features after global average pooling are used to generate initial weight vectors through a multilayer perceptron. The initial weight vectors are normalized by a softmax function with a temperature parameter to obtain the adaptive weights of each branch.

[0034] Based on the adaptive weights, the first branch features, each of the second branch features, and the third branch features are weighted and fused channel-wise or pixel-wise to obtain multi-scale context-enhanced features.

[0035] Optionally, the step of fusing and upsampling multi-scale contextual enhancement features and shallow detail features across layers through a decoder network to obtain the landslide boundary segmentation result includes:

[0036] The resolution of multi-scale context enhancement features is amplified through an upsampling layer;

[0037] Channel dimension compression is performed on shallow detail features using a 1×1 convolutional layer;

[0038] The upsampled multi-scale context enhancement features and compressed shallow detail features are concatenated in the channel dimension through a feature concatenation layer.

[0039] Multiple 3×3 convolutional layers are used to refine the stitched fused features layer by layer, and the output is a landslide boundary segmentation result with the same scale as the input image.

[0040] Secondly, the present invention provides a bank collapse identification device based on adaptive multi-scale context modeling, comprising:

[0041] Bank Collapse Image Acquisition Module: Used to acquire bank collapse images to be identified;

[0042] Bank Collapse Recognition Result Acquisition Module: Used to input the bank collapse image to be recognized into a pre-trained bank collapse recognition model to obtain the bank collapse recognition result;

[0043] In the aforementioned bank collapse recognition model, multi-level features are extracted from the input image during the encoding stage; contextual information of deep semantic features in the multi-level features is extracted through parallel multi-receptive field branches; feature contribution is quantified based on a temperature-parameter-gated network; and multi-scale context-enhanced features are obtained by adaptively weighting and fusing the contextual information. During the decoding stage, the multi-scale context-enhanced features and shallow detail features in the multi-level features are fused across layers to restore the scale to the input image scale. The model training adopts a multi-head supervision mechanism and a combined loss function to achieve joint optimization.

[0044] Thirdly, the present invention provides a computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the bank collapse identification method based on adaptive multi-scale context modeling as described in any of the first aspects.

[0045] Compared with existing technologies, the beneficial effects achieved by this invention are as follows: By combining multi-receptive field feature extraction branches with a temperature-constrained gating network, contextual modeling is performed on the deep semantic features extracted in the encoding stage. The feature contribution is quantitatively controlled by leveraging the dynamic adjustment characteristics of temperature parameters, balancing the imbalance of bank collapse detection samples and suppressing background interference. While maintaining high spatial resolution of deep semantic features, the differences in scale and morphology of different types of bank collapse targets are effectively modeled, improving multi-scale adaptive capabilities and providing reliable basic data for bank collapse monitoring and early warning. By fusing shallow detail features and context enhancement features in the decoding stage and introducing multi-head supervision and combined loss, the overall segmentation accuracy and stability of bank collapse categories are improved under complex waterfront backgrounds, lighting changes, and cross-regional conditions, thereby enhancing the overall mIoU. By using boundary labels generated by the annotation mask as auxiliary supervision signals and combining them with boundary-related losses, the ability to characterize bank collapse boundaries and shoreline details is enhanced while maintaining regional classification accuracy, which is beneficial for subsequent quantitative analysis of indicators such as shoreline setback distance and bank collapse scale. Attached Figure Description

[0046] Figure 1 The diagram shown is a flowchart of a bank collapse identification method based on adaptive multi-scale context modeling in one embodiment of the present invention.

[0047] Figure 2 The diagram shown is a framework diagram of a bank collapse recognition model in one embodiment of the present invention;

[0048] Figure 3 The image shown is the identification result of the crater morphology of the Yangtze River-Dongting Lake shoreline in one embodiment of the present invention, wherein (a) is the image of the crater morphology to be identified, and (b) is the image of the identified crater morphology.

[0049] Figure 4The image shown is the identification result of stripe morphology identification of the Yangtze River-Dongting Lake shoreline in one embodiment of the present invention, wherein (a) is the stripe morphology image to be identified, and (b) is the stripe morphology image after identification. Detailed Implementation

[0050] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.

[0051] Example 1

[0052] like Figure 1 As shown, this embodiment provides a method for identifying bank collapse based on adaptive multi-scale context modeling, specifically including the following steps:

[0053] Step S1: Construct a sample set for bank collapse detection

[0054] This embodiment focuses on the complex riverbank scene of the Yangtze River-Dongting Lake region. It acquires a set of historical bank collapse images of the complex riverbank scene of the Yangtze River-Dongting Lake region from an unmanned aerial vehicle platform, and preprocesses and annotates the images in the historical bank collapse image set in sequence to construct a sample set for bank collapse detection.

[0055] Step S11: Normalization

[0056] The pixel values ​​of each historical bank collapse image were scaled to the range of [-1,1] or [0,1]; the number of channels was standardized and uniformly adjusted to the standard RGB three-channel input format; and the image size was standardized to 448×448.

[0057] Step S12: Standardize labeling specifications and category coding

[0058] Develop semantic mask annotation standards that include at least both collapsed and non-collapsed bank regions, and select derived labels for boundaries and transition zones. Set six basic categories: background (label 0), collapsed bank (label 1), and artificial embankment (label 2). Provide a label remapping table and scripts to ensure consistency during training and evaluation. Alternatively, expand the category configuration as needed, for example, using a four-category configuration: background, collapsed bank types (merged embankments, basalt collapses, and cracks), artificial embankment, and normal embankment.

[0059] In this embodiment, "pit collapse" refers to a bank collapse pattern in which the bank slope partially collapses in a pit-like shape or is eroded; "strip collapse" refers to a bank collapse pattern that extends in a strip along the shoreline; "crack" refers to a linear crack structure on the surface of the embankment / slope; "artificial embankment" refers to an embankment area composed of slope protection, bank protection structures, or engineered materials; and "normal embankment" refers to an embankment area that does not show significant bank collapse or abnormal signs.

[0060] Step S13: Derivative Tag Generation

[0061] The semantic mask is used to calculate the boundary map as an auxiliary supervision signal. In this embodiment, the Sobel operator or morphological gradient is used to extract boundary labels as auxiliary supervision signals for subsequent boundary-aware loss calculation. The boundary label calculation formula is as follows:

[0062] ,

[0063] in, For gradient operators, For boundary labels, To mark the mask, This is a binary threshold function.

[0064] Step S14: Rare class-driven patch sampling and multi-scale pruning

[0065] The labeled images of collapsed buildings are combined into a sample set, which is then divided into a training set: validation set: test set ratio of 6:2:2. The training set employs a rare class-driven patch sampling strategy: at most N fixed-size patches are extracted from each image to ensure that rare class samples such as cracks and collapses appear in each batch; simultaneously, a multi-scale cropping set {320, 384, 448, 512} is used for scale enhancement.

[0066] Step S2: Construct a bank collapse recognition model

[0067] like Figure 2 As shown, the overall shoreline collapse recognition model adopts a semantic segmentation structure of encoding-context aggregation-decoding, built on ResNet101. By adjusting the stride and dilation rate of some layers, the output features maintain approximately 1 / 16 of the spatial resolution while preserving a large receptive field. The specific structure is as follows:

[0068] Step S21: Construct the encoder network

[0069] A ResNet101 convolutional neural network based on residual learning is used as the encoder, and the gradient vanishing and feature degradation problems are solved through residual units. For the th There are n residual blocks, and the input features are denoted as... Output features The calculation formula is as follows:

[0070] ,

[0071] in, For the residual function, For the first The set of weights for each residual block. This represents an identity mapping when the input and output dimensions are the same. When the dimension changes (e.g., stride=2). This ensures the lossless propagation of the characteristic gradient of the collapsed bank.

[0072] Residual mapping A bottleneck structure is adopted, sequentially passing 1×1 dimensionality-reducing convolution, 3×3 spatial convolution, and 1×1 dimensionality-upgrading convolution. Each convolutional layer is followed by batch normalization and ReLU activation. The calculation formula is as follows:

[0073] ,

[0074] in, This represents the weights of the first layer's 1×1 dimensionality-reduced convolution. This represents the weights of the second-layer 3×3 spatial convolution. This represents the weights of the third layer's 1×1 up-dimensional convolution. Indicates batch normalization. This represents the ReLU activation function.

[0075] To preserve spatial resolution, dilated convolutions are introduced in Layer 3 and Layer 4 of ResNet101. For two-dimensional input signals... The void ratio is Convolution output The calculation formula is:

[0076] ,

[0077] in, For pixels index, For pixels index, for , Quantity, It is the convolution kernel.

[0078] In this embodiment, the convolutional layer of Layer 3 is set with stride=1 and r=2; the convolutional layer of Layer 4 is set with stride=1 and r=4 (or adjusted according to the output stride OS=16 requirement), thereby exponentially expanding the receptive field while avoiding downsampling, maintaining the resolution of deep features at approximately 1 / 16. By introducing a dilatation rate r>1, the sampling points of the convolutional kernel on the input feature map become sparse, thus exponentially expanding the receptive field without reducing the feature map resolution. For sinkholes: a large receptive field r=4 can cover the entire structure of a sinkhole (usually tens of meters wide), utilizing contextual information (such as surrounding farmland or roads) to assist in the determination. For cracks: maintaining a high resolution stride=1 avoids the loss of detailed information during downsampling, which is crucial for detecting cracks that are only a few centimeters wide.

[0079] Step S22: Construct the Selective Multi-Scale Context Aggregation Module (Selective ASPP)

[0080] Constructing a selective ASPP (Spatial Pyramid Pooling with Holes) at the highest semantic layer of the encoder can solve the problems of fixed-hole-rate ASPP failing to adapt to changes in the scale of bank collapse and rigid context fusion. The selective ASPP module consists of a feature extraction network and a gating network connected in series, with the specific structure as follows:

[0081] 1. Feature Extraction Network

[0082] This includes parallel-connected 1×1 convolutional branches, three 3×3 dilated convolutional branches with differentiated dilation rates (6, 12, and 18), and a context branch based on global average pooling. This is for input deep semantic features. Output of each branch The calculation formula is as follows:

[0083] Convolutional branches : ,

[0084] dilated convolution branch : ,

[0085] in, ;

[0086] Global average pooling branch :

[0087] ,

[0088] The number of output channels in each branch is uniform. After upsampling to the same spatial size, they are concatenated in the channel dimension. The number of output channels in each branch can be set to a uniform intermediate number. After concatenation, the number of channels is compressed to a preset dimension through 1×1 convolution. In this process, channel attention or SE structure can be used to recalibrate the importance of channels to highlight discriminative features. The compression ratio can be r=16.

[0089] 2. Gating Network

[0090] A global average pooling layer is used to compress the global information of the concatenated branch features to generate descriptors. The calculation formula is as follows:

[0091] ,

[0092] in, It is the splicing or fusion of features from various branches. It is the feature map height index, It is the feature map width index, It falls under the category of collapse cases.

[0093] Unnormalized weight logarithms are generated using a two-layer MLP. Application with temperature parameters The softmax function calculates the first The branch in the Weights on each channel :

[0094] ,

[0095] in, Indicates the first The characteristics of each scale are relevant to the current channel. In this embodiment, for feature channels of the crack category, the gated network automatically assigns higher weights to branches with a small porosity r=6. To suppress noise in branches with high porosity; for feature channels of the sinkhole collapse category, the branch with high porosity r=18 is given higher weight; temperature parameter Controlling the sharpness of weight distribution: The trend is toward hard choices. It tends to be evenly distributed.

[0096] 3. Weighted feature fusion

[0097] Based on adaptive weights, the outputs of each branch are weighted and fused, ultimately selecting the ASPP module output features. It is a weighted combination of the features of each branch:

[0098] ,

[0099] in, Indicates channel splicing. It is a 1×1 convolutional projection.

[0100] Step S23: Construct the decoder network

[0101] Shallow detail features output by ResNet101 Layer 1 With a large number of channels (256), dimensionality reduction is achieved first through 1×1 convolution compression:

[0102] ,

[0103] in, This represents the shallow detail features after dimensionality reduction, in this embodiment. The number of channels is set to 48.

[0104] right Perform a 4x bilinear upsampling to upsample the context-enhanced features to the same scale as the shallow detail features:

[0105] ,

[0106] in, This represents the output characteristics of the selective ASPP module after upsampling.

[0107] Through the feature splicing layer and Perform splicing along the channel dimension:

[0108] ,

[0109] in, This represents the multi-scale features after cross-channel stitching. It involves using shallow detail features that have not undergone multiple downsampling. Introduction The features used for mapping contain rich edge and texture information, which can correct the blurred shoreline boundaries caused by upsampling of deep semantic features.

[0110] Finally, the stitched multi-scale features are refined using two 3×3 convolution layers, outputting a pixel-level class probability distribution with the same scale as the input image:

[0111] ,

[0112] in, Represents the probability distribution of categories. Indicates category weight, This represents the weights of the first 3×3 convolution layer. This represents the weights of the second 3×3 convolutional layer. In this embodiment, the 3×3 convolutional layer is responsible for learning how to reconstruct the final segmentation map from semantically strong but location-coarse features and semantically weak but location-precise features.

[0113] Step S24: Design a multi-head supervision structure

[0114] In this embodiment, a main segmentation head and an auxiliary head from intermediate layers are introduced during the training phase of the bank collapse recognition model. The auxiliary head can be connected to the output features of ResNet101 Layer 3 and the output features of the selective ASPP module, and predicts the class probability map through 1×1 convolution. The main head and the auxiliary head calculate the loss separately, and the loss is weighted and summed. During the inference phase, only the output of the main head is retained, realizing deep supervision and feature refinement.

[0115] Step S3: Train the bank collapse recognition model

[0116] Step S31: Loss Function Design

[0117] Joint optimization using a combined loss function is employed. The master head loss is a weighted average of cross-entropy (CE), Dice, and Focal losses. The formulas for calculating each type of loss are as follows:

[0118] 1. Weighted cross-entropy loss

[0119] Used to handle class imbalance:

[0120] ,

[0121] in, Represents pixels Category The true label (0 or 1). For pixels Quantity, For category Quantity, This represents the probability value predicted by the model. Represents the category weight coefficient. ,in It is a category The pixel frequency. Collapsed pixels (such as cracks) typically account for less than 1%, by assigning them a larger [percentage]. This forces the model to pay more attention to these rare samples during training, preventing the model from degenerating into full background or normal embankment predictions.

[0122] 2. Multiclass Dice loss

[0123] Used to optimize the overlap of segmentation regions, making it more robust to small targets:

[0124] ,

[0125] in, To smooth out terms (e.g., 1e-5), the denominator is prevented from being zero. In this embodiment, the multi-class Dice loss can directly optimize the IoU index, making the shape prediction of the landslide area more accurate.

[0126] 3. Focal loss

[0127] Used to resolve imbalance between easy and difficult samples:

[0128] ,

[0129] in, This is a focusing parameter, typically set to 2. In this embodiment, when When dealing with easily classifiable samples, the modulation factor approaches zero. The contribution of easily classified samples to the loss is almost negligible, and gradient updates are mainly dominated by the hard-to-classify collapsing boundary pixels, which can improve boundary discrimination.

[0130] 4. Boundary perception loss

[0131] The weighted binary cross-entropy loss is:

[0132] ,

[0133] in, The boundary label generated in step S13 The provided Boolean boundary mask represents the pixel. Is it a true label for the boundary? This represents the boundary probability predicted by the model. This represents the positive and negative sample balance coefficient. In this embodiment, due to the extremely sparse boundary pixels, it is set to... To strengthen the penalty for sparse boundary pixels, the model is forced to output clear bank collapse contours. Boundary-aware loss can force the model to output clear bank collapse contours, directly combating the edge smoothing phenomenon common in semantic segmentation, and can accurately measure bank collapse backoff distance.

[0134] 5. Overall Loss Function

[0135] Main segment head loss:

[0136] ,

[0137] in, The weights are for weighted cross-entropy loss. For multi-class Dice loss weights, For Focal loss weights, Weights are used for boundary-aware loss. In this embodiment, If the boundary header is enabled, The value ranges from 0.1 to 0.2.

[0138] The auxiliary head losses are summed with weights aux=0.3 and deep=0.2. The total loss is:

[0139] ,

[0140] in, For aux loss, This is for deep loss.

[0141] Step S32: Optimizer and Learning Rate Design

[0142] The AdamW optimizer was used with an initial learning rate of 5e-4 and a weight decay coefficient of 1e-2. The learning rate was scheduled using a linear warmup (5 epochs) followed by cosine annealing to 5e-6, for a total of 50 training epochs, with 15 epochs of early stopping and patience.

[0143] Step S4: Using a drone platform, images of bank collapses in the complex riverbank landscape of the Yangtze River-Dongting Lake area are collected for identification. After processing according to the normalization steps of historical bank collapse images, these images are input into the trained bank collapse recognition model to predict the bank collapse boundary segmentation map and bank collapse category labels, achieving accurate identification of bank collapse types in complex riverbank landscapes. For example... Figure 3 As shown Figure 4 The image shows the identification results of the bank collapse identification model in this embodiment for the bank collapse morphology of the Yangtze River-Dongting Lake area. Figure 3 The middle section represents a subsidence zone within the broader context of bank collapse. Figure 4 The middle section represents a strip collapse within the morphology of a collapsed bank.

[0144] The image of the landslide to be identified, which is input into the trained landslide recognition model, is a three-dimensional tensor. :

[0145] ,

[0146] in, Indicates the spatial height of the input image. Indicates the spatial width of the input image. This indicates the number of channels in the input image. In this embodiment, The number of image channels is typically in the visible light band (red, green, blue), i.e. When dealing with multispectral UAV data, this variable can be expanded to include near-infrared bands to enhance the distinction between water and soil.

[0147] The final output of the bank collapse recognition model is a tensor. This is a probability distribution map of the categories for each pixel:

[0148] ,

[0149] in, This represents the total number of semantic categories, in this embodiment. .

[0150] Numerical constraint: for any pixel coordinate The sum of the output vectors along the channel dimensions is 1, that is: .

[0151] Example 2

[0152] This embodiment provides a bank collapse identification device based on adaptive multi-scale context modeling, including:

[0153] Bank Collapse Image Acquisition Module: Used to acquire bank collapse images to be identified;

[0154] Bank Collapse Recognition Result Acquisition Module: Used to input the bank collapse image to be recognized into a pre-trained bank collapse recognition model to obtain the bank collapse recognition result;

[0155] In the aforementioned bank collapse recognition model, multi-level features are extracted from the input image during the encoding stage; contextual information of deep semantic features in the multi-level features is extracted through parallel multi-receptive field branches; feature contribution is quantified based on a temperature-parameter-gated network; and multi-scale context-enhanced features are obtained by adaptively weighting and fusing the contextual information. During the decoding stage, the multi-scale context-enhanced features and shallow detail features in the multi-level features are fused across layers to restore the scale to the input image scale. The model training adopts a multi-head supervision mechanism and a combined loss function to achieve joint optimization.

[0156] The device provided in this embodiment can execute the bank collapse identification method based on adaptive multi-scale context modeling provided in any step of Embodiment 1, and has the corresponding functional modules and beneficial effects of the execution method.

[0157] Example 3

[0158] This embodiment provides a computer storage medium storing a computer program. When the computer program is executed by a processor, it implements the bank collapse identification method based on adaptive multi-scale context modeling as provided in any step of Embodiment 1.

[0159] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0160] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0161] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0162] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0163] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.

Claims

1. A method for identifying bank collapse based on adaptive multi-scale context modeling, characterized in that, include: Obtain the image of the collapsed bank to be identified; The image of the collapsed bank to be identified is input into a pre-trained collapsed bank recognition model to obtain the collapsed bank recognition result; In the aforementioned bank collapse recognition model, multi-level features are extracted from the input image during the encoding stage; contextual information of deep semantic features in the multi-level features is extracted through parallel multi-receptive field branches; feature contribution is quantified based on a temperature-parameter-gated network; and multi-scale context-enhanced features are obtained by adaptively weighting and fusing the contextual information. During the decoding stage, the multi-scale context-enhanced features and shallow detail features in the multi-level features are fused across layers to restore the scale to the input image scale. The model training adopts a multi-head supervision mechanism and a combined loss function to achieve joint optimization.

2. The bank collapse identification method based on adaptive multi-scale context modeling according to claim 1, characterized in that, The bank collapse identification results include an encoder network, a selective multi-scale context aggregation module, and a decoder network; The encoder network includes multiple layers of serially connected convolutional residual blocks, including shallow residual blocks and deep residual blocks; The selective multi-scale context aggregation module includes a serially connected feature extraction network and a gated network; The feature extraction network includes parallel-connected 1×1 convolutional branches, multiple 3×3 dilated convolutional branches with differentiated dilation rates, and a context branch based on global average pooling. The gated network includes a global average pooling layer, a multilayer perceptron, and a softmax function with temperature parameters connected in sequence. The decoder network includes an upsampling layer, a 1×1 convolutional layer, a feature splicing layer, and multiple 3×3 convolutional layers connected in sequence.

3. The bank collapse identification method based on adaptive multi-scale context modeling according to claim 2, characterized in that, The training method for the bank collapse recognition model includes: Obtain historical images of riverbank collapses; The historical bank collapse images are preprocessed to obtain standard historical bank collapse images; The standard historical bank collapse images are labeled with bank collapse boundaries and bank collapse types to obtain a sample set; Input the sample set into the pre-built bank collapse recognition model to obtain the trained bank collapse recognition model.

4. The bank collapse identification method based on adaptive multi-scale context modeling according to claim 3, characterized in that, The method for preprocessing the historical bank collapse images includes adjusting the size and number of channels of each historical bank collapse image to be consistent.

5. The bank collapse identification method based on adaptive multi-scale context modeling according to claim 3, characterized in that, The step of inputting the sample set into a pre-built bank collapse recognition model to obtain a trained bank collapse recognition model includes: The input sample image is subjected to multi-level feature extraction through an encoder network to obtain deep semantic features and shallow detail features; By using a selective multi-scale context aggregation module to enhance the context of deep semantic features, multi-scale context-enhanced features are obtained. The multi-scale context enhancement features and shallow detail features are fused across layers and upsampled through a decoder network to obtain the landslide boundary segmentation result; wherein, the landslide boundary segmentation result includes the predicted segmentation map output by the main segmentation head and the intermediate layer supervision signal output by the auxiliary head; the intermediate layer supervision signal is the boundary label generated by the annotation mask; Loss calculation is performed based on the bank collapse identification type and the real bank collapse type pre-labeled in the sample image; wherein, the bank collapse type includes at least artificial embankment, bank collapse and background; the loss calculation includes the combined loss of the main segmentation head and the auxiliary head, and the combined loss is composed of cross-entropy loss, Dice loss, Focal loss and the enhancement loss based on boundary label weighting; The parameters of the bank collapse recognition model are adjusted based on the loss calculation results to obtain a trained bank collapse recognition model.

6. The bank collapse identification method based on adaptive multi-scale context modeling according to claim 5, characterized in that, The process involves multi-level feature extraction of the input sample image through an encoder network to obtain deep semantic features and shallow detail features, including: The input sample image is downsampled by shallow residual blocks to extract shallow detail features; the shallow residual blocks reduce the spatial size of the feature map by setting the convolution stride to 2. Deep semantic features are extracted by performing dilated convolution on shallow detail features through deep residual blocks, and the resolution of deep semantic features is maintained by configuring dilated convolution in the convolutional layer of the deep residual blocks and setting the convolution stride to 1.

7. The bank collapse identification method based on adaptive multi-scale context modeling according to claim 5, characterized in that, The selective multi-scale context aggregation module enhances the deep semantic features to obtain multi-scale context-enhanced features, including: The deep semantic features are convolved pointwise by a 1×1 convolution branch to obtain the first branch features; multiple parallel 3×3 dilated convolution branches are used to perform dilated convolutions with different dilation rates on the deep semantic features to obtain multiple second branch features; global average pooling is used to extract global information of the spatial dimension of the deep semantic features to obtain the third branch features; the third branch features are upsampled to restore the third branch features to the same spatial size as the first and second branch features. Global average pooling is applied to the first branch features, each of the second branch features and the third branch features with the same spatial size through a global average pooling layer. The branch features after global average pooling are used to generate initial weight vectors through a multilayer perceptron. The initial weight vectors are normalized by a softmax function with a temperature parameter to obtain the adaptive weights of each branch. Based on the adaptive weights, the first branch features, each of the second branch features, and the third branch features are weighted and fused channel-wise or pixel-wise to obtain multi-scale context-enhanced features.

8. The bank collapse identification method based on adaptive multi-scale context modeling according to claim 5, characterized in that, The process of fusing and upsampling multi-scale contextual enhancement features and shallow detail features across layers through a decoder network to obtain the landslide boundary segmentation result includes: The resolution of multi-scale context enhancement features is amplified through an upsampling layer; Channel dimension compression is performed on shallow detail features using a 1×1 convolutional layer; The upsampled multi-scale context enhancement features and compressed shallow detail features are concatenated in the channel dimension through a feature concatenation layer. Multiple 3×3 convolutional layers are used to refine the stitched fused features layer by layer, and the output is a landslide boundary segmentation result with the same scale as the input image.

9. A bank collapse identification device based on adaptive multi-scale context modeling, characterized in that, include: Bank Collapse Image Acquisition Module: Used to acquire bank collapse images to be identified; Bank Collapse Recognition Result Acquisition Module: Used to input the bank collapse image to be recognized into a pre-trained bank collapse recognition model to obtain the bank collapse recognition result; In the aforementioned bank collapse recognition model, multi-level features are extracted from the input image during the encoding stage; contextual information of deep semantic features in the multi-level features is extracted through parallel multi-receptive field branches; feature contribution is quantified based on a temperature-parameter-gated network; and multi-scale context-enhanced features are obtained by adaptively weighting and fusing the contextual information. During the decoding stage, the multi-scale context-enhanced features and shallow detail features in the multi-level features are fused across layers to restore the scale to the input image scale. The model training adopts a multi-head supervision mechanism and a combined loss function to achieve joint optimization.

10. A computer storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the bank collapse identification method based on adaptive multi-scale context modeling as described in any one of claims 1-8.