A fully automatic segmentation method of cultivated land based on SAM

Through the SAM-based method, the normalized gradient value and environmental similarity index of remote sensing images are used to realize full automatic segmentation of cultivated land plots, solving the diversity, confusion and generalization capabilities of traditional semantic segmentation technology in cultivated land objects in the diversity, confusion and generalization capabilities of traditional semantic segmentation technology The problem of insufficient has achieved highly automated and universal arable land plot extraction.

CN118918332BActive Publication Date: 2024-12-13四川汉盛源科技有限公司
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411406225.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2024-12-13
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 capabilities, and is time-consuming and cost-effective in building training sets, making it difficult to achieve automation and universality.

Method used

Using SAM-based method, by obtaining remote sensing images, the normalized gradient value and environmental similarity index of the cell are calculated, combined with weighted average, the arable land plot identification index is obtained, the position points are filtered, and redundant is eliminated through the hollow convolution kernel. Finally, fully automatic segmentation of cultivated land plots is realized in SAM.

Benefits of technology

Without training data, the extraction of cultivated land plots can be efficiently completed in different geographical environments and image sources, improving the degree of automation and universality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118918332B_ABST
    Figure CN118918332B_ABST
Patent Text Reader

Abstract

The invention discloses a fully automatic segmentation method for cultivated land plots based on SAM, which belongs to the technical field of image recognition and comprises the following steps: firstly, the domain of the cultivated land plot is determined by using the normalized gradient value of the pixel of the image and the similarity of the pixel environment and the corresponding position points are generated, then the position points in the domain are optimized, and the position points with the highest score or the optimal position points in each domain are found, and finally the optimal position points are input into SAM to realize fully automatic segmentation of the cultivated land plots in the remote sensing image. The method used in the present application does not require any training data, and can well complete the extraction task for remote sensing images of all terrains and landforms, and has high automation and universality.
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 through the Sobel operator. The specific implementation formula is as follows:

[0011] ;

[0012] ;

[0013] 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;

[0014] S3: Classify the remote sensing image according to the isodata unsupervised classification to obtain the classification result. The normalized environmental similarity index NESI of each pixel in the remote sensing image in the n×n area is calculated based on the classification result. The specific implementation formula is as follows:

[0015] ;

[0016] ;

[0017] ;

[0018] 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:

[0019] n=S / a;

[0020] S4: 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:

[0021] ;

[0022] Among them, k is the preset weight;

[0023] S5: Set a threshold D, and use the threshold D and the cultivated land identification index CII to screen the pixels in each n×n area, and use the screened pixels as location points to enter the next step. The screening formula is:

[0024] ;

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

[0026] 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;

[0027] 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.

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

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

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

[0031] 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

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

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

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

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

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

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

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

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

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

[0041] 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.

[0042] Embodiment 1:

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

[0044] 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 parcel is preliminarily divided by visual method, and the remote sensing image is grayed out.

[0045] 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:

[0046] ;

[0047] ;

[0048] 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.

[0049] 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;

[0050] The specific implementation formula is as follows:

[0051] ;

[0052] ;

[0053] ;

[0054] 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 It 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.

[0055] 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:

[0056] n=S / a;

[0057] 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.

[0058] 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:

[0059] ;

[0060] 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.

[0061] 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:

[0062] ;

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

[0064] 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.

[0065] 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.

[0066] S7: Figure 6 As 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.

[0067] 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 segmentation method for cultivated land plots based on SAM, It is 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 through 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 i-th pixel; S3: Classify the remote sensing image according to the isodata unsupervised classification to obtain the classification result. The normalized environmental similarity index NESI of each pixel in the remote sensing image in the n×n area is calculated based on the classification result. 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; S4: 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: ; Among them, k is the preset weight; S5: Set a threshold D, and use the threshold D and the cultivated land identification index CII to screen the pixels in each n×n area, and use the screened pixels as location points to enter the next step. The screening formula is: ; Among them, (x, y) is the coordinate point of pixel i; 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. A method for fully automatic segmentation of cultivated land plots based on SAM according to claim 1, It is characterized in that The preset threshold D is 252.

3. The method for fully automatic segmentation of cultivated land plots based on SAM according to claim 1, It is 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