Full-automatic segmentation method for cultivated land parcels based on SAM

Through the SAM-based method, the normalized gradient value and environmental similarity index of remote sensing images, combined with the hollow convolution kernel, fully automatic arable land plot segmentation is achieved, solving the diversity and confusion of traditional semantic segmentation technology in arable land objects. The problem of insufficient generalization ability has achieved efficient and universal automation segmentation effect.

CN118918332AActive Publication Date: 2024-11-08四川汉盛源科技有限公司

Patent Information

Application Number
CN202411406225.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2024-11-08
Estimated Expiration
2044-10-10

AI Technical Summary

Technical Problem

Traditional semantic segmentation technology performs poorly in terms of diversity and confusion in cultivated land objects, lacks generalization ability, and requires a lot of time and cost to build training sets, limiting its automation and universality.

Method used

Using SAM-based method, by obtaining remote sensing images, calculating normalized gradient values ​​and environmental similarity index, combining weighted average to obtain the arable land plot identification index, and using a hollow convolution kernel to remove redundant position points, realizing fully automatic segmentation without Training data.

Benefits of technology

It realizes efficient and automated farmland plot extraction for different geographical environments and image sources, improves the degree of automation and universality, and can accurately segment the remote sensing images of all terrain and landforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118918332A_ABST
    Figure CN118918332A_ABST
Patent Text Reader

Abstract

The invention discloses a full-automatic segmentation method for a cultivated land parcel based on SAM, and belongs to the technical field of image recognition, and the method comprises the following steps: firstly, determining the field of the cultivated land parcel and generating a corresponding position point through employing the normalized gradient value of a pixel of an image and the pixel environment similarity, and then optimizing the position point in the field, and obtaining a segmentation result of the cultivated land parcel; according to the method, the location point with the highest score or the optimal location point in each field is found out, finally, the optimal location point is input into SAM to achieve full-automatic segmentation of the cultivated land parcels in the remote sensing images, the method does not need any training data, extraction tasks can be well completed for all the remote sensing images of landforms, and the extraction efficiency is improved. And the automation degree and the universality are high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of image recognition, and in particular relates to a fully automatic segmentation method of cultivated land plots based on SAM. Background Art

[0002] In the field of farmland identification in remote sensing images, although traditional semantic segmentation technology has played an important role, its limitations have gradually become apparent with the development of technology.

[0003] First, high-resolution images have the phenomenon of different spectra for the same object and different objects for the same spectrum. The diversity and confusion of cultivated land objects make traditional semantic segmentation unable to complete the extraction task well.

[0004] Secondly, traditional semantic segmentation technology has difficulties in parameter selection and adjustment, requiring expertise and a large number of experiments to optimize, which limits its automation and universality. In addition, the models usually lack sufficient generalization capabilities, and the performance may drop significantly when migrated to different geographical environments or image sources.

[0005] More importantly, the implementation of traditional methods requires a lot of time and cost to build a training set. Summary of the invention

[0006] In order to solve the problems raised in the above background technology, the present invention provides a fully automatic segmentation method for cultivated land plots based on SAM to solve the problems that the diversity and confusion of cultivated land objects lead to the inability of traditional semantic segmentation to complete the extraction task well, the traditional semantic segmentation lacks sufficient generalization ability and requires a lot of time and cost to build a training set.

[0007] To achieve the above object, the present invention provides the following technical solutions:

[0008] A fully automatic segmentation method for cultivated land plots based on SAM, comprising the following steps:

[0009] S1: Acquire remote sensing images of the target area;

[0010] S2: Grayscale the remote sensing image and calculate the normalized gradient value of each pixel in the remote sensing image;

[0011] S3: Classify the remote sensing image to obtain a classification result, and calculate the normalized environmental similarity index of each pixel in the remote sensing image within the n×n area where it is located through the classification result, wherein the n×n area is determined by the minimum visual distance of a cultivated land plot in the remote sensing image and the pixel resolution;

[0012] S4: Combining the normalized gradient value and the normalized environmental similarity index, the farmland identification index of each pixel in the n×n area is obtained by weighted average;

[0013] S5: setting a threshold, screening pixels in each n×n area by the threshold and the farmland identification index, and taking the screened pixels as location points to enter the next step;

