Remote sensing image cultivated land parcel extraction method and detection model
Through the detection model combining hollow convolution and attention fusion mechanism, the problem of insufficient accuracy in the extraction of cultivated land plots is solved, and higher accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202411283753.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-09-13
AI Technical Summary
The traditional edge detection model based on machine learning algorithms has subjectivity and limitations in feature selection and classifier design, resulting in inaccurate extraction results of fuzzy areas of arable land and other land objects, including too many irrelevant details, affecting accuracy.
The detection model based on hollow convolution and attention fusion mechanism is adopted, and the edge information of arable land plots is extracted through the encoder and decoder structure, combining multi-scale context information and attention mechanism.
It improves the accuracy and robustness of edge detection of cultivated land plots, reduces the impact of irrelevant details, and enhances the adaptability to complex agricultural environments.
Smart Images

Figure CN119229287A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of remote sensing image processing, and in particular to a remote sensing image cultivated land plot extraction method and a detection model. Background Art
[0002] With the advancement of agricultural modernization, society's demand for land resources continues to rise, and the precision requirements for farmland management are getting higher and higher. Traditional edge detection models based on machine learning algorithms have certain subjectivity and limitations in feature selection and classifier design. For complex and changeable agricultural environments, especially areas with blurred boundaries between cultivated land and other landforms, the extraction results are prone to errors. Therefore, although existing technologies can extract edge information, the extracted edge information often contains too many irrelevant details, affecting the accuracy of extraction. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a remote sensing image farmland plot extraction method and detection model, which can improve the accuracy and robustness of farmland plot edge detection.
[0004] The technical solution of the present invention to solve the above technical problems is as follows:
[0005] In one aspect, the present invention provides a method for extracting cultivated land from remote sensing images, comprising determining a remote sensing image to be detected. The remote sensing image to be detected includes at least one cultivated land parcel. The remote sensing image to be detected is input into a detection model to obtain edge information of the at least one cultivated land parcel.
[0006] Among them, the detection model includes an encoder, a middle part, and a decoder. The middle part includes a dual-path module. The encoder is used to output at least one feature map corresponding to the remote sensing image to be detected based on the remote sensing image to be detected. The dual-path module is used to output a spliced feature map corresponding to the feature map output by the encoder; the spliced feature map includes multi-scale context information of the corresponding feature map; the dual-path module includes N layer module structures; the first layer module structure includes a first convolutional unit, a first splicing unit, and a dilated convolutional unit connected in sequence; the j-th layer module structure includes a first convolutional unit, a first splicing unit, a dilated convolutional unit, a second splicing unit, and a second convolutional unit connected in sequence; 1 < j < N; the N-th layer module structure includes a first convolutional unit and a first splicing unit connected in sequence. The dilation rates of the dilated convolutional units in different layers are different. The first splicing unit included in the j-th layer module structure is connected to the dilated convolutional unit included in the j-1-th layer module structure; the first splicing unit included in the N-th layer module structure is respectively connected to the dilated convolutional unit included in the N-1-th layer module structure and the second convolutional unit included in the N-1-th layer module structure; the second splicing unit included in the second layer module structure is connected to the dilated convolutional unit included in the first layer module structure; the second splicing unit included in the f-th layer module structure is connected to the second convolutional unit included in the f-1-th layer module structure; 2 < f < N. The first convolutional unit is used to compress the input feature map to reduce the number of channels of the input feature map; the second convolutional unit is used to fuse the input feature map to extract features while reducing the number of channels of the input feature map. The dilated convolutional unit is used to obtain multi-scale context information corresponding to the input spliced feature map; both the first splicing unit and the second splicing unit are used to splice the input content and output the corresponding spliced feature map. The decoder is used to output the edge information of at least one cultivated land plot based on the spliced feature maps corresponding to the respective feature maps in the at least one feature map output by the dual-path module.
[0007] The beneficial effects of the present invention are: by combining a dual-path module based on dilated convolution and an attention fusion mechanism network, the accuracy and robustness of cultivated land plot edge detection are improved.
[0008] On the basis of the above technical solutions, the present invention can also be improved as follows.
[0009] Further, the value by which the number of channels of the feature map passing through the first convolutional unit is reduced is a first value. The value by which the number of channels of the feature map passing through the second convolutional unit is reduced is a second value. The second value is greater than the first value.
[0010] Further, for any feature map in the at least one feature map, the first splicing unit included in the first layer module structure is used to splice the output of the any feature map and the first convolution unit included in the first layer module structure, and output the first splicing map corresponding to the any feature map in the first layer module structure; the number of channels of the first splicing map corresponding to the any feature map in the first layer module structure is equal to the sum of the number of channels of the any feature map and the number of channels of the feature map output by the first convolution unit included in the first layer module structure. The first splicing unit included in the j-th layer module structure is used to splice the output of the first convolution unit included in the j-th layer module structure and the output of the hole convolution unit included in the j-1-th layer module structure, and output the first splicing map corresponding to the any feature map in the j-th layer module structure; the number of channels of the first splicing map corresponding to the any feature map in the j-th layer module structure is equal to the sum of the number of channels of the feature map output by the first convolution unit included in the j-th layer module structure and the number of channels of multi-scale context information output by the hole convolution unit included in the j-1-th layer module structure. The first splicing unit included in the N-th layer module structure is used to splice the output of the first convolution unit included in the N-th layer module structure, the output of the hole convolution unit included in the N-1-th layer module structure, and the output of the second convolution unit included in the N-1-th layer module structure, and output a spliced feature map corresponding to any feature map; the number of channels of the spliced feature map corresponding to any feature map is equal to the sum of the number of channels of the feature map output by the first convolution unit included in the N-th layer module structure, the number of channels of the multi-scale context information output by the hole convolution unit included in the N-1-th layer module structure, and the number of channels of the feature map output by the second convolution unit included in the N-1-th layer module structure.
[0011] Furthermore, the second splicing unit included in the second-layer module structure is used to splice the output of the dilated convolution unit included in the first-layer module structure and the output of the dilated convolution unit included in the second-layer module structure, and output a second spliced image corresponding to any feature map in the second-layer module structure; the number of channels of the second spliced image corresponding to any feature map in the second-layer module structure is equal to the sum of the number of channels of the multi-scale context information output by the dilated convolution unit included in the first-layer module structure and the number of channels of the multi-scale context information output by the dilated convolution unit included in the second-layer module structure. The second splicing unit included in the f-th layer module structure is used to splice the output of the hole convolution unit included in the f-th layer module structure and the output of the second convolution unit included in the f-1th layer module structure, and output the second splicing image corresponding to any feature map in the f-th layer module structure; the number of channels of the second splicing image corresponding to any feature map in the f-th layer module structure is equal to the sum of the number of channels of the multi-scale context information output by the hole convolution unit included in the f-th layer module structure and the number of channels of the feature map output by the second convolution unit included in the f-1th layer module structure.
[0012] Further, the remote sensing image to be detected is segmented to obtain a first number of detection areas. The detection areas have the same size. The detection areas are input into the detection model; the patch partitioning unit splices the values of the same position in the detection areas to obtain a second number of spliced patches. The second number is the same as the number of positions included in the detection area. The patch partitioning unit stacks the spliced patches according to the dimension of the number of channels to obtain stacked patches. The patch partitioning unit inputs the stacked patches into the encoder.
[0013] Further, the encoder includes U encoding units; for any one of the U encoding units, the any one encoding unit includes a preprocessing unit and a processing unit. For the first encoding unit among the U encoding units, the preprocessing unit in the first encoding unit performs linear embedding processing on the stacked patches to reduce the dimension of the stacked patches, and converts the stacked patches after the linear embedding processing into a patch sequence corresponding to the stacked patches based on a preset language conversion rule, and inputs the patch sequence corresponding to the stacked patches into the processing unit in the first encoding unit. The processing unit in the first encoding unit extracts features from the patch sequence corresponding to the stacked patches and outputs a feature map corresponding to the stacked patches in the first encoding unit. For the u-th encoding unit among the U encoding units, the preprocessing unit in the u-th encoding unit splices the values at the same positions in each patch feature output by the processing unit in the (u - 1)-th encoding unit to obtain a third number of spliced features, and performs feature transformation processing on each of the spliced features based on a preset feature transformation rule to obtain transformed features corresponding to each of the spliced features, and inputs the transformed features corresponding to each of the spliced features into the processing unit in the u-th encoding unit; where 1 < u ≤ U, and the third number is the same as the number of positions included in the patch features. The processing unit in the u-th encoding unit extracts features from the transformed features corresponding to each of the spliced features and outputs a feature map corresponding to the stacked patches in the u-th encoding unit.
[0014] Further, the decoder includes U depthwise separable convolutional network layers connected in sequence; one depthwise separable convolutional network layer is connected to one processing unit; the middle part further includes U attention fusion mechanism networks; the output of the processing unit is input into the corresponding depthwise separable convolutional network layer through the corresponding attention fusion mechanism network; the first depthwise separable convolutional network layer among the U depthwise separable convolutional network layers connected in sequence is connected to the dual-path module.
[0015] Among them, the attention fusion mechanism includes a channel attention module, a spatial attention module, a first edge attention module, a second edge attention module, and a fusion module; the first edge attention module includes G i global attention branch, L iLocal attention branch and splicing processing module. The feature map output by the processing unit is determined as the target feature map. The channel attention module determines the channel attention weight matrix Mc corresponding to the target feature map based on the target feature map, and determines the first feature map corresponding to the target feature map based on the channel attention weight matrix Mc. The channel attention weight matrix Mc includes the weights of the target feature map under different numbers of channels; the first feature map is the target feature map under the number of channels with the highest weight. The spatial attention module outputs the attention weight matrix Ms corresponding to the first feature map based on the first feature map, and determines the second feature map corresponding to the first feature map based on the attention weight matrix Ms. The attention weight matrix Ms includes the weights of each feature area in the target feature map. The second feature map includes a preset number of feature areas with the highest weights in the target feature map. The G i The global attention branch obtains the global features in the second feature map in the global dimension, and the L i The local attention branch obtains local features in the second feature map in a local dimension. The splicing processing module splices the global features in the second feature map and the local features in the second feature map, and determines the edge features in each feature after the splicing processing as the first edge feature. The second edge attention module locates and models the boundary in the second feature map under a preset noise environment to extract the edge features in the second feature map, and determines the edge features in the second feature map as the second edge feature. The fusion module fuses the first edge feature with the second edge feature, and outputs at least one feature map corresponding to the remote sensing image to be detected.
[0016] On the other hand, the present invention provides a detection model, including an encoder, an intermediate part, and a decoder; the intermediate part includes a dual-path module. The encoder is configured to output at least one feature map corresponding to the remote sensing image to be detected based on the remote sensing image to be detected; the remote sensing image to be detected includes at least one cultivated land plot. The dual-path module is configured to output a spliced feature map corresponding to the feature map output by the encoder; the spliced feature map includes multi-scale context information of the corresponding feature map; the dual-path module includes N layer module structures; the first layer module structure includes a first convolutional unit, a first splicing unit, and a dilated convolutional unit connected in sequence; the j-th layer module structure includes a first convolutional unit, a first splicing unit, a dilated convolutional unit, a second splicing unit, and a second convolutional unit connected in sequence; 1 < j < N; the N-th layer module structure includes a first convolutional unit and a first splicing unit connected in sequence. The dilation rates of the dilated convolutional units in different layers are different. The first splicing unit included in the j-th layer module structure is connected to the dilated convolutional unit included in the j-1-th layer module structure; the first splicing unit included in the N-th layer module structure is respectively connected to the dilated convolutional unit included in the N-1-th layer module structure and the second convolutional unit included in the N-1-th layer module structure; the second splicing unit included in the second layer module structure is connected to the dilated convolutional unit included in the first layer module structure; the second splicing unit included in the f-th layer module structure is connected to the second convolutional unit included in the f-1-th layer module structure; 2 < f < N. The first convolutional unit is configured to perform compression processing on the input feature map to reduce the number of channels of the input feature map; the second convolutional unit is configured to perform fusion on the input feature map to extract features while reducing the number of channels of the input feature map. The dilated convolutional unit is configured to obtain multi-scale context information corresponding to the input spliced feature map; both the first splicing unit and the second splicing unit are configured to perform splicing processing on the input content and output the corresponding spliced feature map. The decoder is configured to output the edge information of the at least one cultivated land plot based on the spliced feature maps corresponding to the respective feature maps in the at least one feature map output by the dual-path module.
[0017] Based on the above technical solutions, the present invention can be further improved as follows.
[0018] Further, for any feature map in the at least one feature map, the first splicing unit included in the first layer module structure is used to splice the output of the any feature map and the first convolution unit included in the first layer module structure, and output the first splicing map corresponding to the any feature map in the first layer module structure; the number of channels of the first splicing map corresponding to the any feature map in the first layer module structure is equal to the sum of the number of channels of the any feature map and the number of channels of the feature map output by the first convolution unit included in the first layer module structure. The first splicing unit included in the j-th layer module structure is used to splice the output of the first convolution unit included in the j-th layer module structure and the output of the hole convolution unit included in the j-1-th layer module structure, and output the first splicing map corresponding to the any feature map in the j-th layer module structure; the number of channels of the first splicing map corresponding to the any feature map in the j-th layer module structure is equal to the sum of the number of channels of the feature map output by the first convolution unit included in the j-th layer module structure and the number of channels of multi-scale context information output by the hole convolution unit included in the j-1-th layer module structure. The first splicing unit included in the N-th layer module structure is used to splice the output of the first convolution unit included in the N-th layer module structure, the output of the hole convolution unit included in the N-1-th layer module structure, and the output of the second convolution unit included in the N-1-th layer module structure, and output a spliced feature map corresponding to any feature map; the number of channels of the spliced feature map corresponding to any feature map is equal to the sum of the number of channels of the feature map output by the first convolution unit included in the N-th layer module structure, the number of channels of the multi-scale context information output by the hole convolution unit included in the N-1-th layer module structure, and the number of channels of the feature map output by the second convolution unit included in the N-1-th layer module structure.
[0019] Furthermore, the second splicing unit included in the second-layer module structure is used to splice the output of the dilated convolution unit included in the first-layer module structure and the output of the dilated convolution unit included in the second-layer module structure, and output a second spliced image corresponding to any feature map in the second-layer module structure; the number of channels of the second spliced image corresponding to any feature map in the second-layer module structure is equal to the sum of the number of channels of the multi-scale context information output by the dilated convolution unit included in the first-layer module structure and the number of channels of the multi-scale context information output by the dilated convolution unit included in the second-layer module structure. The second splicing unit included in the f-th layer module structure is used to splice the output of the hole convolution unit included in the f-th layer module structure and the output of the second convolution unit included in the f-1th layer module structure, and output the second splicing image corresponding to any feature map in the f-th layer module structure; the number of channels of the second splicing image corresponding to any feature map in the f-th layer module structure is equal to the sum of the number of channels of the multi-scale context information output by the hole convolution unit included in the f-th layer module structure and the number of channels of the feature map output by the second convolution unit included in the f-1th layer module structure.
[0020] In a third aspect, the present invention provides an electronic device comprising: a memory, one or more processors; the memory and the processor are coupled; wherein the memory stores computer program code, the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the electronic device executes a method for extracting cultivated land plots from remote sensing images as described in any one of the first aspects above.
[0021] In a fourth aspect, a computer-readable storage medium is provided, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes a method for extracting cultivated land plots from remote sensing images as described in any one of the first aspects.
[0022] In a fifth aspect, a computer program product is provided. When the computer program product is run on a computer, the computer executes a method for extracting cultivated land plots from remote sensing images as described in any one of the first aspects above.
[0023] It can be understood that the beneficial effects that can be achieved by the detection model of the second aspect provided above, the electronic device described in the third aspect, the computer-readable storage medium described in the fourth aspect, and the computer program product described in the fifth aspect can refer to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A schematic diagram of a flow chart of a method for extracting cultivated land plots from remote sensing images provided by the present invention;
[0025] Figure 2 A schematic diagram of the structure of the detection model provided by the present invention;
[0026] Figure 3 A schematic diagram of a remote sensing image and edge detection labels of a cultivated land plot provided by the present invention;
[0027] Figure 4 A schematic diagram of the structure of the dual-path module provided by the present invention;
[0028] Figure 5 A schematic diagram of a process for processing the remote sensing images and cultivated land labels included in the data set D into a format required by the detection model provided by the present invention;
[0029] Figure 6 A schematic diagram of the structure of the attention fusion mechanism network provided by the present invention. DETAILED DESCRIPTION
[0030] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; "and / or" in the present application is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. And, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish between the same items or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit the differences. At the same time, in the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design.
[0031] With the advancement of agricultural modernization, the demand for land resources in society is increasing, and the precision requirements for farmland management are getting higher and higher. This requires more advanced technologies to realize the automatic identification and edge extraction of farmland plots. Among them, the rapid development of high-resolution remote sensing image technology provides a richer and more detailed data source for the edge extraction of cultivated land plots, making it possible to improve the extraction accuracy of farmland management.
[0032] At present, the edge detection model built based on the traditional machine learning algorithm has certain subjectivity and limitations in feature selection and classifier design. For complex and changeable agricultural environments, especially in areas where the boundary between cultivated land and other objects is blurred, the extraction results are prone to errors. That is, although the existing technology can extract edge information, it often contains too many irrelevant details, affecting the accuracy. When adding structures to fuse features, it may cause low-level features to completely block local details, or the adaptability to complex agricultural environments is not high enough. There is currently no better solution to optimize the remote sensing image extraction results of the cultivated land plot edge position accurately perceived by the edge detection task.
[0033] To solve the above problems, the present invention proposes a method for extracting cultivated land plots from remote sensing images, which aims to improve the accuracy and robustness of cultivated land plot edge detection by combining a detection model based on a dual-path module based on dilated convolution and an attention fusion mechanism.
[0034] See also Figure 1 The present invention provides a method for extracting cultivated land plots from remote sensing images, including the following steps S101-S102.
[0035] S101: Determine the remote sensing image to be detected.
[0036] The remote sensing image to be detected includes at least one cultivated land plot.
[0037] S102: Inputting the remote sensing image to be detected into the detection model to obtain edge information of at least one cultivated land parcel.
[0038] See also Figure 2 , is a schematic diagram of the structure of the detection model provided by the present invention. Figure 2 The method of detecting the model shown is described in detail.
[0039] S210: Construct high-resolution remote sensing imagery for farmland edge detection.
[0040] The data set D includes Figure 3 Remote sensing image (referred to as image) and edge detection labels of the cultivated land plot shown.
[0041] S220: Based on a deep convolutional neural network, a detection model is constructed for edge detection of cultivated land plots in remote sensing images.
[0042] As Figure 2 shown, the detection model provided by the present invention includes an encoder, an intermediate part, and a decoder. Among them, the intermediate part includes a dual-path module.
[0043] In some embodiments, a BiFormer dynamic sparse attention mechanism is introduced into the encoder, and the encoder is used to output at least one feature map corresponding to the input remote sensing image based on the input remote sensing image.
[0044] The dual-path module is used to output a spliced feature map corresponding to the feature map output by the encoder. Among them, the spliced feature map includes multi-scale context information of the corresponding feature map.
[0045] In some embodiments, referring to Figure 4 , the dual-path module includes N layer module structures. The first layer module structure includes a first convolutional unit, a first splicing unit, and a dilated convolutional unit connected in sequence. The j-th layer module structure includes a first convolutional unit, a first splicing unit, a dilated convolutional unit, a second splicing unit, and a second convolutional unit connected in sequence. 1 < j < N, and both N and J are integers. The N-th layer module structure includes a first convolutional unit and a first splicing unit connected in sequence.
[0046] The first splicing unit included in the j-th layer module structure is connected to the dilated convolutional unit included in the j-1-th layer module structure. The first splicing unit included in the N-th layer module structure is respectively connected to the dilated convolutional unit included in the N-1-th layer module structure and the second convolutional unit included in the N-1-th layer module structure. The second splicing unit included in the second layer module structure is connected to the dilated convolutional unit included in the first layer module structure. The second splicing unit included in the f-th layer module structure is connected to the second convolutional unit included in the f-1-th layer module structure. 2 < f < N, and f is an integer.
[0047] Among them, the first convolutional unit is used to compress the input feature map to reduce the number of channels of the input feature map. The second convolutional unit is used to fuse the input feature map to extract features while reducing the number of channels of the input feature map. The dilated convolutional unit is used to obtain multi-scale context information corresponding to the input spliced feature map. Both the first splicing unit and the second splicing unit are used to splice the input content and output the corresponding spliced feature map.
[0048] In some embodiments, the value by which the number of channels of the feature map passing through the first convolutional unit is reduced is the first value. The value by which the number of channels of the feature map passing through the second convolutional unit is reduced is the second value. The second value is greater than the first value.
[0049] In some embodiments, the first splicing unit included in the first layer module structure is used to splice any input feature map (referred to as any feature map) and the output of the first convolution unit included in the first layer module structure, and output the first splicing map corresponding to any feature map in the first layer module structure. The number of channels of the first splicing map corresponding to any feature map in the first layer module structure is equal to the sum of the number of channels of any feature map and the number of channels of the feature map output by the first convolution unit included in the first layer module structure. The first splicing unit included in the jth layer module structure is used to splice the output of the first convolution unit included in the jth layer module structure and the output of the hole convolution unit included in the j-1th layer module structure, and output the first splicing map corresponding to any feature map in the jth layer module structure. Among them, the number of channels of the first splicing map corresponding to any feature map in the jth layer module structure is equal to the sum of the number of channels of the feature map output by the first convolution unit included in the jth layer module structure and the number of channels of multi-scale context information output by the hole convolution unit included in the j-1th layer module structure. The first concatenation unit included in the N-th layer module structure is used to concatenate the output of the first convolution unit included in the N-th layer module structure, the output of the hole convolution unit included in the N-1-th layer module structure, and the output of the second convolution unit included in the N-1-th layer module structure, and output a concatenated feature map corresponding to any feature map. The number of channels of the concatenated feature map corresponding to any feature map is equal to the sum of the number of channels of the feature map output by the first convolution unit included in the N-th layer module structure, the number of channels of the multi-scale context information output by the hole convolution unit included in the N-1-th layer module structure, and the number of channels of the feature map output by the second convolution unit included in the N-1-th layer module structure.
[0050] In some embodiments, the second splicing unit included in the second-layer module structure is used to splice the output of the dilated convolution unit included in the first-layer module structure and the output of the dilated convolution unit included in the second-layer module structure, and output a second spliced image corresponding to any feature map in the second-layer module structure. The number of channels of the second spliced image corresponding to any feature map in the second-layer module structure is equal to the sum of the number of channels of the multi-scale context information output by the dilated convolution unit included in the first-layer module structure and the number of channels of the multi-scale context information output by the dilated convolution unit included in the second-layer module structure.
[0051] In some embodiments, the second splicing unit included in the f-th layer module structure is used to splice the output of the hole convolution unit included in the f-th layer module structure and the output of the second convolution unit included in the f-1th layer module structure, and output the second splicing image corresponding to any feature map in the f-th layer module structure. The number of channels of the second splicing image corresponding to any feature map in the f-th layer module structure is equal to the sum of the number of channels of the multi-scale context information output by the hole convolution unit included in the f-th layer module structure and the number of channels of the feature map output by the second convolution unit included in the f-1th layer module structure.
[0052] It can be seen that the dual-path module can compress and integrate the input features to improve the information content and effectiveness of the edge features extracted by the encoder.
[0053] In some embodiments, in order to avoid the problem of losing edge detail information when directly using dilated convolution, a feature hierarchical compression path is introduced in the dual-path module, and the deep features extracted by the encoder are passed through multiple first convolution units to provide compressed features for the dilated convolution of each layer. Among them, the first convolution unit may include a 1x1 convolution. The last node before the output of the first convolution unit does not pass through the dilated convolution unit, so that the edge information extracted by the encoder can be retained to the greatest extent, ensuring that the original information and the information processed by the dilated convolution provide sufficient information for the decoder.
[0054] In some embodiments, the dilated convolution unit may include a 3x3 dilated convolution. Moreover, different dilated convolutions have different dilated rates. For example, the dilated rate of the first dilated convolution layer is 1, the dilated rate of the second dilated convolution layer is 2, the dilated rate of the third dilated convolution layer is 4, the dilated rate of the fourth dilated convolution layer is 8, and so on. Dilated convolutions with different dilation rates can capture multi-scale contextual information, and enhance the detection model's perception of the edge of cultivated land plots with the help of a large receptive field, so as to capture richer contextual information and spatial relationships.
[0055] In some embodiments, the dual-path module includes a horizontal Bottleneck path and a vertical feature hierarchical compression and iterative fusion path. Among them, the main feature of the horizontal Bottleneck structure is that its number of channels first decreases and then increases in the middle layer. This structure achieves the reduction and increase of the number of channels by using 1x1 convolution. First, a 1x1 convolution is used to reduce the number of channels (dimensionality reduction), and then it is connected to the hole convolution unit through the first splicing unit, and then connected to a 1x1 convolution through the second splicing unit to restore the original number of channels (dimensionality increase). By reducing the number of channels in the middle layer, the Bottleneck structure can significantly reduce the amount of calculation and the size of the model while maintaining or even improving the performance of the model. The vertical feature hierarchical compression and iterative fusion path can use 1×1 convolution to fuse the lateral output of the current stage and the result of the last fusion to obtain a new fusion result.
[0056] In some embodiments, the decoder includes U sequentially connected depth-separable convolutional network layers. A depth-separable convolutional network layer is connected to a processing unit. The middle part may also include U attention fusion mechanism networks. The output of the processing unit is input to the corresponding depth-separable convolutional network layer through the corresponding attention fusion mechanism network. The first depth-separable convolutional network layer is connected to the dual-path module. The decoder is used to output the edge information of at least one cultivated land plot based on the spliced feature map corresponding to each feature map in at least one feature map output by the dual-path module.
[0057] It should be noted that the middle part includes multiple layers of jump connections between the encoder and the decoder, the lowest level jump connection includes a dual-path module, and other high-level jump connections include an attention fusion module.
[0058] In some embodiments, the attention fusion mechanism includes a channel attention module, a spatial attention module, a first edge attention module, a second edge attention module, and a fusion module. The first edge attention module includes G i Global attention branch, L i Local attention branch and splicing processing module. The feature map output by the processing unit can be determined as the target feature map. The channel attention module can determine the channel attention weight matrix Mc corresponding to the target feature map based on the target feature map, and determine the first feature map corresponding to the target feature map based on the channel attention weight matrix Mc. The channel attention weight matrix Mc includes the weights of the target feature map under different numbers of channels. The first feature map is the target feature map under the number of channels with the highest weight. The spatial attention module outputs the attention weight matrix Ms corresponding to the first feature map based on the first feature map, and determines the second feature map corresponding to the first feature map based on the attention weight matrix Ms. The attention weight matrix Ms includes the weights of each feature area in the target feature map. The second feature map includes the feature areas with the highest weights in a preset number of target feature maps. G i The global attention branch obtains the global features in the second feature map in the global dimension. iThe local attention branch obtains local features in the second feature map in the local dimension. The splicing processing module splices the global features in the second feature map and the local features in the second feature map, and determines the edge features in each feature after the splicing processing as the first edge feature. The second edge attention module locates and models the boundary in the second feature map under a preset noise environment to extract the edge features in the second feature map, and determines the edge features in the second feature map as the second edge feature. Specifically, the second edge attention module gradually optimizes a variable field through a series of intensive and repeated local attention operations, which contains local boundary information around each pixel. The fusion module fuses the first edge feature and the second edge feature, and outputs at least one feature map corresponding to the remote sensing image to be detected.
[0059] S230: Based on the data set D, the detection model is trained until the detection model reaches a preset accuracy.
[0060] In some embodiments, the remote sensing images and farmland labels included in the data set D can be input into the detection model to train the detection model. Specifically, the remote sensing images and farmland labels included in the data set D can be cut into blocks to obtain each detection area. The width and height of the segmented remote sensing images and farmland labels are the same. Multiple sets of training data are input into the detection model to complete the training.
[0061] For example, see Figure 5 , processing the remote sensing images and cultivated land labels included in the data set D into the format required by the detection model may include the following steps S501-S504:
[0062] S501: Assume that the remote sensing image (also referred to as the original image in the embodiment of the present application) and the farmland label are included in the data set D.
[0063] Among them, the height of the remote sensing image is h, the width is w, and the number of channels is c; the height of the cultivated land label is h, the width is w, and the number of channels is 1.
[0064] S502: Calculate whether each original image needs to be expanded in size based on the set size and overlap size. If the size needs to be expanded, calculate the pixels of the expanded image at the same time, and expand the original image and the corresponding edge label of the cultivated land plot to the specified size.
[0065] S503: Sliding cropping is performed on the original image and the cultivated land plot edge label image with a set size and overlap size.
[0066] S504: After the cropping work is completed, the original image is obtained to construct the cultivated land data set, and the cultivated land data set is divided into a training set and a test set in a ratio of 8:2 based on the original remote sensing image.
[0067] Among them, 80% of the data can be used for training, and 20% of the data can be used to test the performance after training.
[0068] In some embodiments, the detection model further includes a patch partitioning unit. After inputting the remote sensing images included in the dataset D into the detection model, the patch partitioning unit can splice the values at the same positions in each detection region to obtain a second number of spliced patches. Wherein, the second number is the same as the number of positions included in the detection region. The patch partitioning unit stacks the spliced patches along the dimension of the number of channels to obtain stacked patches. The patch partitioning unit inputs the stacked patches into the encoder.
[0069] In some embodiments, the encoder includes U encoding units. Any encoding unit includes a pre-unit and a processing unit. After the patch partitioning unit inputs the stacked patches into the encoder, the pre-unit in the first encoding unit performs linear embedding processing on the stacked patches to reduce the dimension of the stacked patches, and converts the stacked patches after linear embedding processing into a patch sequence corresponding to the stacked patches based on a preset language conversion rule, and inputs the patch sequence corresponding to the stacked patches into the processing unit in the first encoding unit. The processing unit in the first encoding unit extracts features from the patch sequence corresponding to the stacked patches and outputs the feature map corresponding to the stacked patches in the first encoding unit. The pre-unit in the u-th encoding unit splices the values at the same positions in each patch feature output by the processing unit in the (u - 1)-th encoding unit to obtain a third number of spliced features, and performs feature transformation processing on each spliced feature based on a preset feature transformation rule to obtain the transformed features corresponding to each spliced feature, and inputs the transformed features corresponding to each spliced feature into the processing unit in the u-th encoding unit. Where 1 < u ≤ U and u is an integer. The third number is the same as the number of positions included in the patch features. The processing unit in the u-th encoding unit extracts features from the transformed features corresponding to each spliced feature and outputs the feature map corresponding to the stacked patches in the u-th encoding unit.
[0070] In some embodiments, the processing unit can process the input content based on BiFormer. The process of BiFormer processing is described in detail below.
[0071] S701: Construct an inter-region directed graph routing to find the association relationship (i.e., the regions that each given region should be associated with) by constructing a directed graph. Specifically, first derive Q and K, Qr, by applying the average value of each region to Q and K respectively, and then derive the adjacency matrix, draw the region-to-region affinity graph, A r = Q r (K r) T :.
[0072] S702: The degree to which two regions are semantically related is measured in the adjacency matrix Ar. Next, the affinity graph is pruned by retaining only the top k connections of each region. Specifically, an index matrix is derived using a row-by-row topk operator. I r =topIndex(A r ), so the i-th row of Ir contains the k indices of the most relevant regions of the i-th region.
[0073] S703: Using the area-to-area routing index matrix I r , applies fine-grained token-to-token attention to each query token in region i, which focuses on the nodes residing in region i. r (i,1) ,I r (i,2) ,...,I r (i,k) All KV pairs in the union of k routing areas indexed.
[0074] S704: Collect K and V tensors, namely: V g =gather(V,I r ), K g =gather(K,I r ),in, is the aggregated K and V tensors, and then applies attention to the aggregated KV pairs, using the formula O = Attention(Q, K g , V g )+LCE(V) realizes the calculation of attention. A local context enhancement term LCE(V) is introduced here. The function LCE(.) is parameterized by deep convolution, and the kernel size is set to 5. In this way, the model can better understand the global context information in the image and make full use of the parallel computing power of the GPU to improve the performance in tasks such as image classification, object detection, and semantic segmentation.
[0075] In some embodiments, the factors affecting the size of the feature map output by the processing unit are the size of the input feature map (H, W), the size of the convolution kernel (FH, FW), the output size (OH, OW), the padding is P, the step size is S, and the calculation formula for the output size is:
[0076]
[0077]
[0078] In some embodiments, the first convolution unit and the second convolution unit may both include 1x1 convolutions. For each layer of the module structure in the dual-path module, first, a 1×1 convolution may be used to reduce the number of channels of the input feature map (dimensionality reduction), followed by a dilated convolution, and finally a 1x1 convolution to restore the original number of channels (dimensionality increase) Computational efficiency: By reducing the number of channels in the middle layer, each layer of the module structure can significantly reduce the amount of computation and the size of the model while maintaining or even improving the performance of the model. Regarding the calculation of the number of channels, the input is The output of the 1×1 convolution with feature compression is set to Each concatenation operation adds the number of input channels. Through the processing of dilated convolution, the size and number of channels of the dilated convolution output are consistent with the input. For the iterative fused 1×1 convolutions of different layers, the output results are set differently, which are The final processed output result is
[0079] In some embodiments, for the processing of the dilated convolution part, it is analyzed that the same 3×3 convolution can have the effect of 5×5, 7×7 and other convolutions. The dilated convolution can increase the receptive field without increasing the number of parameters (parameters = convolution kernel size + bias). Assuming that the convolution kernel size of the dilated convolution is k and the number of holes is d, the equivalent convolution kernel size is k'. For example, for a 3×3 convolution kernel, k=3, the formula k'=k+(k-1)×(d-1). The receptive field calculation formula of the current layer is as follows: RF i+1 =RF i +(k′-1)×S i , where RF i+1 Represents the receptive field of the current layer, RF i S represents the receptive field of the previous layer, k′ represents the size of the convolution kernel. i Represents the product of the step lengths of all previous layers (excluding this layer), and the formula is Similarly, the stride of the current layer does not affect the receptive field of the current layer, and the receptive field has nothing to do with padding.
[0080] In some embodiments, the attention fusion mechanism network in this model can be used to sequentially pass through channel attention and spatial attention, and then pass through a parallel edge attention mechanism, such as Figure 6 . Where the channel attention weight matrix M c , which can be expressed as M c =R c×1×1 In order to reduce the calculation parameters, a dimension reduction coefficient r is used in MLP. c ∈R C / r×1×1 , so the channel attention calculation formula is:
[0081]
[0082] In the above formula, and They represent the global average pooling features and the maximum pooling features respectively.
[0083] In some embodiments, the spatial attention weight matrix M s , which can be expressed as M s (F)∈R H,W , as above, two pooling methods are used in the channel dimension to generate 2D feature maps: Therefore, the calculation formula for spatial attention is:
[0084]
[0085]
[0086] The result is passed through two parallel edge attention mechanisms (such as Figure 6 ), parallel edge attention 1 and edge attention 2) processing, focusing on edge-related information, using the attention mechanism to filter the information in the feature map passed by the spatial attention branch. Each filtering can filter out a part of the edge-irrelevant information so that the final retained information only contains edge-related information.
[0087] In some embodiments, the design details of the edge attention module 1 are as follows: Figure 6 As shown. i and L i To represent the input features of the edge attention module from the global attention branch and the local attention branch. First, G and L i The concatenated feature map is then sent to a gate convolution to filter out edge-irrelevant information and obtain an intermediate feature map T. i , then T i and L i Do a pixel-by-pixel multiplication to suppress those non-edge responses in L, and finally use a convolutional layer to smooth the multiplication result to get the final output O. i Before being fed into the edge attention module, bilinear interpolation is used to increase the resolution to the same level as L i Consistent.
[0088] In ordinary convolution, the size of all channels of the convolution kernel for a spatial location is the same. Give the output value O of the ordinary convolution operation at the position (y, x) y,x Calculation method: Among them I y+i,x+j ∈RC represents the input of the convolution operation, k h and k w represents the size of the convolution kernel, represents the convolution kernel, In the structure of this module, gate convolution is used instead of ordinary convolution. The calculation process of gate convolution can be described by the following formula: y,x =φ(Feature y,x )⊙σ(Gating y,x ), where ⊙ represents pixel-by-pixel multiplication, Feature represents dynamic feature selection, Gating represents the output gating value, σ represents the use of the Sigmoid function to normalize the output gating value to between 0 and 1, and φ refers to any activation function such as the rectified linear unit, exponential linear unit, or leaky rectified linear unit. y,x and Gating y,x Calculated as follows: Gating y,x =∑∑W g I, Feature y,x =∑∑W f I, where W g and W f They represent different convolution kernels respectively, and I represents the input of the convolution layer.
[0089] In some embodiments, in combination Figure 6 , while edge attention 1 is processing, edge attention 2 module is also operating. This structure implicitly uses the high-dimensional embedding of field elements, γ t [k]∈R D γ and T t [k]∈R Dπ , which can be decoded using the learned linear mappings γ→g and π→p at any iteration. The model uses D γ =64 and D π = 8. Given an input image, the network first applies a “neighborhood MLP-mixer”, which is a modified MLP-Mixer that replaces the global spatial operation with a convolution with a kernel size of 3. Another change is to map the input pixels to the hidden state size via a pixel-wise linear mapping instead of using input patches. This block converts the input image to a hidden state with D γ The pixel-resolution map channel of is denoted by γ0[n] and is called the initial “hidden state”.
[0090] Among them, this hidden state can be refined through a sequence of eight boundary attention iterations, this process is divided into two boundary attention blocks, each with learned weights. To process the input, a linear projection of the initial hidden state is first added. This is essentially a skip connection, which allows the network to retain information from the initial hidden state estimate in the later stages of processing. Next, the hidden state is copied into two identical parts, embedding a learning window of dimension 8 into one copy, the input image plus the current estimate of the smoothed global features into the other, and then doing neighborhood cross attention, each pixel is inside, and the first copy is cross-attentioned with a patch of size 11 of the second copy for two iterations. A learned 11×11 position encoding is added to the patch, which enables the network to access relative positioning even without global position clues. A small MLP is used to track each self-attention layer. A simple linear mapping is used to transform the output or intermediate hidden state into the knot space and render the output image. The window embedding (last 8 dimensions) is separated from the knot embedding (first 64 dimensions) and projected through a linear layer to map the hidden state to 7 numbers representing g = (u, sin(θ), cos(θ), ω) which can be used as input to the collection and slice operators.
[0091] In some embodiments, the result processed by the attention mechanism is passed through a decoder based on depthwise separable convolution. Focusing on capturing spatial features such as edges and textures, the decoder can effectively fuse the multi-scale feature maps received by the encoder and gradually restore the spatial resolution of the image, which helps to reconstruct high-quality output.
[0092] In some embodiments, the model performance can be measured based on the results output by the detection model through the loss function of the network model, which consists of three losses: tracking (cross entropy) loss l t , boundary tracking loss l bt and texture suppression loss l txs Therefore, the resulting loss function loss2(I) is calculated as l = l t +α bt × bt +α txs × txs , where α bt is the weight of the regularized boundary tracking loss, α txs is the texture suppression loss predicted by this network model, and the final loss is calculated based on each The sum of the calculated losses. For tracking (cross entropy) loss l t Loss, definition Where w is the weight of the tracking loss, Y- and Y+ represent the negative edge samples and positive edge samples in a given Y, respectively. bt ), defined as follows where E is the edge point of a given Y, Indicates from The edge tiles containing the edge fragments, The center of is P, The edge points in D p Finally, the texture loss (l txs ) is defined as in, is an edge map block centered at a non-edge point p, and It includes all edges and their bt The set of confused pixels used in .
[0093] It can be seen that the detection model provided by the present invention adopts a deep separable convolution in the decoder stage, focusing on capturing spatial features such as edges and textures, and can effectively fuse the multi-scale feature maps received by the decoder from the encoder and gradually restore the spatial resolution of the image, which is conducive to high-quality output. At the same time, combined with the design of the loss function, it ensures that the task can be fully trained and optimized.
[0094] When the detection model training reaches the preset accuracy, the trained detection model can be used to extract farmland plots from actual remote sensing images, and the farmland plot extraction results with more accurate edges and richer details can be obtained. This not only improves the accuracy and robustness of farmland plot extraction, but also provides more reliable data support for subsequent agricultural resource management, planting planning and other applications.
[0095] In some schemes, multiple embodiments of the present application can be combined, and the combined scheme can be implemented. Optionally, some operations in the process of each method embodiment are optionally combined, and / or the order of some operations is optionally changed. In addition, the execution order between the steps of each process is only exemplary and does not constitute a restriction on the execution order between the steps. There can also be other execution orders between the steps. It is not intended to indicate that the execution order is the only order in which these operations can be performed. A person of ordinary skill in the art will think of a variety of ways to reorder the operations described herein. In addition, it should be noted that the process details involved in a certain embodiment of this article are also applicable to other embodiments in a similar manner, or different embodiments can be used in combination.
[0096] In addition, some steps in the method embodiment may be equivalently replaced by other possible steps. Alternatively, some steps in the method embodiment may be optional and may be deleted in certain usage scenarios. Alternatively, other possible steps may be added to the method embodiment. Furthermore, the method embodiments may be implemented separately or in combination.
[0097] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the system can be divided into different functional modules to complete all or part of the functions described above.
[0098] In the several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.
[0099] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0100] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0101] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A method for extracting cultivated land plots from remote sensing images, characterized in that: Including: Determine the remote sensing image to be detected; the remote sensing image to be detected includes at least one cultivated land plot; Input the remote sensing image to be detected into the detection model to obtain the edge information of the at least one cultivated land plot; Among them, the detection model includes an encoder, an intermediate part and a decoder; the intermediate part includes a dual-path module; The encoder is used to output at least one feature map corresponding to the remote sensing image to be detected based on the remote sensing image to be detected; The dual-path module is used to output a spliced feature map corresponding to the feature map output by the encoder; the spliced feature map includes multi-scale context information of the corresponding feature map; the dual-path module includes N layer module structures; the first layer module structure includes a first convolutional unit, a first splicing unit and a dilated convolutional unit connected in sequence; the jth layer module structure includes a first convolutional unit, a first splicing unit, a dilated convolutional unit, a second splicing unit and a second convolutional unit connected in sequence; 1 < j < N; the Nth layer module structure includes a first convolutional unit and a first splicing unit connected in sequence; the dilation rates of the dilated convolutional units in different layers are different; The first splicing unit included in the jth layer module structure is connected to the dilated convolutional unit included in the (j - 1)th layer module structure; the first splicing unit included in the Nth layer module structure is respectively connected to the dilated convolutional unit included in the (N - 1)th layer module structure and the second convolutional unit included in the (N - 1)th layer module structure; the second splicing unit included in the second layer module structure is connected to the dilated convolutional unit included in the first layer module structure; the second splicing unit included in the fth layer module structure is connected to the second convolutional unit included in the (f - 1)th layer module structure; 2 < f < N; The first convolutional unit is used to compress the input feature map to reduce the number of channels of the input feature map; the second convolutional unit is used to fuse the input feature map to extract features while reducing the number of channels of the input feature map; the dilated convolutional unit is used to obtain multi-scale context information corresponding to the input spliced feature map; both the first splicing unit and the second splicing unit are used to splice the input content and output the corresponding spliced feature map; The decoder is used to output the edge information of the at least one cultivated land plot based on the spliced feature map corresponding to each feature map in the at least one feature map output by the dual-path module.
2. The method according to claim 1, characterized in that The value by which the number of channels of the feature map passing through the first convolutional unit is reduced is the first value; the value by which the number of channels of the feature map passing through the second convolutional unit is reduced is the second value; the second value is greater than the first value.
3. The method according to claim 2, characterized in that For any feature map of the at least one feature map, the first splicing unit included in the first layer module structure is used to splice the output of the any feature map and the first convolution unit included in the first layer module structure, and output the first splicing map corresponding to the any feature map in the first layer module structure; the number of channels of the first splicing map corresponding to the any feature map in the first layer module structure is equal to the sum of the number of channels of the any feature map and the number of channels of the feature map output by the first convolution unit included in the first layer module structure; The first splicing unit included in the j-th layer module structure is used to splice the output of the first convolution unit included in the j-th layer module structure and the output of the hole convolution unit included in the j-1-th layer module structure, and output the first splicing image corresponding to any feature map in the j-th layer module structure; the number of channels of the first splicing image corresponding to any feature map in the j-th layer module structure is equal to the sum of the number of channels of the feature map output by the first convolution unit included in the j-th layer module structure and the number of channels of the multi-scale context information output by the hole convolution unit included in the j-1-th layer module structure; The first splicing unit included in the N-th layer module structure is used to splice the output of the first convolution unit included in the N-th layer module structure, the output of the hole convolution unit included in the N-1-th layer module structure, and the output of the second convolution unit included in the N-1-th layer module structure, and output a spliced feature map corresponding to any feature map; the number of channels of the spliced feature map corresponding to any feature map is equal to the sum of the number of channels of the feature map output by the first convolution unit included in the N-th layer module structure, the number of channels of the multi-scale context information output by the hole convolution unit included in the N-1-th layer module structure, and the number of channels of the feature map output by the second convolution unit included in the N-1-th layer module structure.
4. The method according to claim 3, characterized in that The second splicing unit included in the second-layer module structure is used to splice the output of the dilated convolution unit included in the first-layer module structure and the output of the dilated convolution unit included in the second-layer module structure, and output a second splicing image corresponding to any feature map in the second-layer module structure; the number of channels of the second splicing image corresponding to any feature map in the second-layer module structure is equal to the sum of the number of channels of the multi-scale context information output by the dilated convolution unit included in the first-layer module structure and the number of channels of the multi-scale context information output by the dilated convolution unit included in the second-layer module structure; The second splicing unit included in the f-th layer module structure is used to splice the output of the dilated convolution unit included in the f-th layer module structure and the output of the second convolution unit included in the (f - 1)-th layer module structure, and output the second spliced image corresponding to any one of the feature maps in the f-th layer module structure; the number of channels of the second spliced image corresponding to any one of the feature maps in the f-th layer module structure is equal to the sum of the number of channels of the multi-scale context information output by the dilated convolution unit included in the f-th layer module structure and the number of channels of the feature map output by the second convolution unit included in the (f - 1)-th layer module structure.
5. The method according to claim 4, characterized in that The step of inputting the remote sensing image to be detected into the detection model includes: Performing segmentation processing on the remote sensing image to be detected to obtain a first number of detection regions; the sizes of all the detection regions are the same; Inputting all the detection regions into the detection model; The detection model further includes a patch partitioning unit. After inputting the remote sensing image to be detected into the detection model, the method further includes: The patch partitioning unit splices the values at the same positions in all the detection regions to obtain a second number of spliced patches; the second number is the same as the number of positions included in the detection regions; The patch partitioning unit stacks all the spliced patches along the dimension of the number of channels to obtain a stacked patch; The patch partitioning unit inputs the stacked patch into the encoder.
6. The method according to claim 5, characterized in that The encoder includes U encoding units; for any one of the U encoding units, any one of the encoding units includes a pre-unit and a processing unit; After the patch partitioning unit inputs the stacked patch into the encoder, the method includes: For the first encoding unit among the U encoding units, the pre-unit in the first encoding unit performs linear embedding processing on the stacked patch to reduce the dimension of the stacked patch, and based on a preset language conversion rule, converts the stacked patch after the linear embedding processing into a patch sequence corresponding to the stacked patch, and inputs the patch sequence corresponding to the stacked patch into the processing unit in the first encoding unit; The processing unit in the first encoding unit performs feature extraction on the patch sequence corresponding to the stacked patch, and outputs the feature map corresponding to the stacked patch in the first encoding unit; For the u-th encoding unit among the U encoding units, the pre-unit in the u-th encoding unit splices the values at the same positions in each of the patch features output by the processing unit in the (u - 1)-th encoding unit to obtain a third number of spliced features, and performs feature transformation processing on each of the spliced features based on a preset feature transformation rule to obtain transformed features corresponding to each of the spliced features, and inputs the transformed features corresponding to each of the spliced features into the processing unit in the u-th encoding unit; where 1 < u ≤ U, and the third number is the same as the number of positions included in the patch features; The processing unit in the u-th encoding unit performs feature extraction on the transformation features corresponding to each of the splicing features, and outputs a feature map corresponding to the stacked patch in the u-th encoding unit.
7. The method according to claim 6, characterized in that The decoder includes U sequentially connected depth-wise separable convolutional network layers; one of the depth-wise separable convolutional network layers is connected to one of the processing units; the middle part also includes U attention fusion mechanism networks; the output of the processing unit is input to the corresponding depth-wise separable convolutional network layer through the corresponding attention fusion mechanism network; the first depth-wise separable convolutional network layer among the U sequentially connected depth-wise separable convolutional network layers is connected to the dual-path module; Among them, any of the attention fusion mechanisms includes a channel attention module, a spatial attention module, a first edge attention module, a second edge attention module and a fusion module; the first edge attention module includes G i Global attention branch, L i Local attention branch and splicing processing module; the output of the processing unit is input into the corresponding depth-separable convolutional network layer through the attention fusion mechanism network, including: Determine the feature map output by the processing unit as the target feature map: The channel attention module determines, based on the target feature map, a channel attention weight matrix Mc corresponding to the target feature map, and determines, based on the channel attention weight matrix Mc, a first feature map corresponding to the target feature map; the channel attention weight matrix Mc includes weights of the target feature map under different numbers of channels; the first feature map is the target feature map under the number of channels with the highest weight; The spatial attention module outputs an attention weight matrix Ms corresponding to the first feature map based on the first feature map, and determines a second feature map corresponding to the first feature map based on the attention weight matrix Ms; the attention weight matrix Ms includes the weights of each feature region in the target feature map; the second feature map includes a preset number of feature regions with the highest weight in the target feature map; The G i The global attention branch obtains the global features in the second feature map in a global dimension; The L i The local attention branch obtains local features in the second feature map in a local dimension; The splicing processing module performs splicing processing on the global features in the second feature map and the local features in the second feature map, and determines the edge features in the spliced features as the first edge features; The second edge attention module locates and models the boundary in the second feature map under a preset noise environment to extract the edge feature in the second feature map, and determines the edge feature in the second feature map as a second edge feature; The fusion module fuses the first edge feature and the second edge feature, and outputs at least one feature map corresponding to the remote sensing image to be detected.
8. A detection model, characterized in that: include: An encoder, an intermediate section and a decoder; the intermediate section includes a dual path module; The encoder is used to output at least one feature map corresponding to the remote sensing image to be detected based on the remote sensing image to be detected; the remote sensing image to be detected includes at least one cultivated land plot; The dual-path module is used to output a spliced feature map corresponding to the feature map output by the encoder; the spliced feature map includes multi-scale context information of the corresponding feature map; the dual-path module includes N layer module structures; the first layer module structure includes a first convolutional unit, a first splicing unit, and a dilated convolutional unit connected in sequence; the j-th layer module structure includes a first convolutional unit, a first splicing unit, a dilated convolutional unit, a second splicing unit, and a second convolutional unit connected in sequence; 1 < j < N; the N-th layer module structure includes a first convolutional unit and a first splicing unit connected in sequence; the dilation rates of the dilated convolutional units in different layers are different; The first splicing unit included in the j-th layer module structure is connected to the dilated convolutional unit included in the (j - 1)-th layer module structure; the first splicing unit included in the N-th layer module structure is respectively connected to the dilated convolutional unit included in the (N - 1)-th layer module structure and the second convolutional unit included in the (N - 1)-th layer module structure; the second splicing unit included in the second layer module structure is connected to the dilated convolutional unit included in the first layer module structure; the second splicing unit included in the f-th layer module structure is connected to the second convolutional unit included in the (f - 1)-th layer module structure; 2 < f < N; The first convolutional unit is used to compress the input feature map to reduce the number of channels of the input feature map; the second convolutional unit is used to fuse the input feature map to extract features while reducing the number of channels of the input feature map; the dilated convolutional unit is used to obtain multi-scale context information corresponding to the input spliced feature map; both the first splicing unit and the second splicing unit are used to splice the input content and output the corresponding spliced feature map; The decoder is used to output the edge information of the at least one cultivated land plot based on the spliced feature map corresponding to each feature map in the at least one feature map output by the dual-path module.
9. The detection model according to claim 8, characterized in that: For any one of the at least one feature map, the first splicing unit included in the first layer module structure is used to splice the any one of the feature maps and the output of the first convolutional unit included in the first layer module structure, and output the first spliced map corresponding to the any one of the feature maps in the first layer module structure; the number of channels of the first spliced map corresponding to the any one of the feature maps in the first layer module structure is equal to the sum of the number of channels of the any one of the feature maps and the number of channels of the feature map output by the first convolutional unit included in the first layer module structure; The first splicing unit included in the j-th layer module structure is used to splice the output of the first convolutional unit included in the j-th layer module structure and the output of the dilated convolutional unit included in the (j - 1)-th layer module structure, and output the first spliced map corresponding to the any one of the feature maps in the j-th layer module structure; the number of channels of the first spliced map corresponding to the any one of the feature maps in the j-th layer module structure is equal to the sum of the number of channels of the feature map output by the first convolutional unit included in the j-th layer module structure and the number of channels of the multi-scale context information output by the dilated convolutional unit included in the (j - 1)-th layer module structure; The first splicing unit included in the N-th layer module structure is used to splice the output of the first convolution unit included in the N-th layer module structure, the output of the hole convolution unit included in the N-1-th layer module structure, and the output of the second convolution unit included in the N-1-th layer module structure, and output a spliced feature map corresponding to any feature map; the number of channels of the spliced feature map corresponding to any feature map is equal to the sum of the number of channels of the feature map output by the first convolution unit included in the N-th layer module structure, the number of channels of the multi-scale context information output by the hole convolution unit included in the N-1-th layer module structure, and the number of channels of the feature map output by the second convolution unit included in the N-1-th layer module structure.
10. The detection model according to claim 9, characterized in that: The second splicing unit included in the second-layer module structure is used to splice the output of the dilated convolution unit included in the first-layer module structure and the output of the dilated convolution unit included in the second-layer module structure, and output a second splicing image corresponding to any feature map in the second-layer module structure; the number of channels of the second splicing image corresponding to any feature map in the second-layer module structure is equal to the sum of the number of channels of the multi-scale context information output by the dilated convolution unit included in the first-layer module structure and the number of channels of the multi-scale context information output by the dilated convolution unit included in the second-layer module structure; The second splicing unit included in the f-th layer module structure is used to splice the output of the hole convolution unit included in the f-th layer module structure and the output of the second convolution unit included in the f-1th layer module structure, and output the second splicing image corresponding to any feature map in the f-th layer module structure; the number of channels of the second splicing image corresponding to any feature map in the f-th layer module structure is equal to the sum of the number of channels of the multi-scale context information output by the hole convolution unit included in the f-th layer module structure and the number of channels of the feature map output by the second convolution unit included in the f-1th layer module structure.
Citation Information
Patent Citations
Blood leukocyte segmentation method based on double paths and void space pyramid pooling
CN114187265A
Image segmentation method and device, terminal equipment and readable storage medium
CN114742700A
Defect detection system and method based on double-path attention network
CN117036290A
Cartilage image segmentation method and apparatus, readable storage medium, and terminal device
WO2021031066A1
