Remote sensing image cultivated land segmentation method and system fusing context and boundary perception
By using a collaborative context modeling module and a hierarchical feature fusion decoding mechanism, combined with a composite boundary loss function, the problems of insufficient global context modeling, cross-scale feature fusion, and boundary segmentation accuracy in farmland segmentation of remote sensing images are solved, thus achieving high-precision farmland monitoring.
Patent Information
- Application Number
- CN202511389413.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2025-11-07
AI Technical Summary
Existing methods for farmland segmentation in remote sensing images have shortcomings in global context modeling, cross-scale feature fusion, and boundary segmentation accuracy, making it difficult to achieve high-precision farmland monitoring.
By employing a collaborative context modeling module (InjectionMultiSumCBR) combined with a gated orthogonal scanning enhancement submodule and a global spatiotemporal collaborative perception submodule, and introducing a composite boundary loss function through hierarchical feature injection and gated fusion decoding mechanisms, we can achieve efficient fusion of multi-scale features and clear boundary segmentation.
It improves the accuracy and efficiency of farmland segmentation in remote sensing images, enabling clear and sharp farmland contour extraction in complex scenes, and is suitable for refined monitoring under complex terrain conditions.
Smart Images

Figure CN120913078A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of remote sensing image processing and agricultural information technology, and particularly relates to a remote sensing image cultivated land segmentation method and system fusing context and boundary perception. BACKGROUND
[0002] As a strategic resource for maintaining global food security, the accurate and dynamic monitoring of cultivated land plays a crucial role in global land resource management, sustainable agricultural development, and ecological environment protection. With the development of remote sensing technology, high-resolution images provide a data foundation for the fine extraction of cultivated land, but issues such as mixed image features and blurred edges in complex terrain still constrain the improvement of its precision. For example, in the southwest mountain terraces and slope cultivated land, the proportion exceeds 60%, in the Huang-Huai-Hai plain, the cultivated land and abandoned land have dynamic boundary changes due to crop rotation, and in the northwest oasis irrigation area, there are a large number of mixed pixels between cultivated land and surrounding desert transition zones. These scenarios pose serious challenges to existing extraction methods, and traditional monitoring methods cannot meet the needs of fine management.
[0003] Under this background, semantic segmentation technology based on deep learning, especially Convolutional Neural Networks (CNNs), has replaced traditional machine learning methods that rely on manual feature design, becoming the mainstream paradigm for achieving automated and high-precision cultivated land extraction. CNN-based segmentation methods represented by Fully Convolutional Networks (FCN), UNet, and their derivative models (such as the DeepLab series) have achieved remarkable results in cultivated land extraction tasks. The encoder gradually reduces the spatial resolution to extract abstract high-dimensional semantic features by stacking convolutional layers and pooling layers, while the decoder gradually recovers spatial details by upsampling operations (such as deconvolution or interpolation) and fuses the feature maps of the corresponding layers of the encoder, ultimately achieving pixel-level feature classification. However, with the continuous improvement of remote sensing data resolution and the increasing complexity of agricultural application scenarios, existing mainstream deep learning methods still expose a series of deep-seated technical bottlenecks in the task of fine cultivated land segmentation: 1) Limitations of global context modeling Existing models have inherent defects in capturing context information essential for feature recognition. Convolution-based operations have difficulty in efficiently modeling long-range spatial dependencies due to their local receptive fields, while Vision Transformer architectures cannot be directly applied to high-resolution remote sensing images due to their quadratic computational complexity. Even the new State Space Model (SSM), which has linear computational efficiency, lacks a mature mechanism to effectively adapt to the spatial structure of two-dimensional images due to its nature as a one-dimensional sequence processor.
[0004] 2) There are deficiencies in cross-scale feature fusion mechanism In the fusion of deep features rich in semantics and shallow features rich in details, existing methods generally use simple splicing or addition. This way ignores the huge "semantic gap" between the two, cannot effectively filter and enhance the shallow features full of noise with high-level semantics, and is easy to cause information conflict and dilution of feature expression, thus limiting the final segmentation accuracy.
[0005] 3) There is a bottleneck in boundary segmentation accuracy Existing methods are not good at accurately outlining the contours of cultivated land. The down-sampling process of the encoder irreversibly loses the boundary information of the ground object, and the standard segmentation loss function (such as cross-entropy loss) treats all pixels equally, resulting in the contribution of the boundary pixels with extremely small proportion to the total loss being submerged. This double defect in structure and training target makes the model lack clear and strong optimization guidance for "boundary correctness", and it is difficult to restore clear and sharp contours. SUMMARY
[0006] To solve the technical problems of existing remote sensing image cultivated land segmentation methods, such as the limitation of context modeling ability, the deficiency of cross-scale feature fusion mechanism, and the bottleneck of boundary segmentation accuracy, the purpose of the present application is to provide a remote sensing image cultivated land segmentation method and system that fuses context and boundary perception. Through a cooperative context modeling module, the global interaction ability of the visual state space model and the local perception ability of the large kernel convolution are adaptively fused with linear complexity, to solve the problem that traditional models cannot balance global and local information. At the same time, through hierarchical feature injection and gated fusion decoding mechanism, high-level semantic intelligence is used to guide and fuse multi-scale features, to bridge the "semantic gap" and solve the problems of information conflict and dilution. In addition, an explicit composite boundary loss function is introduced in the training to provide strong contour supervision signal for the model, and the boundary blur and adhesion problems are fundamentally solved. This method, through modular architecture design, balances high precision and high efficiency of segmentation, and provides a systematic technical solution for fine cultivated land monitoring in complex scenarios.
[0007] The technical scheme adopted by the present application is as follows: A remote sensing image cultivated land segmentation method and system that fuses context and boundary perception, comprising the following steps: S1) Data collection and preprocessing Obtain remote sensing image data containing cultivated land, preprocess the remote sensing image data, and combine the corresponding cultivated land range true value label to construct an image data set including a training set and a test set; S2) Construct an initial cultivated land segmentation model to obtain a semantic segmentation map An initial model for cultivated land segmentation is constructed, which is composed of a backbone network, a feature enhancement module, a multi-scale feature fusion decoding head module, and a mask prediction module. S2.1) Extract four multi-scale feature maps using the ResNet50 backbone network, denoted as , , , ; S2.2) Perform channel transformation on the fourth multi-scale feature map to obtain the highest layer enhanced feature map ; S2.3) Use the cascaded feature enhancement module to enhance the multi-scale feature maps of each layer from top to bottom, to obtain high-level enhanced feature maps , middle-level enhanced feature maps , and low-level enhanced feature maps ; Among them, the internal process of the feature enhancement module is divided into three parallel and cooperative parts, namely the gated orthogonal scanning enhancement submodule, the global spatiotemporal collaborative perception submodule, and the feature fusion submodule. The specific enhancement process is as follows: S2.3a) Gated orthogonal scanning enhancement submodule: take the third multi-scale feature map as input, perform local context injection, bidirectional Mamba scanning, fusion and gating to generate and fuse, and obtain the output result of the gated orthogonal scanning enhancement submodule, enhancing local information; S2.3b) Global spatiotemporal collaborative perception submodule: input the highest layer enhanced feature map , perform local spatial information extraction, bidirectional Mamba scanning, large receptive field modeling, gated weight generation and fusion, and obtain the output result of the global spatiotemporal collaborative perception submodule, mining global context; S2.3c) Feature fusion submodule: generate an activation gating map for the highest layer enhanced feature map , modulate and fuse the output enhanced feature map ; S2.4) Use the multi-scale feature fusion decoding head module to input the enhanced feature maps and gradually fuse to obtain the deepest layer fusion feature map ; S2.5) Use the mask prediction module to input the deepest layer fusion feature map for class prediction and upsampling, and output the semantic segmentation map ; S3) Cultivated land segmentation model training The preprocessed training set data is input into the constructed farmland segmentation initial model to output a prediction result, a loss value between the prediction result and a true value label is calculated by using a loss function, model parameters are updated by a back propagation mechanism, and optimization is performed by using a specific optimizer and a learning strategy. After the training is completed, a farmland segmentation model with high precision and clear boundary segmentation capability is obtained. S4) segmentation map generation and farmland extraction result output The test set data is input into the trained farmland segmentation model, and a binary segmentation map representing the spatial distribution of farmland is directly output by forward inference of the farmland segmentation model.
[0008] Preferably, in the step S2), the construction step of the farmland segmentation initial model, the specific process includes: S2.1) extracting initial features: inputting the preprocessed training set data into the ResNet50 backbone network, and extracting multi-scale feature maps of different spatial scales and semantic levels by hierarchical convolution and pooling operations of the ResNet50 backbone network , , denoted as , , , ; the calculation formula is as follows: ; In the formula, , represents the input training set data; , represents the multi-scale feature map extraction process of the backbone network; , , , respectively represent multi-scale feature maps from shallow to deep and from high to low spatial resolution; S2.2) enhancing the fourth multi-scale feature map of the highest semantic level, i.e., generating the highest layer enhanced feature map by channel transformation, the calculation formula is as follows: ; In the formula, , represents a convolution layer with channels for adjusting the channels; S2.3) feature enhancement module: using a cascaded feature enhancement module as a context collaborative encoder to enhance the multi-scale feature maps of each level from top to bottom; Taking the third multi-scale feature map as input, the feature enhancement module is used to enhance The enhancement is performed, and the formula for calculating the enhancement is: ; In the formula This indicates a feature enhancement module that receives the third multi-scale feature map. and the highest layer enhanced feature map As input, the final output is a high-level enhanced feature map. ; With the help of the feature enhancement module, the high-level enhanced features output in the previous step are transformed. As new input, repeat the third multi-scale feature map. The enhancement process, in turn, affects , Enhancement is performed to obtain the mid-layer enhanced feature maps. and low-level enhanced feature maps The calculation formula is: ; ; The final result is a set of deep-enhanced feature maps, which is... , , , ; The internal process of the feature enhancement module is decomposed into three parallel and collaborative parts: the gated orthogonal scanning enhancement submodule, the global spatiotemporal collaborative perception submodule, and the feature fusion submodule. S2.4) Multi-scale Feature Fusion Decoding Head Module: This module inputs the enhanced feature map into a lightweight multi-scale feature fusion decoding head. It employs a top-down feature pyramid structure, progressively fusing enhanced feature maps from different resolutions through multi-level upsampling and lateral connections to obtain the fused feature map. A non-linear feature extraction module is introduced after each fusion level to enhance spatial detail representation and improve segmentation accuracy. The specific implementation steps are as follows: First, the highest-layer enhanced feature map is... pass After channel alignment during convolution, upsampling is performed, and then the result is compared with the processed data. High-level enhanced feature maps after convolution processing The fusion is performed, and the fusion result is processed through a nonlinear feature extraction module (containing...). Processing with convolution, batch normalization, and ReLU activation function enhances structural details and improves spatial resolution. The calculation formula is as follows: ; ; In the formula Indicates an upsampling operation. representing the shallow fusion feature map fused by channel and up-sampling operation representing the middle fusion feature map fused by a series of operations representing the middle fusion feature map fused by a series of operations and representing the deep fusion feature map fused by representing the non-linear feature extraction module, defined as:
[0009] wherein represents convolution operation, represents batch normalization operation, represents ReLU activation function; the enhanced feature map is obtained by step-by-step fusion according to the above steps , , and the calculation formula is: ; ; in the formula, representing the deep fusion feature map fused by , and representing the deepest fusion feature map fused from low to high level representing the deepest fusion feature map fused from low to high level , , and . By forcibly introducing a non-linear feature extraction module after each level of feature fusion, the semantic consistency and edge detail preservation ability in the multi-scale fusion process are effectively enhanced.
[0010] S2.5) Mask prediction module: through convolution layer to make a class prediction and generate a class probability distribution for each pixel; and is up-sampled to finally output a semantic segmentation map consistent with the size of the input image, and the calculation formula is: ; in the formula representing the semantic segmentation map generated by the feature fusion decoding module, the value of each pixel point corresponds to the predicted probability of its belonging class, which is used to realize the pixel-level classification of each class in the image.
[0011] Preferably, in the step S2.3), the specific implementation steps of the S2.3a) gating orthogonal scanning enhancement sub-module in the feature enhancement module include: S2.3a1) Local context injection: taking the third multi-scale feature map as input, the input third multi-scale feature map is passed through Convolution is performed to compress the channel to obtain compressed features, and then the features are fused by The deep separable convolution extracts the spatial local context, i.e., local dependent features , to reduce the computational complexity, and the calculation formula is: ; In the formula, denotes the third multi-scale feature map After dimension reduction, the local dependent features in the range of are extracted. denotes the deep separable convolution. S2.3a2) Horizontal Mamba scanning: along the horizontal direction, the features in the range of are dimensionally restored, fused after forward and reverse Mamba scanning, and layer normalization is performed, and the calculation formula is: ; ; In the formula, denotes the feature map after dimension restoration along the horizontal direction. denotes the dimension restoration operation. denotes layer normalization. denotes the state space scanning modeling operation. denotes the sequence reverse operation. denotes the horizontal direction feature obtained after horizontal bidirectional scanning and normalization. S2.3a3) Vertical Mamba scanning: along the vertical direction, the features in the range of are dimensionally restored, fused after forward and reverse Mamba scanning, and layer normalization is performed, and the calculation formula is: ; ; In the formula, denotes the feature map after dimension restoration along the vertical direction. denotes the vertical direction feature obtained after horizontal bidirectional scanning and normalization. S2.3a4) Feature fusion after scanning modeling: the results obtained by horizontally and vertically performing Mamba scanning modeling are dimensionally restored and fused, and then convolution is performed to restore the dimension to the input dimension, and the calculation formula is: ; In the formula, representing the feature after orthogonal scanning fusion; S2.3a5) Gating generation: Introducing a dual-channel gating signal, inputting the third multi-scale feature map By The initial gating map is generated by convolution and SiLU activation function, which retains the original shallow features and guides the fusion strength, and the calculation formula is: ; In the formula representing the initial gating map; representing the SiLU activation function; , representing the gating modulation map; representing channel segmentation; S2.3a6) Gating fusion: The gating modulation map , After Sigmoid activation, the features after orthogonal scanning fusion and are gated and fused, and the fused features are activated by ReLU activation function to obtain the output result of the gating orthogonal scanning enhancement sub-module, and the calculation formula is: ; In the formula representing the Sigmoid activation function; representing the ReLU activation function; representing the output result of the gating orthogonal scanning enhancement sub-module.
[0012] Preferably, in the step S2.3), the specific implementation steps of the S2.3b) global spatio-temporal collaborative perception sub-module in the feature enhancement module include: S2.3b1) Local spatial information extraction: input the highest layer enhanced feature map Through linear expansion by a fully connected layer, and then through Deep separable convolution for local enhancement, and activated by SiLU activation function, and the calculation formula is: ; In the formula representing the highest layer enhanced feature map After linear expansion, the local dependent features in the range of are extracted; The table is a fully connected layer; S2.3b2) Bidirectional Mamba scanning: input the extracted local dependent features into the bidirectional Mamba module to model long-range dependencies, and again through a fully connected layer to restore the channel, and the calculation formula is: ; wherein denotes the features obtained by bidirectional Mamba scan modeling; S2.3b3) Large receptive field modeling: first, local large-scale texture is extracted and activated using the depth convolution of , then the mesoscale structure is modeled using the dilated convolution of , finally, the receptive field is further expanded to cover the global structure using the dilated convolution of , and batch normalization is performed, and the calculation formula is: ; ; ; wherein denotes the depth convolution of ; denotes the dilated convolution of ; denotes the dilated convolution of ; denotes batch normalization; denotes the ReLU activation function; denotes the feature map obtained after the depth convolution and activation of ; denotes the feature map obtained after the dilated convolution and activation of ; denotes the large receptive field modeling feature map obtained after the dilated convolution and batch normalization of ; S2.3b4) Gating weight generation: introduce gating weight generation, fuse the obtained by Mamba scan modeling and the obtained by simulating large-scale spatial convolution, perform adaptive average pooling after splicing and fusion, and then perform Softmax activation function to obtain two weighting coefficients, and the calculation formula is: ; wherein denotes the weighting coefficient; denotes the adaptive average pooling operation; denotes the Softmax activation function; S2.3b5) Weight fusion and residual connection: fuse and according to the weighting coefficients generated in the previous step, and then perform residual connection with the highest layer enhanced feature map to obtain the output result of the global spatiotemporal collaborative perception sub-module, and the calculation formula is: ; ; In the formula represents the output result of the global spatio-temporal collaborative perception sub-module; represents the ReLU activation function.
[0013] Preferably, in the step S2.3), the specific implementation steps of the feature enhancement module S2.3c) feature fusion sub-module include: S2.3c1) activation gate generation: after the highest layer enhanced feature map is passed through convolution and ReLU activation function, upsampling is performed to obtain an activation map for modulating low-level features, and the calculation formula is: ; In the formula represents the generated activation gate; represents upsampling; S2.3c2) fusion output: using the third multi-scale feature map as input, the activation gate is used to modulate the low-level enhanced features, and then the high-level feature modeling results are fused, and the calculation formula is: ; In the formula represents the enhanced feature map obtained by enhancement through the feature enhancement module.
[0014] Preferably, in the step S3), the loss function calculation between the prediction result and the true value label is calculated by using a composite loss function, and the specific steps are as follows: The composite loss function is composed of three parts: focal loss, region Dice loss, and boundary Dice loss, and the calculation formula is: ; In the formula , , respectively represent the weights of the focal loss, the region Dice loss, and the boundary Dice loss; represents the focal loss; represents the region Dice loss; represents the boundary Dice loss; represents the composite loss function; The calculation process of each loss is as follows: The focal loss is used to solve the class imbalance problem and make the model more focused on learning difficult-to-distinguish samples; the calculation formula is: ; wherein is the total number of pixels; is the index of the pixel; represents a focus parameter, used to adjust the degree of attention to the difficult-to-distinguish samples; represents the predicted probability of the pixel by the model; for its true class; is a modulation factor, the closer to 1, the smaller the factor, thereby reducing the loss weight of the easy-to-distinguish samples; represents a class balance weight factor; The regional Dice loss is used to optimize the overlap of segmentation, and the calculation formula is: ; wherein represents the probability predicted by the model at the pixel point as foreground; represents the true label value of the pixel point; is a very small smoothing constant, used to prevent the denominator from being zero; The boundary Dice loss is specially for the boundary region, and the calculation formula is: ; wherein represents the boundary region of the predicted mask, represents the boundary region of the real mask.
[0015] Preferably, the application further provides a computer readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to realize the remote sensing image cultivated land segmentation method and system fusing context and boundary perception.
[0016] Preferably, the application further provides a remote sensing image cultivated land segmentation system fusing multi-scale context and boundary perception, comprising a processor and a memory, wherein the memory stores a computer program, and the computer program is executed by the processor to realize the remote sensing image cultivated land segmentation method fusing context and boundary perception.
[0017] Compared with the prior art, the application has the following advantages and beneficial effects: (1) The synergistic context modeling module (InjectionMultiSumCBR) proposed in the application realizes multi-dimensional enhancement of the cultivated land features in the remote sensing image through the organic combination of the gated orthogonal scanning enhancer module and the global spatio-temporal collaborative perception sub-module; the module utilizes the linear complexity advantage of the Mamba state space model to perform bidirectional scanning modeling in the horizontal and vertical directions, effectively captures long-distance spatial dependence, and simultaneously obtains global structure perception ability through large receptive field convolution simulation, thereby solving the technical bottleneck that the traditional convolutional neural network is difficult to balance global and local information; (2) The hierarchical feature injection and gated fusion decoding mechanism (LightweightFusionHead) designed in the application adopts a top-down feature pyramid structure, effectively bridges the "semantic gap" between deep semantic features and shallow detail features through intelligent gated weight generation and dynamic weighted fusion strategies; the mechanism avoids information conflict and feature expression dilution problems caused by simple splicing or addition, and significantly improves the effectiveness and discriminative ability of cross-scale feature fusion; (3) The composite boundary loss function (AdvancedHybridLoss) introduced in the application provides a strong contour supervision signal for the model through the weighted combination of focal loss, region Dice loss and boundary Dice loss; the loss function not only focuses on the overall segmentation quality, but also particularly emphasizes the boundary accuracy, fundamentally solves the technical problems of boundary blur and adhesion in existing methods, and enables the model to output clear and sharp cultivated land contours; (4) The application realizes high efficiency of calculation while ensuring high segmentation accuracy through modular architecture design; the overall framework adopts the strategy of combining state space modeling with linear complexity and lightweight feature fusion, has lower computational cost and memory occupation compared with the traditional visual transformer architecture, provides a systematic and practical technical solution for large-scale remote sensing image cultivated land refinement monitoring under complex terrain conditions, and has good engineering deployment value and popularization and application prospect. BRIEF DESCRIPTION OF DRAWINGS
[0018] Figure 1 The flowchart of the remote sensing image cultivated land segmentation method and system of the application fusing context and boundary perception; Figure 2 The cultivated land segmentation initial model framework diagram proposed in the application; Figure 3 The feature enhancement module framework diagram proposed in the application; Figure 4 The multi-scale feature fusion decoding head framework diagram proposed in the application. DETAILED DESCRIPTION
[0019] With reference to the accompanying drawings: the technical solutions in the embodiments of the present application will be further described in a clear and complete manner. It should be noted that the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.
[0020] In order to make the purposes, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings of the specification: in order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the advantages of the present application will be further described by comparing embodiments with reference to the accompanying drawings and specific embodiments.
[0021] The present application provides a context and boundary perception fusion remote sensing image cultivated land segmentation method and system, the flow chart of the method is as shown in Figure 1 The steps of the method are described in detail: S1) Data collection and preprocessing Remote sensing image data containing the target cultivated land region is collected through a UAV platform or a high-resolution satellite platform carrying remote sensing imaging sensors (such as multispectral, panchromatic, etc.); in order to ensure the geometric consistency and spectral expression quality of the collected image, the remote sensing image data is preprocessed, including band selection, radiation normalization, image cropping, geometric correction and spatial registration steps; and combined with the corresponding cultivated land range true value label, an image dataset including a training set and a test set is constructed; Specifically, band selection is used to retain feature bands with high correlation with cultivated land segmentation, such as red, red edge and near-infrared bands, to enhance the discrimination ability of cultivated land and non-cultivated land in spectral space; geometric correction and spatial registration operations are used to eliminate spatial deviations caused by terrain undulations and imaging angle differences, so that each pixel has a unified geographic reference coordinate; image cropping is used to select the effective region containing the cultivated land target, and the large image is divided into a plurality of image blocks with consistent size, improving the data utilization efficiency of subsequent training; Subsequently, according to the existing land classification data or expert annotation results, a cultivated land true value mask map corresponding to the remote sensing image is generated, and a data sample set in the form of image-label pairs is constructed; in order to improve the generalization ability and robustness of the model, random rotation, flipping, scale scaling, illumination disturbance and other data enhancement operations are further performed on the training samples to expand the sample distribution and change mode; finally, a spatially consistent and semantically clear image dataset including a training set and a test set is formed, providing a standard input for subsequent multi-scale context modeling and boundary perception guided segmentation initial model training, ensuring spatial reference consistency and cultivated land boundary recognizability in the feature learning process.
[0022] S2) constructing an initial model for arable land segmentation to obtain a semantic segmentation map An initial model for arable land segmentation is constructed, which is composed of a backbone network, a feature enhancement module, a multi-scale feature fusion decoding head module, and a mask prediction module. The above functional modules cooperate with each other to extract arable land structure, boundary, and texture information in remote sensing images from different spatial levels, and realize accurate segmentation of arable land regions through context fusion and boundary perception mechanism. The overall model framework is as shown in Figure 2 .
[0023] Specifically, the backbone network is used to extract multi-level feature representations containing different scale spatial structure information, i.e. multi-scale feature maps, from the training set data, providing rich semantic and position perception information; the feature enhancement module (InjectionMultiSumCBR) adopts a gated orthogonal scanning enhancement and global spatio-temporal collaborative perception double-path structure, which guides the fusion of shallow details and deep semantics through a spatial perception mechanism, enhances the modeling ability of the model for arable land edges and block structures, and strengthens the response expression for fuzzy areas; further, the fused multi-scale features are input into the multi-scale feature fusion decoding head module, which adopts a top-down hierarchical fusion structure, gradually restores the spatial resolution and enhances the expression of arable land boundary details, while maintaining the overall computational efficiency, and enhances the recognition ability of the model for multi-scale targets. Finally, the mask prediction module generates an arable land mask response map corresponding to each pixel, realizing automatic segmentation and positioning of arable land regions in remote sensing images; the specific process is as follows: S2.1) Extract initial features: input the preprocessed training set data into the ResNet50 backbone network, and extract multi-scale feature maps of different spatial scales and semantic levels through the hierarchical convolution and pooling operations of the ResNet50 backbone network , , denoted as , , , ; the calculation formula is as follows: ; In the formula, , represents the input training set data; , represents the feature extraction process of the backbone network; , , , respectively represent multi-scale feature maps from shallow to deep, and spatial resolution from high to low; S2.2) Enhance the fourth multi-scale feature map of the highest semantic level, i.e. generate the highest layer enhanced feature map through channel transformation , the calculation formula is as follows: ; In the formula, represents a convolutional layer for adjusting the channel; S2.3) Feature enhancement module: in order to enhance the local and global semantic representation from the backbone network multi-layer, improve the discriminability and spatio-temporal expression ability of the fused feature, a cascaded feature enhancement module (InjectionMultiSumCBR) is used as the context collaborative encoder to enhance the features of each level from top to bottom; the framework diagram of the feature enhancement module is shown in Figure 3 ; Take the third multi-scale feature map as input, and enhance by means of the feature enhancement module, and the calculation formula of the enhancement is: ; In the formula , represents the feature enhancement module, which receives the third multi-scale feature map and the highest layer enhanced feature map as input and finally outputs the high layer enhanced feature map ; Among them, the internal process of the feature enhancement module can be divided into three parallel and collaborative parts, namely the gated orthogonal scanning enhancement submodule, the global spatio-temporal collaborative perception submodule and the feature fusion submodule, and the specific implementation steps are as follows: S2.3a) Gated orthogonal scanning enhancement submodule: the core role of this gated orthogonal scanning enhancement submodule is to perform fine local information enhancement and purification on the input third multi-scale feature map , strengthen its key details related to the target, and suppress irrelevant interference; the specific implementation steps are as follows: S2.3a1) Local context injection: in order to reduce the calculation amount, take the third multi-scale feature map as input, compress the input third multi-scale feature map through convolution to obtain compressed features, and then extract spatial local context, i.e. local dependent features , through depth separable convolution, the calculation formula is: ; In the formula , represents the local dependent features in the range of extracted from the third multi-scale feature map after dimension reduction; represents depthwise separable convolution; S2.3a2) Horizontal Mamba Scan: along the horizontal direction, the input feature map is scanned by the forward and reverse Mamba scan, and the fusion is performed after the forward and reverse Mamba scan, and the layer normalization is performed, and the calculation formula is: dimension reshaping, fusion after forward and reverse Mamba scan, and layer normalization, and the calculation formula is: ; ; In the formula, represents the feature map after dimension reshaping along the horizontal direction; represents the dimension reshaping operation; represents layer normalization; represents state space scan modeling operation; represents sequence reverse operation; represents the horizontal direction feature obtained after horizontal bidirectional scanning and normalization; S2.3a3) Vertical Mamba Scan: along the vertical direction, the input feature map is scanned by the forward and reverse Mamba scan, and the fusion is performed after the forward and reverse Mamba scan, and the layer normalization is performed, and the calculation formula is: dimension reshaping, fusion after forward and reverse Mamba scan, and layer normalization, and the calculation formula is: ; ; In the formula, represents the feature map after dimension reshaping along the vertical direction; represents the feature obtained after horizontal bidirectional scanning and normalization; S2.3a4) Feature fusion after scan modeling: the results obtained by the horizontal direction and the vertical direction after Mamba scan modeling are respectively fused after dimension reshaping, and the fusion is performed through convolution to restore the dimension to the input dimension, and the calculation formula is: ; In the formula, represents the feature after orthogonal scan fusion; The above processing realizes bidirectional space dependent modeling, improves the spatial consistency and expression ability of the shallow feature.
[0024] S2.3a5) Gating Generation: In order to retain the original shallow feature and guide the fusion strength, a double-channel gating signal is introduced, and the third multi-scale feature map is generated through convolution and SiLU activation function, and the calculation formula is: ; wherein denotes the initial gating map; denotes the SiLU activation function; , denotes the gating modulation map; denotes the channel split; S2.3a6) Gating fusion: the gating modulation map , is fused with the orthogonal scanned feature and the initial feature after Sigmoid activation respectively, and the fused feature is activated by the ReLU activation function to obtain the output result of the gating orthogonal scanning enhancer module, and the calculation formula is: ; wherein denotes the Sigmoid activation function; denotes the ReLU activation function; denotes the output of the gating orthogonal scanning enhancer module; S2.3b) Global spatio-temporal collaborative perception sub-module: the core role of the global spatio-temporal collaborative perception sub-module is to perform deep and comprehensive context information mining on the input highest layer enhanced feature map to solve the inherent contradiction of the prior art in context modeling, and the specific implementation steps are: S2.3b1) Local spatial information extraction: the input highest layer enhanced feature map is linearly expanded through a fully connected layer, so that the feature has higher dimensional expression capability, and then the local enhancement is performed through a depth separable convolution, and is activated through a SiLU activation function, and the calculation formula is: ; wherein denotes the highest layer enhanced feature map after linear expansion, the local dependent features in the range of are extracted; the table is a fully connected layer; S2.3b2) Bidirectional Mamba scanning: the extracted local dependent features are input into a bidirectional Mamba module to model long dependent relationships, and are restored to channels through a fully connected layer again, and the calculation formula is: ; wherein denotes the feature obtained by bidirectional Mamba scanning modeling; The above state space model (Mamba) models the long-distance structural dependent relationship in the image, thereby obtaining the global perception ability at the sequence level; S2.3b3) Large receptive field modeling: To build the cross-scale structure representation ability, simulate the large-range spatial convolution operation, first use the deep convolution of to extract local large-range texture and activate, then use the dilated convolution of to model the mesoscale structure, finally, use the dilated convolution of to continue to expand the receptive field to cover the global structure, and batch normalization, the calculation formula is: ; ; ; In the formula, represents the deep convolution of ; represents the dilated convolution of ; represents the dilated convolution of ; represents batch normalization; represents the ReLU activation function; represents the feature map obtained after the deep convolution and activation of ; represents the feature map obtained after the dilated convolution and activation of ; represents the large receptive field modeling feature map obtained after the dilated convolution and batch normalization of ; S2.3b4) Gating weight generation: In order to fuse the modeled by Mamba scanning and the obtained by simulating large-range spatial convolution, introduce gating weight generation, perform adaptive average pooling after splicing and fusing the two results, then pass through the Softmax activation function to obtain two weighting coefficients, the calculation formula is: ; In the formula, represents the weighting coefficient; represents the adaptive average pooling operation; represents the Softmax activation function; S2.3b5) Weight fusion and residual connection: Fuse and according to the weights generated in the previous step, then perform residual connection with the highest layer enhanced feature map to obtain the output result of the global spatiotemporal collaborative perception sub-module, the calculation formula is: ; ; wherein represents the result of the global spatio-temporal cooperative perception sub-module; represents a ReLU activation function; S2.3c) Feature fusion sub-module: The core role of the feature fusion sub-module is to generate a gating map from the higher-level features to guide the modulation of the lower-level features, and to fuse the different level features obtained after enhancement by the two sub-modules. The specific implementation steps are as follows: S2.3c1) Activation gating map generation: After the higher-level features are convolved and activated by the ReLU activation function, upsampling is performed to obtain an activation map used to modulate the lower-level features, and the calculation formula is as follows: ; wherein represents the generated activation gating map; represents upsampling; S2.3c2) Fusion output: Take the third multi-scale feature map as input, use the activation gating map to modulate the lower-level enhanced features, and then fuse them with the modeling results of the high-level features, and the calculation formula is as follows: ; wherein represents the feature map obtained after enhancement by the feature enhancement module; With the help of the feature enhancement module, the high-level enhanced features output in the last step are taken as new inputs, and the enhancement process of the third multi-scale feature map is repeated, and the , are enhanced in turn to obtain the middle-level enhanced feature map and the low-level enhanced feature map , and the calculation formula is as follows: ; ; Finally, a set of enhanced feature maps enhanced by depth are obtained, i.e. , , , ; S2.4) Multi-scale feature fusion decoding head module: input the enhanced multi-scale feature map into a lightweight multi-scale feature fusion decoding head (LightweightFusionHead), adopt a top-down feature pyramid structure, gradually fuse the enhanced feature maps from different resolutions through multi-level upsampling and lateral connection mode, obtain the fused feature map, and introduce a nonlinear feature extraction module after each level of fusion to enhance the spatial detail expression ability and improve the segmentation accuracy. The specific implementation steps are as follows: First, the highest layer enhanced feature map is upsampled after channel alignment by convolution, and then fused with the high layer enhanced feature map processed by convolution. The fusion result is processed by a nonlinear feature extraction module (including convolution, batch normalization and ReLU activation function) to enhance the structural details and improve the spatial resolution, and the calculation formula is: ; ; In the formula, denotes the upsample operation, denotes the shallow layer fusion feature map fused by channel and upsample operation , denotes the middle layer fusion feature map fused by a series of operations and ; denotes the nonlinear feature extraction module, defined as:
[0025] wherein denotes convolution operation, denotes batch normalization operation, denotes ReLU activation function; According to the above steps, the enhanced feature maps are gradually fused to obtain , , and the calculation formula is: ; ; In the formula, denotes the deep layer fusion feature map fused by , and , denotes the deep layer fusion feature map fused by , , and The deepest layer fusion feature map from low to high level. By introducing a nonlinear feature extraction module after each level of feature fusion, the semantic consistency and edge detail retention ability in the multi-scale fusion process are effectively enhanced.
[0026] S2.5) Mask prediction module: the Class prediction is performed by a convolutional layer, and class prediction is performed by a convolutional layer to generate a class probability distribution for each pixel. To restore the spatial resolution of the original input, Up-sampling operation is performed, and finally a semantic segmentation map consistent with the input image size is output, and the calculation formula is: ; In the formula, The semantic segmentation map generated by the model, the value of each pixel point corresponds to the predicted probability of its belonging class, is used to realize the pixel-level classification of each class in the image.
[0027] S3) segmentation model training The preprocessed training set data is input into the constructed farmland segmentation initial model to output the prediction result, the loss value between the prediction result and the true value label is calculated by using the loss function, the model parameters are updated by the back propagation mechanism, and the specific optimizer and learning strategy are optimized. After training, a farmland segmentation model with high precision and clear boundary segmentation ability is obtained; Specifically, in order to balance the proportion imbalance of foreground classes, the accuracy of region overlap and the accuracy of boundary positioning, the model loss function value is calculated, and the model is trained by a composite loss function (AdvancedHybridLoss). The composite loss function is composed of three parts: focal loss (Focal Loss), region Dice loss (Dice Loss) and boundary Dice loss (Boundary Dice Loss). Through the three loss components with different weights, both the overall segmentation quality and the boundary accuracy are emphasized, which can significantly improve the accuracy of boundary positioning while ensuring the overall segmentation accuracy, and the calculation formula is: ; In the formula, , , Focal loss, region Dice loss and boundary Dice loss weight respectively; Focal loss; Region Dice loss; Boundary Dice loss; Composite loss function; The calculation process of each loss is as follows: The focal loss is used to solve the class imbalance problem and make the model focus more on learning difficult-to-distinguish samples; the calculation formula is: ; In the formula, is the total number of pixel points; is the index of the pixel point; represents a focus parameter, which is used to adjust the attention degree to difficult-to-distinguish samples; represents the prediction probability of the model at the pixel point for the real class ; is a modulation factor, the closer to 1, the smaller the factor, thereby reducing the loss weight of easy-to-distinguish samples; represents a class balance weight factor; The region Dice loss is used to optimize the overlap of segmentation, and the calculation formula is: ; In the formula, represents the probability that the model predicts as foreground at the pixel point ; represents the real label value (foreground is 1 and background is 0) of the pixel point ; is a very small smoothing constant to prevent the denominator from being zero; The boundary Dice loss is specifically for the boundary region, and the calculation formula is: ; In the formula, represents the boundary region of the predicted mask, represents the boundary region of the real mask.
[0028] S4) Segmentation map generation and cultivated land extraction result output The test set is input into the cultivated land segmentation model trained, and the binary segmentation map representing the spatial distribution of cultivated land is directly output through the forward inference of the model; the binary segmentation map accurately outlines the range and contour of each cultivated land plot in the remote sensing image, which can be directly used for subsequent area calculation, plot statistics and other applications.
[0029] Specifically, the input is a single-phase high-resolution remote sensing image covering the target area, which is input into the constructed cultivated land segmentation model after spatial scale adjustment and band selection for forward inference; the cultivated land segmentation model extracts spatial structure semantic features from shallow to deep layers through the backbone network, and after semantic fusion and boundary enhancement through the InjectionMultiSumCBR module, it enters the lightweight multi-level decoding structure to realize spatial detail restoration and cultivated land area recovery; The final model output is a binary segmentation map consistent with the original map space, that is, a cultivated land mask map, whose pixel value represents whether the position belongs to the cultivated land category, has clear binary discrimination ability, and can be directly superimposed on the remote sensing original map for visualization; The mask map not only has clear boundary contour and structure information, but also can be used as a basis for subsequent cultivated land area estimation, classification statistics and spatio-temporal change analysis.
[0030] In practical applications, the segmentation process includes the following operations: first, the input remote sensing image data is standardized and cropped to construct an image dataset including a training set and a test set; second, the trained segmentation model is loaded, the image is forward inferred, and the segmentation result is output; finally, the segmentation result is spliced and reconstructed into a complete mask map, and can be visualized and colored or vectorized to generate a result map convenient for farmland management and cultivated land monitoring.
[0031] Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications to these embodiments once they know the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0032] Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application also intends to include these modifications and variations.
Claims
1. A method and system for context and boundary-aware remote sensing image cropland segmentation, characterized in that, Comprise: S1) data collection and preprocessing Obtain remote sensing image data containing cultivated land, preprocess the remote sensing image data, and combine the corresponding cultivated land range true value label to construct an image data set including a training set and a test set; S2) construct an initial cultivated land segmentation model to obtain a semantic segmentation map An initial cultivated land segmentation model is constructed, which comprises a backbone network, a feature enhancement module, a multi-scale feature fusion decoding head module, and a mask prediction module. S2.1) Extract 4 multi-scale feature maps using ResNet50 backbone network, denoted as , , , ; S2.2) to the 4th multi-scale feature map channel conversion to obtain the highest layer enhanced feature map ; S2.3) using a cascaded feature enhancement module to enhance each level of the multi-scale feature maps from top to bottom to obtain high-level enhanced feature maps , middle-level enhanced feature maps , low-level enhanced feature maps ; Wherein, the internal process of the feature enhancement module is decomposed into three parallel and collaborative parts, namely the gated orthogonal scanning enhancement submodule, the global spatiotemporal collaborative perception submodule, and the feature fusion submodule, and the specific enhancement process is as follows: S2.3a) Gated Cross Scan Enhancement Module: with the 3rd multi-scale feature map As input, the locally context injected, bi-directional Mamba scanned, fused and gated generate and fuse, obtain the output result of the gated cross scan enhancement module , enhance local information; S2.3b) global spatio-temporal co-perception sub-module: input highest layer enhanced feature map , through local spatial information extraction, bidirectional Mamba scanning, large receptive field modeling, gate weight generation and fusion, obtain the output result of the global spatio-temporal co-perception sub-module , mine global context; S2.3c) Feature fusion sub-module: to the highest layer enhancement feature map Generate activation gating map, modulate and fuse output enhancement feature map ; S2.4) using a multi-scale feature fusion decoding head module, inputting the enhanced feature maps to gradually fuse to obtain the deepest layer fusion feature map ; S2.5) input the deepest fusion feature map into the mask prediction module perform class prediction and up-sampling, output semantic segmentation map ; S3) cultivated land segmentation model training The preprocessed training set data is input into the constructed cultivated land segmentation initial model to output the prediction result, the loss value between the prediction result and the true value label is calculated by using the loss function, the model parameters are updated by using the back propagation mechanism, and the specific optimizer and learning strategy are used for optimization. After training, a cultivated land segmentation model with high precision and clear boundary segmentation capability is obtained; S4) segmentation map generation and cultivated land extraction result output The test set data is input into the trained cultivated land segmentation model, and a binary segmentation map representing the spatial distribution of cultivated land is directly output by forward reasoning of the cultivated land segmentation model.
2. The method and system for remote sensing image cropland segmentation with fusion of context and boundary awareness according to claim 1, characterized in that, In step S2), the construction step of the cultivated land segmentation initial model, the specific process comprises: S2.1) Extract initial features: the pre-processed training set data is input into the ResNet50 backbone network, and through the convolution and pooling operations of the ResNet50 backbone network, multi-scale feature maps of different spatial scales and semantic levels are extracted , , denoted as , , , ; the calculation formula is as follows: ; In the formula, represents the input training set data; represents a multi-scale feature map extraction process of the backbone network; respectively represent multi-scale feature maps from shallow to deep and from high to low spatial resolution. S2.2) the 4th multiscale feature map of the highest semantic level enhanced, i.e. by channel transformation, to generate the highest level enhanced feature map with the following formula: ; In the formula, represents a convolutional layer of for adjusting channels; S2.3) Feature enhancement module: a cascaded feature enhancement module is used as a context collaborative encoder to enhance the multi-scale feature maps of each level from top to bottom; with the 3rd multi-scale feature map As input, the feature enhancement module is used to enhance The calculation formula of the enhancement is: ; In the formula denotes a feature enhancement module, which receives the third multi-scale feature map and the highest layer enhanced feature map As input, the final output high layer enhanced feature map ; With the help of the feature enhancement module, the output high-level enhanced features of the last step are enhanced As a new input, repeat the 3rd multi-scale feature map enhancement process, in turn, enhance , , respectively, to obtain the middle-level enhanced feature map and the low-level enhanced feature map , the calculation formula is: ; ; Finally, a set of deep enhanced feature maps is obtained, that is 、 、 、 ; Wherein, the internal process of the feature enhancement module is decomposed into three parallel and collaborative parts, namely the gated orthogonal scanning enhancement submodule, the global spatiotemporal collaborative perception submodule, and the feature fusion submodule; S2.4) Multi-scale feature fusion decoding head module: input the enhanced feature map into a lightweight multi-scale feature fusion decoding head, use a top-down feature pyramid structure, gradually fuse enhanced feature maps from different resolutions through multi-level upsampling and lateral connection, obtain the fused feature map, and introduce a nonlinear feature extraction module after each level of fusion to enhance the spatial detail expression ability and improve the segmentation precision. The specific implementation steps are as follows: First, the highest layer enhanced feature map is up-sampled after channel alignment by convolution, and then fused with the high layer enhanced feature map processed by convolution , and the fusion result is processed by a nonlinear feature extraction module (including 3x3 convolution, batch normalization and ReLU activation function) to enhance structural details and improve spatial resolution, and the calculation formula is: ; ; wherein denotes an up-sampling operation, denotes a shallow fusion feature map fused by channel and up-sampling operations denotes a shallow fusion feature map fused by channel and up-sampling operations denotes a mid-level fusion feature map fused by a series of operations and denotes a mid-level fusion feature map fused by a series of operations denotes a non-linear feature refining module defined as: ; wherein denotes convolution operation, denotes batch normalization operation, denotes ReLU activation function; According to the above steps, gradually fuse the enhanced feature map to obtain , , the calculation formula is: ; ; In the formula, representing the fusion , and deep fusion feature map, representing the fusion , , and the deepest fusion feature map from low to high level; by introducing a nonlinear feature extraction module after each level of feature fusion, the semantic consistency and edge detail preservation ability in the multi-scale fusion process are effectively enhanced; S2.5) Mask prediction module: to Class prediction is performed by a convolutional layer to generate a class probability distribution for each pixel; the class probability distribution is upsampled An upsampling operation is performed to finally output a semantic segmentation map consistent with the size of the input image, and the calculation formula is: ; In the formula The semantic segmentation map generated by the feature fusion decoding module, the value of each pixel point corresponds to the predicted probability of its belonging category, and is used to realize the pixel-level classification of each category in the image. 3.The method and system of fusing context and boundary-aware remote sensing image cropland segmentation according to claim 2, wherein, In step S2.3), the specific implementation steps of S2.3a) gated orthogonal scanning enhancement submodule in the feature enhancement module comprise: S2.3a1) Local context injection: with the 3rd multi-scale feature map As input, the input 3rd multi-scale feature map Through Convolution is performed for channel compression, and the compressed features are obtained, and then the Deep separable convolution extracts spatial local context, i.e. local dependent features To reduce the amount of calculation, the calculation formula is: ; In the formula denotes the 3rd multi-scale feature map After dimension reduction local dependent features in the range; denotes depth separable convolution; S2.3a2) Horizontal Mamba scan: Along the horizontal direction, the image is scanned Dimensionality reshaping, forward and backward Mamba scan fusion, and layer normalization operation are performed, and the calculation formula is: ; ; In the formula denotes denotes a dimension reshaping operation along the horizontal direction; denotes a dimension reshaping operation along the horizontal direction; denotes layer normalization; denotes a state space scanning modeling operation; denotes a sequence reverse operation; denotes horizontal direction features obtained after horizontal bidirectional scanning and normalization; S2.3a3) Vertical Mamba scan: Along the vertical direction Dimensionality reshaping, forward and backward Mamba scan followed by fusion, and layer normalization with the formula: ; ; In the formula represents The feature map after dimension reshaping in the vertical direction; represents The vertical direction feature after horizontal bidirectional scanning and normalization S2.3a4) Scan modeling fusion: The results of horizontal and vertical directions after Mamba scan modeling are respectively dimensionally restored and fused, and the fusion result is obtained by Convolution restores the dimension to the input dimension, and the calculation formula is: ; In the formula represents the feature after orthogonal scanning fusion; S2.3a5) Gating generation: Introduce a dual-channel gating signal, input the third multi-scale feature map By The initial gating map is generated by convolution and SiLU activation function, which retains the original shallow features and guides the fusion strength, and the calculation formula is: ; wherein represents an initial gating map; represents a SiLU activation function; , represents a gating modulation map; represents a channel split; S2.3a6) Gated fusion: Gated modulation map , Features fused after Sigmoid activation and orthogonal scanning and Gated fusion is performed, and the fused features are then processed through a ReLU activation function to obtain the output of the gated orthogonal scan enhancement submodule. The calculation formula is as follows: ; In the formula represents a Sigmoid activation function; represents a ReLU activation function; represents the output result of the gated orthogonal scanning enhancer module.
4. The method and system for remote sensing image cultivated land segmentation fusing context and boundary awareness according to claim 2, characterized in that, In step S2.3), the specific implementation steps of S2.3b) global spatiotemporal collaborative perception submodule in the feature enhancement module comprise: S2.3b1) Local spatial information extraction: input the highest layer enhanced feature map Linear expansion through the fully connected layer, and then through Local enhancement through depth separable convolution, and activation through SiLU activation function, the calculation formula is: ; In the formula represents the highest layer enhancement feature map extracted after linear expansion local dependent features in the range; table is a fully connected layer; S2.3b2) Bidirectional Mamba Scanning: The extracted local dependency features are input into a bidirectional Mamba module to model long dependencies and again pass through a fully connected layer, restoring channels, with the formula: ; In the formula indicates the features derived from the bidirectional Mamba scan modeling S2.3b3) Large receptive field modeling: First, local large-scale texture is extracted using depthwise convolution of and activated, then, mesoscale structure modeling is performed using atrous convolution of , finally, the receptive field is expanded to cover global structure using atrous convolution of and batch normalization, the formula is: ; ; ; In the formula express Depth convolution; express Aperture convolution; express Aperture convolution; Indicates batch normalization; Represents the ReLU activation function; Indicates the process Feature maps obtained after depthwise convolution and activation; Indicates the process Feature maps obtained after dilated convolution and activation; Indicates the process Large receptive field modeling feature map obtained after dilated convolution and batch normalization; S2.3b4) Gated weight generation: Introduce gated weight generation, which fuses the modeling results obtained by Mamba scanning and the results obtained by simulating large-scale spatial convolution After adaptive average pooling and Softmax activation function, two weighted coefficients are obtained, and the calculation formula is as follows: ; In the formula denotes a weighting coefficient; denotes an adaptive average pooling operation; denotes a Softmax activation function; S2.3b5) Weight fusion and residual connection: the and fusion is performed according to the weight coefficients generated in the last step, and then a residual connection is performed with the highest layer enhanced feature map to obtain the output result of the global spatio-temporal collaborative perception sub-module, and the calculation formula is: ; ; In the formula represents the output result of the global space-time collaborative perception sub-module; represents a ReLU activation function.
5. The method and system for remote sensing image cropland segmentation with fusion of context and boundary awareness according to claim 2, characterized in that, In step S2.3), the specific implementation steps of S2.3c) feature fusion submodule in the feature enhancement module comprise: S2.3c1) Activate gated map generation: The highest-level enhanced feature map is generated through... After convolution and ReLU activation, upsampling is performed to obtain the activation map used to modulate low-level features. The calculation formula is as follows: ; wherein denotes the generated activation gating map; denotes up-sampling; S2.3c2) fusion output: with the 3rd multi-scale feature map As input, the low-level enhanced features are modulated by the activation gating map, and then fused with the modeling results of high-level features, and the calculation formula is: ; In the formula indicates The enhanced feature map obtained after enhancement by the feature enhancement module.
6. The method and system for remote sensing image cropland segmentation with fusion of context and boundary awareness according to claim 1, characterized in that, In step S3), the loss function calculation of the loss value between the prediction result and the true value label is calculated by using a composite loss function, and the specific steps are as follows: The composite loss function is composed of three parts: focal loss, region Dice loss, and boundary Dice loss, and the calculation formula is: ; In the formula 、 、 respectively represent the weight of the focal loss, the region Dice loss, and the boundary Dice loss; represents the focal loss; represents the region Dice loss; represents the boundary Dice loss; represents the composite loss function; The calculation process of each loss is as follows: Focal loss is used to solve the class imbalance problem and make the model more focused on learning difficult-to-distinguish samples; the calculation formula is: ; wherein is the total number of pixels; is the index of the pixel; represents a focus parameter, used to adjust the degree of attention to difficult samples; represents the prediction probability of the model at the pixel for its true class ; is a modulation factor, the closer to 1, the smaller the factor, thereby reducing the loss weight of easy samples; represents a class balance weight factor; The regional Dice loss is used for optimizing the overlap degree of segmentation, and the calculation formula is: ; wherein denotes the probability that the model predicts pixel point to be foreground; denotes the true label value of pixel point ; is a very small smoothing constant to prevent the denominator from being zero. The boundary Dice loss is specially used for the boundary region, and the calculation formula is: ; In the formula represents a boundary region of the predicted mask, represents a boundary region of the real mask.
7. A computer readable storage medium storing a computer program, wherein the computer program comprises program instructions configured to cause a processor to perform the method according to any one of claims 1 to 6. The computer program is executed by the processor to realize the method in any one of claims 1 to 6.
8. A remote sensing image cultivated land segmentation system fusing context and boundary awareness, comprising a processor and a memory, wherein the memory stores a computer program, and the computer program comprises the following steps of: The computer program is executed by the processor to realize the above-mentioned one kind of fusion context and boundary perception remote sensing image cultivated land segmentation method.
Citation Information
Cited By
Boundary crossing detection method and device, electronic equipment and storage medium
CN116912875A
A method and apparatus for detecting a cross-border, an electronic device, and a storage medium
CN116912875B
Remote sensing image semantic segmentation method and device, equipment and medium
CN121213935A
Rice yield prediction method based on double-branch context fusion
CN121482607A
Ploughing boundary extraction method based on cooperation of unmanned aerial vehicle remote sensing and laser radar
CN121564561A