[0014] S6: Use the dilated convolution kernel to remove redundancy from the selected location points in the same area, substitute the removed redundancy location points into SAM, obtain the location point score, retain the location point with the highest score in SAM and output it. When there are multiple location points with the same highest score in the same cultivated land plot, use the intersection-over-union method to select the optimal location point and output it;

[0015] S7: Repeat S6 until all areas have completed the output of location points, and input all the output location points into SAM to achieve automatic segmentation of cultivated land plots in remote sensing images.

[0016] Preferably, the normalized gradient value of each pixel is calculated by the Sobel operator in S2, and the specific implementation formula is as follows:

[0017] ;

[0018] ;

[0019] Among them, grad is the gradient value of the remote sensing image, sobel (x) is the convolution result of the remote sensing image in the horizontal direction, sobel (y) is the convolution result of the remote sensing image in the vertical direction, Ngrad is the normalized gradient value, i is the i-th pixel of the remote sensing image, and Ngrad is the gradient value of the remote sensing image. i is the normalized gradient value of the i-th pixel, grad max is the maximum gradient of the remote sensing image, grad min is the minimum gradient of the remote sensing image, grad i is the gradient value of the ith pixel.

[0020] Preferably, in S3, the remote sensing image is classified according to the isodata unsupervised classification, and the normalized environmental similarity index NESI in the n×n area of ​​each pixel in the remote sensing image is calculated using the classification result. The specific implementation formula is as follows:

[0021] ;

[0022] ;

[0023] ;

[0024] Among them, Classes is the classification result of the remote sensing image, isodata(img) is the classification of the remote sensing image img through isodata unsupervised classification, m is the total number of the i-th pixel in the n×n size field, ESI is the environmental similarity index, ESI i is the environmental similarity index of the i-th pixel, Classes i is the classification result of the i-th pixel, NESI i is the normalized environmental similarity index of the ith pixel, ESI min is the minimum value of the environmental similarity index of the remote sensing image, ESI max is the maximum value of the environmental similarity index of the remote sensing image;

[0025] An n×n area is determined by the minimum visual distance S of a cultivated land plot in the remote sensing image and the pixel resolution a×a, specifically:

[0026] n=S / a.

[0027] Preferably, in S4, the values ​​of Ngrad and NESI are combined to obtain the cultivated land identification index CII by weighted average, and the specific implementation formula is as follows:

[0028] ;

[0029] Among them, k is the preset weight.

[0030] Preferably, in S5, the screening formula for screening the pixels in each n×n area by using the preset threshold D and the cultivated land identification index CII is:

[0031] ;

[0032] Among them, (x, y) is the coordinate point of pixel i.

[0033] Preferably, the preset threshold D is 252.

[0034] Preferably, the preset weight k is 0.35.

[0035] Compared with the prior art, the present invention has the following beneficial effects:

[0036] This application first uses the normalized gradient value of the image pixel and the pixel environment similarity to determine the area of ​​the cultivated land and generate corresponding location points, then optimizes the location points in the area, finds the location point with the highest score or the optimal location point in each area, and finally inputs the optimal location point into SAM to realize fully automatic segmentation of cultivated land in the remote sensing image. The method used in this application does not require any training data, and can well complete the extraction task for remote sensing images of all terrains and landforms, with high degree of automation and universality. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a flowchart of the application;

[0038] Figure 2-1 is the original image;

[0039] Figure 2-2 It is a schematic diagram of image gradient values;

[0040] Figure 2-3 It is a schematic diagram of the environmental similarity index;

[0041] Figure 2-4 This is a schematic diagram of the identification index of cultivated land plots;

[0042] Figure 3 Schematic diagram of plots for screening cultivated land;

[0043] Figure 4 It is the location point distribution map of cultivated land plots;

[0044] Figure 5 This is the location point distribution map of the optimized cultivated land plot;

[0045] Figure 6 This is the segmentation result of SAM. DETAILED DESCRIPTION

[0046] In order to facilitate those skilled in the art to understand the technical content of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific examples. It should be understood that the specific examples described herein are only used to explain the present invention and are not used to limit the present invention.

[0047] Embodiment 1:

[0048] A fully automatic segmentation method for cultivated land plots based on SAM, such as Figure 1 As shown, the following steps are included:

[0049] S1: Figure 2-1 As shown, a high spatial resolution remote sensing image of the target area is obtained. The horizontal and vertical coordinate units of the image are meters. Each cultivated land plot is preliminarily divided by visual method, and the remote sensing image is grayed out.

