CN117197450A - SAM model-based land parcel segmentation method - Google Patents
SAM model-based land parcel segmentation method Download PDFInfo
- Publication number
- CN117197450A CN117197450A CN202310895082.XA CN202310895082A CN117197450A CN 117197450 A CN117197450 A CN 117197450A CN 202310895082 A CN202310895082 A CN 202310895082A CN 117197450 A CN117197450 A CN 117197450A
- Authority
- CN
- China
- Prior art keywords
- segmentation
- sam model
- land
- sam
- model
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 230000011218 segmentation Effects 0.000 title claims abstract description 38
- 238000012545 processing Methods 0.000 claims abstract description 22
- 238000012549 training Methods 0.000 claims abstract description 22
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 11
- 238000005070 sampling Methods 0.000 claims description 13
- 238000001228 spectrum Methods 0.000 claims description 13
- 238000012360 testing method Methods 0.000 claims description 12
- 238000001914 filtration Methods 0.000 claims description 6
- 230000000877 morphologic effect Effects 0.000 claims description 6
- 230000003595 spectral effect Effects 0.000 claims description 6
- 238000012805 post-processing Methods 0.000 claims description 5
- 101001057166 Homo sapiens Protein EVI2A Proteins 0.000 claims description 3
- 102100027246 Protein EVI2A Human genes 0.000 claims description 3
- 238000013527 convolutional neural network Methods 0.000 claims description 3
- 238000003306 harvesting Methods 0.000 claims description 3
- 238000007637 random forest analysis Methods 0.000 claims description 3
- 238000009331 sowing Methods 0.000 claims description 3
- 239000002352 surface water Substances 0.000 claims description 3
- 238000012546 transfer Methods 0.000 claims description 3
- 238000001429 visible spectrum Methods 0.000 claims description 3
- 238000007621 cluster analysis Methods 0.000 claims description 2
- 238000000638 solvent extraction Methods 0.000 claims 7
- 238000013461 design Methods 0.000 abstract description 4
- 230000006872 improvement Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Landscapes
- Image Processing (AREA)
Abstract
The invention provides a land parcel segmentation method based on a SAM model, and relates to the technical field of land parcel segmentation. The land parcel segmentation method based on the SAM model specifically comprises the following steps of S1, classifier training, S2, medium-resolution remote sensing image processing, S3, high-resolution satellite image processing, S4, segmentation result processing and S5, and result output. By adopting the space-time characteristic generation prompt point of the medium-resolution remote sensing image to guide the SAM model to segment, the problems that the traditional land segmentation method has stronger dependence on training data in supervision and learning, so that the current algorithm is more or is customized for a certain type of cultivated land in a certain area, and a user is required to collect data according to a specific application scene and design and train the model are avoided, so that the method can effectively segment the land in a large range, and the workflow has the characteristics of low cost and zero samples, and the method is ensured to have lower cost and better generalization performance.
Description
Technical Field
The invention relates to the technical field of plot segmentation, in particular to a plot segmentation method based on a SAM model.
Background
The land parcel segmentation refers to a process of large-scale agricultural land parcel division by utilizing satellite remote sensing images, is an important basic task of precise agriculture, is a prerequisite for large-scale agricultural fine intelligent management, and has important strategic significance for scientific research institutions and government departments.
The existing land parcel segmentation methods mostly adopt land parcel extraction based on remote sensing spectral information and land parcel segmentation based on a deep learning algorithm, when the methods are used, the adopted algorithm is used for supervision and learning, mostly, training data is needed, most of the algorithms are customized for a certain type of cultivated land in a certain area, data are needed to be collected according to a specific application scene, model design and training are needed, the cultivated land vector boundary collection process of the corresponding area is difficult, the processing flow is complicated, and the overall use cost is high.
Disclosure of Invention
(one) solving the technical problems
Aiming at the defects of the prior art, the invention provides a land parcel segmentation method based on a SAM model, which solves the problems that the prior land parcel segmentation method has stronger dependency on training data in supervision and learning when in use, and a user is required to acquire data according to a specific application scene and design and train the model.
(II) technical scheme
In order to achieve the above purpose, the invention is realized by the following technical scheme: a land parcel segmentation method based on SAM model specifically comprises the following steps:
s1, classifier training
Acquiring a plurality of groups of spectral characteristic value data through a network, inputting the data into a classifier, dividing the input data into n subsets, generating a union set by using n/2 subsets as a training set, using the rest subsets as a test set, defining a convolutional neural network and a loss function, and respectively performing training test on the classifier on the training set and the test set;
s2, processing medium-resolution remote sensing image
Acquiring a medium-resolution remote sensing image through sentinel No. 2 open source equipment, extracting a space-time spectrum characteristic value of main crops in a target area, inputting the space-time spectrum characteristic value into a classifier with training test completed, and outputting a cultivated land/non-cultivated land division result of the corresponding area;
s3, high-resolution satellite image processing
Acquiring a high-resolution satellite map image of a target area, cutting the satellite map image of the target area into a series of RGB images through sliding window cutting, transmitting a cutting result into a SAM model, performing global segmentation by adopting regular grid points of 32 x 32, re-splicing the generated mask, converting the mask into unified and complete vector data, and finally returning to the segmentation result in the step S2;
s4, processing the segmentation result
Remapping the cultivated land/non-cultivated land dividing result generated in the step S2 onto an original image in an up-sampling mode, removing a non-cultivated land part according to the remapping result, extracting a cultivated land part which is not correctly identified in the step S2, carrying out binarization and morphological filtering operation on the part, reserving relatively complete areas, and taking the areas as ROIs for second-stage segmentation;
s5, outputting results
Generating prompt points through the ROI area generated in the step S4, sampling random points in the ROI, using an unsupervised clustering method to transfer point sets in each clustered cluster as positive samples of the prompt points into a SAM model, splicing and converting the segmented masks, merging the segmented masks with vector data of the step S2, and returning a final segmentation result through post-processing.
Preferably, in the step S1, the classifier algorithm is based on a random forest algorithm.
Preferably, in the step S2, the space-time spectrum characteristic values are 8 spectrum characteristic values of four time periods of the whole year, a sowing period (DOY: 109-169), a growing period (DOY: 170-230), a harvesting period (DOY: 231-291), a non-growing period (DOY: 310-320& DOY: 70-80), wherein the 8 spectrum characteristic values are LSWI surface water indexes, NVSVI normalized visible spectrum variation indexes, RENDVI red-edge normalized vegetation indexes, EVI2 enhanced vegetation indexes, REP red-edge positions and SWIR1/2 short wave infrared.
Preferably, in S3, the default size of the sliding window cut is 2000×2000, and the step size is 1500.
Preferably, in S4, the opening/closing and operation kernel size during the morphological filtering operation defaults to 3*3.
Preferably, in S5, the number of sampling points for performing random point sampling is 10000 as default.
Preferably, in the step S5, the two super parameters for performing the unsupervised cluster analysis are a distance threshold epsilon and a minimum point number MinPts.
Preferably, in the step S5, the post-processing includes simplifying the vector polygons, merging the polygons based on the R tree index, and processing the self-intersecting problem of the polygons.
(III) beneficial effects
The invention provides a land parcel segmentation method based on a SAM model. The beneficial effects are as follows:
1. compared with the existing land block segmentation method, the land block segmentation method provided by the invention has the advantages that the method for segmenting the SAM model is guided by adopting the space-time characteristics of the medium-resolution remote sensing image to generate the prompt points, so that the problem that the traditional land block segmentation method has stronger dependence on training data in use and leads to more conventional algorithms or customization of a certain type of cultivated land in a certain area, and a user is required to acquire data according to a specific application scene to design and train the model is solved, the SAM model is guided to segment by adopting the 17-level map image provided by the sentinel No. 2 of the medium-resolution remote sensing image equipment based on an open source and combining with the SAM model by extracting the space-time characteristics and the prompt engineering of the remote sensing image, and the method can effectively segment the land block in a large range and accurately extract and segment the land block in a large range, so that the work flow for segment the land block by adopting the method has the characteristics of low cost and zero sample, and the method is ensured to have the characteristics of low cost and better generalization.
Drawings
FIG. 1 is a schematic of the workflow of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Examples:
as shown in fig. 1, an embodiment of the present invention provides a land parcel segmentation method based on a SAM model, which specifically includes the following steps:
s1, classifier training
Acquiring a plurality of groups of spectral characteristic value data through a network, inputting the data into a classifier, dividing the input data into n subsets, generating a union set by using n/2 subsets as a training set, using the rest subsets as a test set, defining a convolutional neural network and a loss function, respectively performing training test on the classifier on the training set and the test set, and facilitating the realization of training the classifier in advance and ensuring the accuracy of the classifier in data processing, wherein the process is realized by the following procedures:
s2, processing medium-resolution remote sensing image
Acquiring a medium-resolution remote sensing image through sentinel No. 2 open source equipment, extracting a space-time spectrum characteristic value of main crops in a target area, inputting the space-time spectrum characteristic value into a classifier with training test completed, and outputting a cultivated land/non-cultivated land division result corresponding to the area to realize preliminary division of cultivated land and non-cultivated land of the area;
s3, high-resolution satellite image processing
Acquiring a high-resolution satellite map image of a target area, cutting the satellite map image of the target area into a series of RGB images through sliding window cutting, transmitting a cutting result into a SAM model, performing global segmentation by adopting regular grid points of 32 x 32, re-splicing a generated mask, converting the mask into unified and complete vector data, and finally returning to the segmentation result in S2 to process the high-resolution satellite image and mutually fusing the processing result with a medium-resolution remote sensing image;
s4, processing the segmentation result
Remapping the cultivated land/non-cultivated land dividing result generated in the step S2 onto an original image in an up-sampling mode, removing a non-cultivated land part according to the remapping result, extracting a cultivated land part which is not correctly identified in the step S2, carrying out binarization and morphological filtering operation on the part, reserving relatively complete areas, taking the areas as ROIs for second-stage segmentation, and improving the accuracy of segmentation processing;
s5, outputting results
Generating prompt points through the ROI area generated in the step S4, sampling random points in the ROI, using an unsupervised clustering method to transfer point sets in each clustered cluster as positive samples of the prompt points into a SAM model, splicing and converting the segmented masks, merging the segmented masks with vector data of the step S2, and returning a final segmentation result through post-processing to realize the function of segmenting the land parcels.
In S1, the algorithm of the classifier is based on a random forest algorithm, so that the result output by the classifier as a whole has higher accuracy and generalization performance, and in S2, the space-time spectrum characteristic value is four time periods in the whole year, and the sowing period (DOY: 109-169), a growing period (DOY: 170-230), a harvesting period (DOY: 231-291), 8 spectral characteristic values of non-growing periods (DOY: 310-320& DOY: 70-80), 8 spectral characteristic values of LSWI surface water indexes, NVSVI normalized visible spectrum variation indexes, RENDVI red edge normalized vegetation indexes, EVI2 enhanced vegetation indexes, REP red edge positions, SWIR1/2 shortwave infrared, the improvement of the comprehensiveness of data obtained when the method is used, the improvement of the accuracy of segmentation results, the default size of sliding window cutting is 2000 x 2000, the step size is 1500, the improvement of the cutting effect of sliding windows is facilitated, the opening and closing and operation kernel size is 3*3 in the morphological filtering operation process is facilitated, the number of sampling points for random point sampling is 10000 in S5, the improvement of the accuracy and comprehensiveness of sampling is facilitated, two super-parameters for performing unsupervised clustering analysis are distance threshold values and minimum Pts, the range of Pts is facilitated to be used for the improvement of the accuracy of a polygon, the best point number of the best point number is used for the polygon combination processing, and the minimum point number of the polygon is included in the polygon processing, and the polygon processing is facilitated after the minimum point number is used for the point number of the point number is included in the polygon processing, in S4.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.
Claims (8)
1. The SAM model-based land parcel segmentation method is characterized by comprising the following steps:
s1, classifier training
Acquiring a plurality of groups of spectral characteristic value data through a network, inputting the data into a classifier, dividing the input data into n subsets, generating a union set by using n/2 subsets as a training set, using the rest subsets as a test set, defining a convolutional neural network and a loss function, and respectively performing training test on the classifier on the training set and the test set;
s2, processing medium-resolution remote sensing image
Acquiring a medium-resolution remote sensing image through sentinel No. 2 open source equipment, extracting a space-time spectrum characteristic value of main crops in a target area, inputting the space-time spectrum characteristic value into a classifier with training test completed, and outputting a cultivated land/non-cultivated land division result of the corresponding area;
s3, high-resolution satellite image processing
Acquiring a high-resolution satellite map image of a target area, cutting the satellite map image of the target area into a series of RGB images through sliding window cutting, transmitting a cutting result into a SAM model, performing global segmentation by adopting regular grid points of 32 x 32, re-splicing the generated mask, converting the mask into unified and complete vector data, and finally returning to the segmentation result in the step S2;
s4, processing the segmentation result
Remapping the cultivated land/non-cultivated land dividing result generated in the step S2 onto an original image in an up-sampling mode, removing a non-cultivated land part according to the remapping result, extracting a cultivated land part which is not correctly identified in the step S2, carrying out binarization and morphological filtering operation on the part, reserving relatively complete areas, and taking the areas as ROIs for second-stage segmentation;
s5, outputting results
Generating prompt points through the ROI area generated in the step S4, sampling random points in the ROI, using an unsupervised clustering method to transfer point sets in each clustered cluster as positive samples of the prompt points into a SAM model, splicing and converting the segmented masks, merging the segmented masks with vector data of the step S2, and returning a final segmentation result through post-processing.
2. The method for partitioning a plot based on a SAM model of claim 1, wherein: in the step S1, the algorithm of the classifier is based on a random forest algorithm.
3. The method for partitioning a plot based on a SAM model of claim 1, wherein: in the S2, the space-time spectrum characteristic values are 8 spectrum characteristic values of four time periods of the whole year, a sowing period (DOY: 109-169), a growing period (DOY: 170-230), a harvesting period (DOY: 231-291), a non-growing period (DOY: 310-320& DOY: 70-80), the 8 spectrum characteristic values are LSWI surface water indexes, NVSVI normalized visible spectrum variation indexes, RENDVI red edge normalized vegetation indexes, EVI2 enhanced vegetation indexes, REP red edge positions and SWIR1/2 short wave infrared.
4. The method for partitioning a plot based on a SAM model of claim 1, wherein: in S3, the default size of the sliding window cutting is 2000×2000, and the step length is 1500.
5. The method for partitioning a plot based on a SAM model of claim 1, wherein: in S4, the opening/closing and operation kernel size during the morphological filtering operation defaults to 3*3.
6. The method for partitioning a plot based on a SAM model of claim 1, wherein: in S5, the number of sampling points for random point sampling defaults to 10000.
7. The method for partitioning a plot based on a SAM model of claim 1, wherein: in the step S5, two super parameters for performing unsupervised cluster analysis are a distance threshold epsilon and a minimum point number MinPts.
8. The method for partitioning a plot based on a SAM model of claim 1, wherein: in S5, the post-processing includes simplifying the vector polygon, merging the polygons based on the R tree index, and processing the self-intersecting problem of the polygons.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310895082.XA CN117197450A (en) | 2023-07-20 | 2023-07-20 | SAM model-based land parcel segmentation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310895082.XA CN117197450A (en) | 2023-07-20 | 2023-07-20 | SAM model-based land parcel segmentation method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117197450A true CN117197450A (en) | 2023-12-08 |
Family
ID=88991329
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310895082.XA Pending CN117197450A (en) | 2023-07-20 | 2023-07-20 | SAM model-based land parcel segmentation method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117197450A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118135426A (en) * | 2024-05-07 | 2024-06-04 | 浙江四港联动发展有限公司 | Port water area traffic condition identification method based on satellite image and SAM |
CN118262251A (en) * | 2024-03-05 | 2024-06-28 | 北京师范大学 | Method and device for extracting farmland distribution information based on remote sensing images |
CN118470092A (en) * | 2024-06-04 | 2024-08-09 | 航天宏图信息技术股份有限公司 | Crop planting area extraction method, device, equipment and medium |
CN118918332A (en) * | 2024-10-10 | 2024-11-08 | 四川汉盛源科技有限公司 | SAM-based full-automatic farmland block segmentation method |
-
2023
- 2023-07-20 CN CN202310895082.XA patent/CN117197450A/en active Pending
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118262251A (en) * | 2024-03-05 | 2024-06-28 | 北京师范大学 | Method and device for extracting farmland distribution information based on remote sensing images |
CN118262251B (en) * | 2024-03-05 | 2024-11-22 | 北京师范大学 | Method and device for extracting farmland distribution information based on remote sensing images |
CN118135426A (en) * | 2024-05-07 | 2024-06-04 | 浙江四港联动发展有限公司 | Port water area traffic condition identification method based on satellite image and SAM |
CN118470092A (en) * | 2024-06-04 | 2024-08-09 | 航天宏图信息技术股份有限公司 | Crop planting area extraction method, device, equipment and medium |
CN118918332A (en) * | 2024-10-10 | 2024-11-08 | 四川汉盛源科技有限公司 | SAM-based full-automatic farmland block segmentation method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN117197450A (en) | SAM model-based land parcel segmentation method | |
CN106951836B (en) | Crop Coverage Extraction Method Based on Prior Threshold Optimizing Convolutional Neural Network | |
Ma et al. | National-scale greenhouse mapping for high spatial resolution remote sensing imagery using a dense object dual-task deep learning framework: A case study of China | |
Malinverni et al. | Hybrid object-based approach for land use/land cover mapping using high spatial resolution imagery | |
CN111126287B (en) | A deep learning detection method for dense targets in remote sensing images | |
Fu et al. | Comparison of optimized object-based RF-DT algorithm and SegNet algorithm for classifying Karst wetland vegetation communities using ultra-high spatial resolution UAV data | |
CN109063754B (en) | Remote sensing image multi-feature joint classification method based on OpenStreetMap | |
Cavallaro et al. | Automatic attribute profiles | |
Liu et al. | The recognition of apple fruits in plastic bags based on block classification | |
CN113591766A (en) | Multi-source remote sensing tree species identification method for unmanned aerial vehicle | |
CN109344699A (en) | Disease identification method of winter jujube based on hierarchical deep convolutional neural network | |
CN111814563B (en) | Method and device for classifying planting structures | |
CN104751122B (en) | A kind of computational methods and system of crops disease index | |
CN116883853B (en) | Remote sensing classification method of crop spatiotemporal information based on transfer learning | |
CN116543316B (en) | Method for identifying turf in paddy field by utilizing multi-time-phase high-resolution satellite image | |
CN111507967A (en) | A high-precision detection method for mangoes in a natural orchard scene | |
CN110598741B (en) | A pixel-level label automatic generation model construction, automatic generation method and device | |
CN110008912A (en) | A social platform matching method and system based on plant identification | |
Liu | A SAM-based method for large-scale crop field boundary delineation | |
Ouchra et al. | Comparison of machine learning methods for satellite image classification: A case study of Casablanca using Landsat imagery and Google Earth Engine | |
Xie et al. | Improvement and application of UNet network for avoiding the effect of urban dense high-rise buildings and other feature shadows on water body extraction | |
Ferro et al. | Comparison of different computer vision methods for vineyard canopy detection using UAV multispectral images | |
Zheng et al. | Single shot multibox detector for urban plantation single tree detection and location with high-resolution remote sensing imagery | |
CN113723833B (en) | Method, system, terminal equipment and storage medium for evaluating quality of forestation actual results | |
Chen et al. | Dense greenhouse extraction in high spatial resolution remote sensing imagery |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |