A full-supervised farmland plot extraction method under spatial constraints
By constructing a dual-task network framework, combining multi-scale feature extraction and edge attention modules, the problems of incomplete farmland plot extraction and adjacent plot adhesion are solved, achieving more efficient farmland plot extraction and management.
Patent Information
- Application Number
- CN202210804637.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-08
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-07-08
AI Technical Summary
Existing methods for extracting farmland plots are prone to incomplete extraction and overlapping of adjacent plots in farmland scenarios with diverse types, large differences in area and shape, and dense distribution, which limits the subsequent application of farmland plot information.
A dual-task mode is adopted to construct a semantic branch network and an edge branch network. By combining multi-scale feature extraction, a global context information enhancement module and an edge attention module, and through an adaptive fusion strategy and a combination of cross-entropy loss function and balanced cross-entropy loss function, the network's ability to capture spatial constraints and edge details of farmland plots is enhanced.
It improves the accuracy and completeness of farmland plot segmentation, reduces missegmentation and the phenomenon of adjacent plots sticking together, enhances the reliability of farmland plot information, and provides more refined data support for agricultural management.
Smart Images

Figure CN115311575B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of agricultural remote sensing, and particularly relates to a full-supervised farmland plot extraction method under spatial constraints. BACKGROUND
[0002] Agricultural production is the basis for human survival and social and economic development, and plays a key role in land resource management and food security. With the growth of population, modern agriculture bears huge pressure of food supply, and accurate extraction of farmland area information has become an urgent need for sustainable development. As the basis for most policies and agricultural research in modern agriculture, farmland plots have shape characteristics, area characteristics, spatial distribution characteristics and quantity characteristics, which can help farmers and policy makers to develop production management plans, adjust and optimize crop planting structure, and achieve efficient use of natural resources and scientific management of fields according to detailed farmland distribution location, spatial range, crop type and other information. However, influenced by geographical environment, crop type, management mode and other factors, farmland plots have diversified characteristics, which brings great challenges to farmland plot extraction.
[0003] At present, farmland plot extraction methods mainly use remote sensing technology and can be divided into methods based on traditional image analysis technology and methods based on deep learning technology. Among them, methods based on traditional image analysis mainly include edge detection-based methods, region-based methods and hybrid methods.
[0004] Edge detection-based methods: they rely on the rapid change of boundary region pixel values, and determine the edges of farmland plots by defining different edge detection operators to obtain continuous regions with large pixel value differences. Edge operators can accurately locate the boundary position, but their sensitivity to high-frequency noise often produces false edges, and a single operator can only capture specific context information, usually requiring other means to form closed boundaries, such as using multiple operators, line removal, vectorization, etc. This type of method has high computational efficiency and strong spatial positioning ability, but the context information it can capture is limited, which may lead to incomplete edges.
[0005] Region-based methods: which can usually utilize the spatial information between pixels, and get the final segmentation results according to certain homogeneity criteria, such as Mean-Shift, watershed algorithm, superpixel segmentation, etc. This kind of method can utilize the spectral information, gray value change, color space information, image shape and other characteristics of the image for segmentation, at the same time, in order to avoid producing suboptimal results, this kind of method usually needs to try repeatedly to find the optimal segmentation parameters, in order to reduce the misclassification of the edge region.
[0006] Hybrid methods: this kind of method tries to realize the complementary advantages between multiple methods to achieve better farmland plot segmentation effect, such as edge detection method, region growing method and machine learning algorithm combined for farmland plot extraction. But the mixed method may be more complex than the single method in parameter adjustment, feature engineering construction and processing flow.
[0007] Deep learning-based methods: refers to the network model learning the characteristics of the target area from the input data, and verifying the learning effect of the model through inference prediction. Mainly adopts the network model with coding and decoding structure, captures various types of farmland plots and context information at multiple spatial scales through the encoder, and restores the detailed features learned by the decoder to complete the accurate segmentation of the input image, finally realizes the extraction of farmland plots.
[0008] The existing methods can realize the extraction of farmland plots in various types, large area and shape difference, etc. But the method based on traditional image analysis technology depends on prior knowledge, effective feature engineering or parameters; the method based on deep learning technology can avoid the tedious manual parameter adjustment process, but it is easy to appear the imbalance between the farmland class information and the farmland edge positioning information, and the generalization ability in the model migration process may be limited. This leads to the existing methods in the multi-type, large area and shape difference, dense distribution of farmland scene, it is easy to appear the incomplete extraction of farmland plots, the adhesion of adjacent plots and other problems, which limits the subsequent application of farmland plot information. Therefore, in view of the above problems, the present application develops a kind of full monitoring farmland plot extraction method under spatial constraint. SUMMARY
[0009] Aiming at the problems of incomplete farmland plot extraction and adjacent plot adhesion in the existing farmland plot extraction method based on deep learning technology in the scene of multi-type, large area shape difference and dense distribution of farmland, a full supervised farmland plot extraction method under spatial constraint is proposed. A double task mode is adopted, and a semantic branch network and an edge branch network are constructed to perform semantic segmentation and edge detection tasks, and the edge branch network is an auxiliary network. In order to enhance the capture of semantic information of different scales and reduce the misclassification, the semantic branch network is composed of a multi-scale feature extraction structure and a global context information enhancement module; in addition, in order to retain accurate spatial positioning information, the edge branch network adopts the strategy of keeping high resolution. In order to enhance the ability of the network to learn edge information and category information, the loss function of the method is composed of cross loss function and balanced cross entropy loss function, forming the spatial constraint of the network in the process of farmland plot extraction.
[0010] The technical scheme of the present application provides a full supervised farmland plot extraction method under spatial constraint, comprising the following steps:
[0011] Step 1, constructing a deep learning network model, specifically including the following 6 sub-steps:
[0012] Step 1-1, down-sampling the input image;
[0013] Step 1-2, extracting multi-scale features of the down-sampled image;
[0014] Step 1-3, enhancing the multi-scale features to obtain enhanced multi-scale feature maps;
[0015] Step 1-4, obtaining edge semantic enhancement information feature maps;
[0016] Step 1-5, adaptively fusing the enhanced multi-scale feature maps and the edge semantic enhancement information feature maps;
[0017] Step 1-6, designing a loss function;
[0018] Step 2, training the deep learning network model and saving, verifying the optimal parameter set in the training process, using the optimal parameter set to test the area different from the training data to realize farmland plot extraction.
[0019] Further, in step 1-1, the down-sampling of the input image is realized by two 3*3 convolution layers, ReLU function and batch normalization layer.
[0020] Further, in step 1-2, the multi-scale features of the down-sampled image are extracted by a multi-scale feature extraction module, and the multi-scale feature extraction structure is a parallel multi-branch structure, which adopts a fixed feature map resolution to retain rich position information;
[0021] Let the input data be denoted as Where H I W I C I These represent the length, width, and number of channels of the input data, respectively, where N is the H of the input data. I *W I *C I The number, i.e., batch size, is defined as follows for 3x3 convolutional layers: Where C I Indicates the number of input channels, C O This represents the number of output channels; each stage of the convolution operation module is denoted as S, which consists of multiple convolution operations B without downsampling, with B consisting of 2... The ReLU function combined with the BN layer is represented as follows:
[0022]
[0023] Let S represent the i-th stage and the i-th branch respectively. i B i In the multi-scale feature extraction module, the number of stages corresponds to the number of branches. The i-th branch goes through i stages, where the basic convolution operation in each stage is module S. In the first stage S1, there is only one branch B1. After the input data I passes through one stage of convolution operation module S, a downsampling operation is performed to obtain a new feature map, which generates a new branch B2. Thus, the two branches enter the next stage S2. To enhance the feature extraction capability, starting from the second stage, there is an information exchange process between each branch. The above process can be represented as:
[0024] B i+1 =Downsample(B i ), i≥1 (2)
[0025]
[0026]
[0027] Here, Upsample represents upsampling, Downsample represents downsampling, and Concate represents channel concatenation.
[0028] Further, the enhancement of the multi-scale features is realized by constructing a global context information enhancement module in steps 1-3, the global context information enhancement module is used to enhance the consistency of the land block and relieve the problem of discontinuous large farmland block extraction and small farmland block missing extraction by establishing the long-distance dependence of each pixel in the image through the self-attention mechanism; in addition, a global context information enhancement module is added after each branch of the multi-scale feature extraction module except the first branch, and the two form a semantic branch network together;
[0029] Let the input feature map be The output feature map is The process of the global context information enhancement module can be represented as:
[0030]
[0031] Where I' represents the feature map after transposing I, and the size is N*H I W I ; and is the dot product operation.
[0032] After the input image passes through steps 1-1 to 1-3, a plurality of feature maps are obtained, and the channel concatenation of these feature maps constitutes the output feature map of the semantic branch network, denoted as F s .
[0033] Further, the edge semantic enhancement information feature map is obtained by constructing an edge branch network in step 1-4, the core module of the branch network is an edge attention module, and rich edge detail information is obtained by maintaining high resolution; the input data of the edge attention module has two parts, denoted as I s and I s+1 , and s represents the stage in the multi-scale feature extraction module; the edge attention module has the following two processes: 1) calculating the spatial attention feature map of the edge information, denoted as A o ; 2) obtaining the edge semantic enhancement information feature map, denoted as F o , which can be represented as:
[0034]
[0035] F o = (A o ⊙I s )+I s (7)
[0036] Where Upsample represents the up-sampling operation, Concate represents the channel concatenation, and is the dot product operation.
[0037] The edge attention module is followed by a non-down-sampling convolution operation B, and a plurality of edge attention modules + non-down-sampling convolution operations B are connected in sequence to construct an edge branch network; wherein, when the edge attention module is executed for the first time, I s The subsequent I s are all from the edge branch network, and I s+1 are all from the multi-scale feature structure output of the s+1 stage; the output feature map finally obtained by the edge branch network constructed by the plurality of edge attention modules and the convolution operation B is denoted as F e .
[0038] Further, the adaptive fusion method based on the attention mechanism is used in steps 1-5 to adaptively fuse the enhanced multi-scale feature and the edge semantic enhanced information feature map, and the fused result map is denoted as F a , the enhanced multi-scale feature map and the edge semantic enhanced information feature map are denoted as F s and F e respectively, and the process can be represented as:
[0039] F a =E(Sigmoid(Upsample(F e ))⊙Upsample(F s )+Upsample(F s )) (8)
[0040] Wherein, Upsample is an up-sampling operation, and E is composed of two non-down-sampling 1 ReLU function and 1 BN layer.
[0041] Further, the loss function in step 1-6 is a spatial constraint loss, and the spatial constraint loss is composed of the loss functions of the two branch networks, wherein the semantic branch network, i.e. step 1.3, uses a cross-entropy loss function L S , and the edge branch network, i.e. step 1.4, uses a balanced cross-entropy loss function L E , and the imbalance problem caused by the number difference between positive and negative samples is controlled by increasing the hyperparameter; the two can be respectively represented as:
[0042]
[0043]
[0044] Wherein, N is the number of pixels, y i represents the label value of pixel i, P i represents the predicted output probability value corresponding to pixel i, and the hyperparameter a is the ratio of positive and negative samples.
[0045] Therefore, the representation of the spatial constraint is shown as formula (11) :
[0046] L = L s + L E (11).
[0047] The full-supervised farmland plot extraction method under the spatial constraint proposed in the application is different from the existing single-branch network, the application adopts a double-branch network framework, adopts a parallel structure and increases a global context semantic enhancement module on the semantic branch network, extracts relevant edge information on the edge branch network, both branches maintain high resolution, and are adaptively fused according to the task, so as to enhance the extraction of global upper information and edge fine information, and improve the farmland plot segmentation effect.
[0048] Therefore, the application considers the class information in the existing deep learning method, and strengthens the capture of edge detail information of the farmland plot by the network, which provides a reference method for using deep learning technology to extract farmland plots under full supervision, and provides important application support for subsequent applications in the agricultural field. It can be seen that the full-supervised farmland plot extraction method under the spatial constraint not only has very important academic value, but also has important practical significance. BRIEF DESCRIPTION OF DRAWINGS
[0049] Figure 1 It is a general structure diagram of the network model of the application;
[0050] Figure 2 It is a flowchart of an embodiment of the application. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical scheme and advantages of the application more clear and explicit, the following will further describe one embodiment according to the application in combination with the drawings. It should be understood that the specific embodiments described herein are only used to explain the application, and are not used to limit the application.
[0052] The application is aimed at the problems that the farmland plot extraction is incomplete and the adjacent plots are connected in the actual situation of the farmland scene with multiple types, large area shape difference and dense distribution. The application uses a parallel structure, a high resolution strategy and an attention mechanism, constructs a semantic branch network composed of a multi-scale feature extraction structure and a global context information enhancement module to enhance the classification ability of the network, builds an edge branch network mainly composed of an edge attention module to reduce the loss of edge detail information, and designs an adaptive fusion module to fully complement the information of the two branches and enhance the segmentation ability of the network. In addition, the spatial constraint of the application contains two loss functions, but does not need additional label information. Specifically, the steps include:
[0053] Step 1, constructing the main network module, designing space constraints, and building a deep learning network model;
[0054] Step 2, inputting the high-resolution remote sensing image and corresponding label data after preprocessing such as cutting into the network, setting the initial parameters of the network, training the network model according to the network loss function, until the training reaches the maximum training number or converges;
[0055] Step 3, after the network training is completed, save the parameter group with the optimal verification accuracy in the training process, use this parameter group to test the area different from the training data, and realize the extraction of farmland plots.
[0056] Among them, step 1 specifically includes the following 6 sub-steps:
[0057] Step 1-1, input image down-sampling. For deep learning model training, in order to obtain the most information with the least computing resources and ensure the expression of low-dimensional features, down-sampling operation is adopted at the beginning of the network, which consists of two 3*3 convolution layers, ReLU function and batch normalization layer (BN layer).
[0058] Step 1-2, constructing a multi-scale feature extraction structure. The multi-scale feature extraction structure is a parallel multi-branch structure, which uses a fixed feature map resolution to retain rich location information.
[0059] Let the input data be where H I , W I , C I are the length, width, and channel number of the input data, respectively, and N is the H I *W I *C I number of input data, i.e. batch size, and the 3*3 convolution layer is defined as: where C I represents the input channel number, and C O represents the output channel number. Each stage convolution operation module is denoted as S, which consists of 4 convolution operations B without down-sampling, B consists of 2 ReLU function and BN layer, denoted as:
[0060]
[0061] The i-th stage and the i-th branch are denoted as S i , B iIn the multi-scale feature extraction module, there are as many branches as stages, and the i-th branch will pass through i stages, where the basic convolution operation of each stage is module S. In the first stage S1, there is only one branch B1, and the input data I is subjected to a stage convolution operation module S and then a down-sampling operation to obtain a new feature map, which is used to generate a new branch B2, and thus the two branches enter the next stage S2. In order to enhance the feature extraction capability, from the second stage, there is an information interaction process between each branch, and the above process can be represented as:
[0062] B i+1 = Downsample(B i ), i≥1 (2)
[0063]
[0064]
[0065] where Upsample represents the up-sampling operation, Downsample represents the down-sampling operation, and Concate represents the channel concatenation.
[0066] Steps 1-3, construct a global context information enhancement module. The global context information enhancement module is established by a self-attention mechanism to establish the long-distance dependence of each pixel in the image, so as to enhance the consistency within the land block and alleviate the problems of discontinuous large farmland block extraction and missing small farmland block extraction. In addition, except for the first branch in the multi-scale feature extraction module, a global context information enhancement module is added after each branch, and the two together constitute a semantic branch network.
[0067] Let the input feature map be The output feature map is The process of the global context information enhancement module can be represented as:
[0068]
[0069] where I' represents the transposed feature map of I, and its size is N*H I W I ; and is the dot product operation.
[0070] The input image is subjected to steps 1-1 to 1-3 to obtain a plurality of feature maps, and the channel concatenation of these feature maps constitutes the output feature map of the semantic branch network, denoted as F s .
[0071] Step 1-4, constructing the edge branch network. The core module of this branch network is the edge attention module, which obtains rich edge detail information by maintaining high resolution. The input data of this module has two parts, denoted as I s , s+1 s represents the stage in the multi-scale feature module. The edge attention module mainly has the following two processes: 1) calculating the spatial attention feature map of edge information, denoted as A o ; 2) obtaining the edge semantic enhancement information feature map, denoted as F o , which can be represented as:
[0072]
[0073] F o = (A o ⊙I s )+I s (7)
[0074] where Upsample represents the up-sampling operation, Concate represents the channel concatenation, and is the dot product operation.
[0075] The edge attention module is followed by a convolution operation B without down-sampling. The edge branch network is constructed by connecting multiple edge attention modules + convolution operations B without down-sampling in turn, where I s is derived from the multi-scale feature structure output of the s-th stage, and the subsequent I s comes from the edge branch network, and I s+1 comes from the multi-scale feature structure output of the s+1-th stage. The output feature map of the edge branch network constructed by multiple edge attention modules and convolution operations B without down-sampling is denoted as F e .
[0076] Step 1-5, constructing an adaptive fusion module. The adaptive fusion based on the attention mechanism is used to realize the information interaction between the double branch networks, and the result of the fusion is denoted as F a . The output feature map of the semantic branch network and the output feature map of the edge branch network are denoted as F s and F e , respectively. The process can be represented as:
[0077] F a = E (Sigmoid (Upsample (F e )) ⊙ Upsample (F s )+ Upsample (F s )) (8)
[0078] where Upsample is an up-sampling operation, E is composed of two ReLU functions and one BN layer. 1 ReLU function and 1 BN layer.
[0079] Step 1-6, design spatial constraints. The spatial constraints are composed of the loss functions of the two branch networks, wherein the semantic branch network uses a cross-entropy loss function L S , and the edge branch network uses a balanced cross-entropy loss function L E . The imbalance problem caused by the difference in the number of positive and negative samples is controlled by increasing the hyperparameter. The two can be respectively represented as:
[0080]
[0081]
[0082] where N is the number of pixels, y i represents the label value of pixel i, P i represents the predicted output probability value corresponding to pixel i, and the hyperparameter alpha is the ratio of positive and negative samples.
[0083] Therefore, the representation of the spatial constraint is shown in formula (11):
[0084] L=L s +L E (11)
[0085] The present application can be implemented by using computer software technology. The specific steps of the full-supervised farmland plot extraction method under the spatial constraint in the embodiments will be described in detail below. Figure 1
[0086] Step 1, according to the given input image data and label data, using morphological method, dilating, eroding and other operations are performed on the label to obtain an edge label with a width of 3 pixels, which is used for supervision of the edge branch network;
[0087] On the basis of the existing label, the present application uses a 5*5 window to perform dilating operation, and a 3*3 window to perform eroding operation. The difference between the obtained results can obtain an edge label with a width of 3 pixels. In the specific implementation process, the person skilled in the art can make appropriate modifications according to the actual situation.
[0088] Step 2, build a network model and design spatial constraints.
[0089] For a given input image data, the initial convolution operation of the network model is composed of a 3*3 convolution layer, a ReLU function and a batch normalization layer (BN layer), which is used to reduce the feature map dimension and expand the channel dimension. In the embodiment, the feature map size is reduced by 4 times and the channel dimension is changed from 3 to 64.
[0090] The main network modules in the application include a multi-scale feature extraction structure, a global context information enhancement module, an edge attention module and an adaptive fusion module. The multi-scale feature extraction structure has four branches, and the channel numbers of each branch are 18, 36, 72 and 144 respectively. The feature map size of each new branch is 1 / 2 of the previous branch. The global context information enhancement module is located in the last three branches of the multi-scale feature extraction structure. The parameters used by the global context information enhancement modules at different positions are respectively corresponding to each branch. The feature map after global modeling is concatenated in the channel, and then sent to the adaptive fusion module. The up-sampling in the adaptive fusion module uses bilinear interpolation. The channel number and size of the output feature map in the edge attention module remain 64, which is 1 / 4 of the input image. The output feature maps of the semantic branch network and the edge branch network are obtained after the adaptive fusion module, and the result map consistent with the original image size is obtained.
[0091] In the specific implementation process, the skilled person in the art can make appropriate adjustments according to the available farmland plot features, image resolution and hardware devices in practice, select the convolution kernel size, module number and channel number suitable for different spatial resolution in actual tasks.
[0092] Step 3: input the high-resolution remote sensing image and the corresponding label data into the network, set the initial parameters of the network, train the network model according to the network loss function, and stop training until the maximum training number of rounds or convergence is reached.
[0093] The image size in the embodiment is 512*512, and there are three bands of RGB, with a spatial resolution of 1 meter. The corresponding label data is obtained by manual labeling. The data used in the training process includes high-resolution image data, original label data and edge label data obtained after processing.
[0094] The network model running environment and related parameter settings of the embodiment are as follows: the network model is based on the PyTorch framework, and a Titan RTX graphics card is used for training; the network initial parameters are initialized using the Kaiming Normal method; the Adam optimizer is used in the training process, the weight coefficient is 0.001, and the remaining parameters are default values; the initial learning rate is 0.0001, the learning rate adjustment strategy is ReduceLROnPlateau, and the mode is "min"; the number of inputs in each batch during network training is 4; the data enhancement methods used in the training process include horizontal flipping, vertical flipping, random cropping and the like; the training is performed for a total of 100 rounds, and the model with the highest validation set accuracy in the training process is saved for testing; in the spatial constraint, the weights of the cross-entropy loss function and the balanced cross-entropy loss function are both 1, and the alpha in the balanced cross-entropy loss function is 0.9. In specific implementation, those skilled in the art can adjust the network parameters according to the specific used image.
[0095] Step 4: After the network training is completed, the parameter group with the optimal validation accuracy in the training process is saved, and the parameter group is used to test the regions different from the training data to realize the extraction of farmland plots.
[0096] In the embodiment, the test data are respectively from images of different regions in the same imaging environment and images of different regions by different sensors, and the data for quantitatively evaluating the network model effect are high-precision labels manually labeled.
[0097] The above is only the preferred embodiment of the present application, and does not limit the implementation and protection scope of the present application. Those skilled in the art should realize that any equivalent replacement and obvious changes made according to the content of the present application should be included in the protection scope of the present application.
Claims
1. A method for extracting fully supervised farmland plots under spatial constraints, characterized in that, Includes the following steps: Step 1, constructing a deep learning network model, specifically includes the following 6 sub-steps: Step 1-1: Downsample the input image; Steps 1-2: Extract multi-scale features from the downsampled image; Steps 1-3: Enhance the multi-scale features to obtain the enhanced multi-scale feature map; In steps 1-3, a global context information enhancement module is constructed to enhance multi-scale features. The global context information enhancement module establishes the long-distance dependency of each pixel in the image through a self-attention mechanism to enhance the consistency within the plots and alleviate the problems of discontinuous extraction of large farmland plots and missed extraction of small farmland plots. In addition, except for the first branch in the multi-scale feature extraction module, a global context information enhancement module is added after each other branch, and the two together constitute a semantic branch network. Let the input feature map be denoted as Where H I W I C I These represent the length, width, and number of channels of the input data, respectively, where N is the number of input data points, and the output feature map is... The process of the global context information enhancement module is represented as follows: Where I′ represents the feature map after the transpose of I, and its size is N*H. I W I ;⊙ represents the dot product operation; After the input image is processed through steps 1-1 to 1-3, multiple feature maps are obtained. These feature maps are then concatenated by channels to form the output feature map of the semantic branch network, denoted as F. s ; Steps 1-4: Obtain edge semantic enhancement information feature maps; In steps 1-4, edge semantic enhancement information feature maps are obtained by constructing an edge branch network. The core module of this branch network is the edge attention module, which obtains rich edge detail information by maintaining high resolution. The input data of the edge attention module consists of two parts, denoted as I. s I s+1 s represents the stage in the multi-scale feature extraction module; the edge attention module has the following two processes: 1) Calculate the spatial attention feature map of edge information, denoted as A o ;2) Obtain the edge semantic enhancement information feature map, denoted as F o , respectively represented as: F o =(A o ⊙I s )+I s (7) Where Upsample represents upsampling operation, Concate represents channel concatenation, and ⊙ represents dot product operation; An edge attention module is followed by a convolutional operation B without downsampling. Multiple edge attention modules followed by this convolutional operation B are sequentially connected to construct an edge branch network. Except for the first execution of the edge attention module, I... s Derived from the multi-scale feature structure output of stage s, the subsequent I s All of them come from the edge branch network, and I s+1 All are outputs from the multi-scale feature structure of stage s+1; the final output feature map of the edge branch network, constructed from multiple edge attention modules and convolutional operation B, is denoted as F. e ; Steps 1-5 involve adaptively fusing the enhanced multi-scale feature map and the edge semantic enhancement information feature map; Steps 1-6: Design the loss function; Step 2: Train and save the deep learning network model. During the training process, verify the parameter set with the best accuracy. Use the optimal parameter set to test regions different from the training data to achieve farmland plot extraction.
2. The method for extracting fully supervised farmland plots under spatial constraints as described in claim 1, characterized in that: In step 1-1, the input image is downsampled using two 3*3 convolutional layers, a ReLU function, and a batch normalization layer.
3. The method for extracting fully supervised farmland plots under spatial constraints as described in claim 1, characterized in that: In steps 1-2, multi-scale features of the downsampled image are extracted through a multi-scale feature extraction module. The multi-scale feature extraction structure is a parallel multi-branch structure, and a fixed feature map resolution is used to preserve rich location information. Let the input data be denoted as Where H I W I C I These represent the length, width, and number of channels of the input data, respectively, where N is the H of the input data. I *W I *C I The number, i.e., batch size, is defined as follows for 3x3 convolutional layers: Where C I Indicates the number of input channels, C O This represents the number of output channels; each stage of the convolution operation module is denoted as S, which consists of multiple convolution operations B without downsampling, with B consisting of 2... The ReLU function combined with the BN layer is represented as follows: Let S represent the i-th stage and the i-th branch respectively. i B i In the multi-scale feature extraction module, the number of stages corresponds to the number of branches. The i-th branch goes through i stages, where the basic convolution operation in each stage is module S. In the first stage S1, there is only one branch B1. After the input data I passes through one stage of convolution operation module S, a downsampling operation is performed to obtain a new feature map, which generates a new branch B2. Thus, the two branches enter the next stage S2. To enhance the feature extraction capability, starting from the second stage, there is an information interaction process between each branch. The above process is represented as follows: B i+1 =Downsample(B i ),i≥1 (2) Here, Upsample represents upsampling, Downsample represents downsampling, and Concate represents channel concatenation.
4. The method for extracting fully supervised farmland plots under spatial constraints as described in claim 1, characterized in that: Steps 1-5 use an attention-based adaptive fusion method to adaptively fuse the enhanced multi-scale features and edge semantic enhancement information feature maps. The fused result map is denoted as F. a The enhanced multi-scale feature map and the edge semantic enhancement information feature map are denoted as F, respectively. s F e The process can be expressed as follows: F a =E(Sigmoid(Upsample(F e ))⊙Upsample(F s )+Upsample(F s )) (8) Here, Upsample is the upsampling operation, and E consists of two unsampled values. It consists of one ReLU function and one BN layer.
5. The method for extracting fully supervised farmland plots under spatial constraints as described in claim 1, characterized in that: The loss function in steps 1-6 is the spatial constraint loss, which is composed of the loss functions of the two branch networks. The semantic branch network, i.e., the one in step 1.3, uses the cross-entropy loss function L. S The edge branch network, i.e., step 1.4 uses the balanced cross-entropy loss function L E The imbalance caused by the difference in the number of positive and negative samples is controlled by increasing hyperparameters; the two are expressed as follows: Where N is the number of pixels, y i P represents the label value of pixel i. i This represents the predicted output probability value corresponding to pixel i, and the hyperparameter α is the ratio of positive to negative samples; Therefore, the spatial constraints are represented as shown in equation (11): L=L s +L E (11)