[0050] S2: Figure 2-2 As shown in the figure, the normalized gradient value of each pixel in the remote sensing image is calculated by the Sobel operator. The specific implementation formula is as follows:

[0051] ;

[0052] ;

[0053] Among them, grad is the gradient value of the remote sensing image, sobel (x) is the convolution result of the remote sensing image in the horizontal direction, sobel (y) is the convolution result of the remote sensing image in the vertical direction, Ngrad is the normalized gradient value, i is the i-th pixel of the remote sensing image, and Ngrad is the gradient value of the remote sensing image. i is the normalized gradient value of the i-th pixel, grad max is the maximum gradient of the remote sensing image, grad min is the minimum gradient of the remote sensing image, grad i is the gradient value of the i-th pixel. The high value of Ngrad is the edge, and the smaller the Ngrad, the farther away from the edge.

[0054] S3: Figure 2-3 As shown, the remote sensing image is classified according to the isodata unsupervised classification, and the normalized environmental similarity index NESI of each pixel in the remote sensing image in the n×n area is calculated using the classification results, where an n×n area is determined by the minimum visual distance of a cultivated land plot in the remote sensing image and the pixel resolution;

[0055] The specific implementation formula is as follows:

[0056] ;

[0057] ;

[0058] ;

[0059] Among them, Classes is the classification result of the remote sensing image, isodata(img) is the classification of the remote sensing image img through isodata unsupervised classification, m is the total number of the i-th pixel in the n×n size field, ESI is the environmental similarity index, ESI i is the environmental similarity index of the i-th pixel, Classes i is the classification result of the i-th pixel, NESI i is the normalized environmental similarity index of the ith pixel, ESI min is the minimum value of the environmental similarity index of the remote sensing image, ESI maxIt is the maximum value of the environmental similarity index of remote sensing images. The smaller the NESI value is, the higher the environmental similarity is.

[0060] An n×n area is determined by the minimum visual distance S of a cultivated land plot in the remote sensing image and the pixel resolution a×a:

[0061] n=S / a;

[0062] For example, if most of the cultivated land plots in the image are 5 meters wide and the pixel resolution is 0.5 meters × 0.5 meters, then n can be set to 10.

[0063] S4: Figure 2-4 As shown in the figure, combining the values ​​of Ngrad and NESI, the cultivated land identification index CII of each pixel in its n×n area is obtained by weighted average. The specific implementation formula is as follows:

[0064] ;

[0065] Among them, k is a preset weight, and the preset weight k is 0.35. The value of k can be appropriately adjusted according to the image quality.

[0066] S5: Figure 3 , Figure 4 As shown in the figure, a threshold D is preset, and the pixels (x, y) in each n×n area are screened by the threshold D and the cultivated land identification index CII. According to the definition of the cultivated land identification index, the farther away from the boundary and the greater the environmental similarity, the greater the cultivated land identification index. The screening formula is:

[0067] ;

[0068] Among them, (x, y) is the coordinate point of pixel i;

[0069] The selected pixels are collected and used as the position points to enter the next step. The preset threshold D is 252, and the value of the threshold D can be adjusted appropriately according to the image quality.

[0070] S6: Figure 5 As shown in the figure, the position points selected in the same field are de-redundanted by using an n×n hole convolution kernel. The size of the convolution kernel can be adjusted, and the default is the field size n. The de-redundant position points are substituted into SAM to obtain the scores of the position points. The position points with the highest scores in SAM are retained and output. When there are multiple position points with the same highest scores in the same cultivated land plot, the intersection-union ratio method is used to select the optimal position point and output it.

[0071] S7: Figure 6As shown, S6 is repeated until the position points of all fields are output, and all the output position points are input into SAM to realize the automatic segmentation of cultivated land plots in remote sensing images.

[0072] In this embodiment, the present application first uses the normalized gradient value of the pixel of the image and the pixel environment similarity to determine the area of ​​the cultivated land plot and generate corresponding location points, and then optimizes the location points in the area to find the location point with the highest score or the optimal location point in each area. Finally, the optimal location point is input into SAM to realize fully automatic segmentation of cultivated land plots in remote sensing images. The method used in this application does not require any training data, and can complete the extraction task well for remote sensing images of all terrains and landforms, with high degree of automation and universality.

Claims

1. A fully automatic land segmentation method based on SAM, characterized in that: The following steps are involved: S1: Acquire remote sensing images of the target area; S2: Grayscale the remote sensing image and calculate the normalized gradient value of each pixel in the remote sensing image; S3: Classify the remote sensing image to obtain a classification result, and calculate the normalized environmental similarity index of each pixel in the remote sensing image within the n×n area where it is located through the classification result, wherein the n×n area is determined by the minimum visual distance of a cultivated land plot in the remote sensing image and the pixel resolution; S4: Combining the normalized gradient value and the normalized environmental similarity index, the farmland identification index of each pixel in the n×n area is obtained by weighted average; S5: setting a threshold, screening pixels in each n×n area by the threshold and the farmland identification index, and taking the screened pixels as location points to enter the next step; S6: Use the dilated convolution kernel to remove redundancy from the selected location points in the same area, substitute the removed redundancy location points into SAM, obtain the location point score, retain the location point with the highest score in SAM and output it. When there are multiple location points with the same highest score in the same cultivated land plot, use the intersection-over-union method to select the optimal location point and output it; S7: Repeat S6 until all areas have completed the output of location points, and input all the output location points into SAM to achieve automatic segmentation of cultivated land plots in remote sensing images.

2. The method for fully automatic segmentation of cultivated land plots based on SAM according to claim 1, characterized in that: In S2, the normalized gradient value of each pixel is calculated by the Sobel operator. The specific implementation formula is as follows: ; ; Among them, grad is the gradient value of the remote sensing image, sobel (x) is the convolution result of the remote sensing image in the horizontal direction, sobel (y) is the convolution result of the remote sensing image in the vertical direction, Ngrad is the normalized gradient value, i is the i-th pixel of the remote sensing image, and Ngrad is the gradient value of the remote sensing image. i is the normalized gradient value of the i-th pixel, grad max is the maximum gradient of the remote sensing image, grad min is the minimum gradient of the remote sensing image, grad i is the gradient value of the ith pixel.

3. The method for fully automatic segmentation of cultivated land plots based on SAM according to claim 2, characterized in that: In S3, remote sensing images are classified according to isodata unsupervised classification, and the classification results are used to calculate the normalized environmental similarity index NESI in the n×n area of ​​each pixel in the remote sensing image. The specific implementation formula is as follows: ; ; ; Among them, Classes is the classification result of the remote sensing image, isodata(img) is the classification of the remote sensing image img through isodata unsupervised classification, m is the total number of the i-th pixel in the n×n size field, ESI is the environmental similarity index, ESI i is the environmental similarity index of the i-th pixel, Classes i is the classification result of the i-th pixel, NESI i is the normalized environmental similarity index of the ith pixel, ESI min is the minimum value of the environmental similarity index of the remote sensing image, ESI max is the maximum value of the environmental similarity index of the remote sensing image; An n×n area is determined by the minimum visual distance S of a cultivated land plot in the remote sensing image and the pixel resolution a×a, specifically: n=S / a.

4. The method for fully automatic segmentation of cultivated land plots based on SAM according to claim 3 is characterized in that: In S4, the values ​​of Ngrad and NESI are combined to obtain the cultivated land identification index CII through weighted average. The specific implementation formula is as follows: ; Among them, k is the preset weight.

5. The method for fully automatic segmentation of cultivated land plots based on SAM according to claim 4, characterized in that: In S5, the screening formula for screening pixels in each n×n area by using the preset threshold D and the cultivated land identification index CII is: ; Among them, (x, y) is the coordinate point of pixel i.

6. The method for fully automatic segmentation of cultivated land plots based on SAM according to claim 5, characterized in that: The preset threshold D is 252.

7. The method for fully automatic segmentation of cultivated land plots based on SAM according to claim 4, characterized in that: The default weight k is 0.35.

Citation Information

Patent Citations

  • Red date variety identification method based on artificial intelligence and hyperspectral imaging

    CN114170444A

  • Remote sensing image-based cultivated land extraction method, device, equipment and medium

    CN116994140A

  • Parcel segmentation method based on SAM model

    CN117197450A

  • A method of imaging a sample

    EP2181351A2

  • Method and system for gradational seismic volume classification

    US20160291182A1

Cited By

  • SAM-based remote sensing image farmland segmentation model, method, device and medium

    CN120164093A