A method, device and related components for measuring the vegetation coverage rate of a slope surface
By constructing a pre-trained model based on COCO data set and slope image semantic segmentation network, combining evaluation coefficient optimization and pixel point quantitative characterization, the problem of insufficient sample number in slope vegetation coverage measurement is solved, and high-precision slope vegetation coverage measurement is achieved.
Patent Information
- Application Number
- CN202310209913.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2043-03-07
AI Technical Summary
In the prior art, in the measurement of slope vegetation coverage, due to the small number of vegetation image samples, the model accuracy is difficult to improve, and the traditional method has a large economic expense and insufficient accuracy.
By using COCO data set and slope image semantic segmentation network to construct a pre-trained model and perform model migration, the image segmentation model of slope vegetation coverage is optimized using evaluation coefficients, and combined with pixel point quantitative characterization, the slope vegetation coverage rate is obtained.
Under the condition of fewer vegetation samples, the accuracy and efficiency of slope vegetation coverage measurement are improved and economic overhead is reduced.
Smart Images

Figure CN116433596B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vegetation coverage measurement, and particularly to a method, device and related components for measuring the vegetation coverage rate of a slope surface. Background Art
[0002] At present, the vegetation coverage rate refers to the percentage of the vertical projection area of vegetation on the ground in the total area of the selected region. By quantifying the density of vegetation, it reflects the growth trend of vegetation and is an important parameter for depicting the basic situation of the ecological environment. Especially when the vegetation coverage rate of the slope is low, it is easy to cause accidents such as rock mass exposure, collapse, and soil erosion. Therefore, the measurement of the vegetation coverage rate of the slope has become a basic task for establishing the current regional ecological model and disaster prevention.
[0003] At present, the slope vegetation coverage rate model established through computer vision technology, due to the significant spatio-temporal differentiation characteristics of the vegetation coverage rate, has greatly reduced the economic cost and further improved the accuracy compared with the method relying on traditional ground quadrat measurements. Especially with the development of remote sensing technology, such models have become an important way for vegetation coverage rate measurement. At the same time, most image segmentation models have been used in the slope vegetation coverage rate measurement model, and its construction requires a large number of slope vegetation image datasets. However, under the current realistic background where slope image acquisition is cumbersome and the sample quantity is small, it is difficult to improve the model accuracy. Summary of the Invention
[0004] The purpose of the present invention is to provide a method, device and related components for measuring the vegetation coverage rate of a slope surface, aiming to solve the problem of difficult traditional vegetation coverage rate measurement under the condition of fewer slope vegetation image samples.
[0005] To solve the above technical problems, the purpose of the present invention is achieved through the following technical solutions: providing a method for measuring the vegetation coverage rate of a slope surface, which includes:
[0006] Preprocess all the collected vegetation sample images, and randomly divide all the preprocessed vegetation sample images into a training set and a test set according to a preset ratio;
[0007] Construct a pre-trained model based on the COCO dataset and the slope image semantic segmentation network, and use all the vegetation sample images in the training set to perform model transfer on the pre-trained model to obtain a slope vegetation coverage situation transfer learning model;
[0008] Input all the vegetation sample images in the test set into the slope vegetation coverage situation transfer learning model to obtain an evaluation result including the relationship between the predicted value and the true value;
[0009] Based on all the obtained evaluation results, calculate the evaluation coefficient ε according to the following formula:
[0010]
[0011] Among them, represents the set of predicted values output by the migration learning model for the slope vegetation coverage situation, and ω represents the set of true values from the test set. represents the intersection of the predicted value and the true value. represents the union of the predicted value and the true value.
[0012] After the evaluation coefficient meets the preset coefficient threshold, an optimized image segmentation model for slope vegetation coverage situation is output.
[0013] Input the collected target slope image into the image segmentation model for slope vegetation coverage situation to obtain the slope vegetation segmentation result.
[0014] Quantitatively characterize the slope vegetation segmentation result based on pixel points to obtain and output the slope vegetation coverage rate.
[0015] In addition, the technical problem to be solved by the present invention is also to provide a device for measuring the slope vegetation coverage rate, which includes:
[0016] A processing unit for preprocessing all the collected vegetation sample images and randomly splitting all the preprocessed vegetation sample images into a training set and a test set according to a preset ratio.
[0017] A migration unit for constructing a pre-trained model based on the COCO dataset and the slope image semantic segmentation network, and using all the vegetation sample images in the training set to perform model migration on the pre-trained model to obtain a migration learning model for slope vegetation coverage situation.
[0018] An evaluation result acquisition unit for inputting all the vegetation sample images in the test set into the migration learning model for slope vegetation coverage situation to obtain an evaluation result including the relationship between the predicted value and the true value.
[0019] An evaluation coefficient calculation unit for calculating the evaluation coefficient ε according to the following formula based on all the obtained evaluation results:
[0020]
[0021] Among them, represents the set of predicted values output by the migration learning model for slope vegetation coverage situation, and ω represents the set of true values from the test set. represents the intersection of the predicted value and the true value. represents the union of the predicted value and the true value.
[0022] An optimization unit, configured to output an optimized image segmentation model of the slope vegetation coverage after the evaluation coefficient meets a preset coefficient threshold;
[0023] An input unit, configured to input a collected target slope image into the image segmentation model of the slope vegetation coverage to obtain a slope vegetation segmentation result;
[0024] An output unit, configured to quantitatively characterize the slope vegetation segmentation result based on pixel points, obtain a slope vegetation coverage rate, and output it.
[0025] In addition, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the method for measuring the slope surface vegetation coverage rate described in the first aspect above is implemented.
[0026] In addition, an embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to execute the method for measuring the slope surface vegetation coverage rate described in the first aspect above.
[0027] An embodiment of the present invention discloses a method, device, and related components for measuring the slope surface vegetation coverage rate. The method includes: preprocessing all collected vegetation sample images, and randomly splitting all the preprocessed vegetation sample images into a training set and a test set according to a preset ratio; constructing a pre-trained model based on the COCO dataset and the slope image semantic segmentation network, and using all the vegetation sample images in the training set to perform model migration on the pre-trained model to obtain a transferred learning model of the slope vegetation coverage; inputting all the vegetation sample images in the test set into the transferred learning model of the slope vegetation coverage to obtain an evaluation result including the relationship between the predicted value and the true value; calculating an evaluation coefficient based on all the obtained evaluation results; outputting an optimized image segmentation model of the slope vegetation coverage after the evaluation coefficient meets a preset coefficient threshold; inputting a collected target slope image into the image segmentation model of the slope vegetation coverage to obtain a slope vegetation segmentation result; quantitatively characterizing the slope vegetation segmentation result based on pixel points, obtaining a slope vegetation coverage rate, and outputting it. This method can construct an image segmentation model of the slope vegetation coverage that can output a relatively accurate slope vegetation coverage rate by using fewer vegetation sample images. Description of the Drawings
[0028] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.
[0029] Figure 1 It is a schematic flowchart of the method for measuring the vegetation coverage rate of the slope surface provided by the embodiment of the present invention;
[0030] Figure 2 It is a schematic diagram of the proportion of the number of pixels in the target slope surface area in the method for measuring the vegetation coverage rate of the slope surface provided by the embodiment of the present invention;
[0031] Figure 3 It is a schematic block diagram of the device for measuring the vegetation coverage rate of the slope surface provided by the embodiment of the present invention;
[0032] Figure 4 It is a schematic block diagram of the computer device provided by the embodiment of the present invention. Specific Embodiments
[0033] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.
[0034] It should be understood that when used in this specification and the appended claims, the terms "comprises" and "comprising" indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0035] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in this specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to include the plural forms.
[0036] It should be further understood that the term " / and / " used in this specification of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the related listed items, and includes these combinations.
[0037] Please refer to Figure 1 , Figure 1Schematic flowchart of the method for measuring the vegetation coverage rate of the slope surface provided by the embodiment of the present invention;
[0038] As Figure 1 shown, the method includes steps S101 to S107.
[0039] S101. Preprocess all the collected vegetation sample images, and randomly divide all the preprocessed vegetation sample images into a training set and a test set according to a preset ratio;
[0040] In this embodiment, for each obtained vegetation sample image, first, the vegetation boundary pixel points of the vegetation sample image can be selected through image processing software; then, the vegetation boundary pixel points on the current vegetation sample image are highlighted or marked, so as to complete the preprocessing of the vegetation sample image. After preprocessing all the vegetation sample images, all the vegetation sample images are randomly divided into a training set and a test set according to a ratio of 7:3. The training set is used to construct a transfer learning model for the slope surface vegetation coverage, and the test set is used to test the accuracy of the transfer learning model for the slope surface vegetation coverage.
[0041] S102. Construct a pre-training model based on the COCO dataset and the slope image semantic segmentation network, and use all the vegetation sample images in the training set to perform model transfer on the pre-training model to obtain a transfer learning model for the slope surface vegetation coverage;
[0042] In this embodiment, the COCO large public dataset is used to construct a pre-training model for implementing the segmentation task based on a slope image semantic segmentation network. On the basis of the generated pre-training model, the training set of all the vegetation sample images in the training set is used, that is, the pre-training model is used for transfer under the condition of small samples to complete the model transfer. Among them, the COCO large public dataset includes tasks such as image classification, object detection, semantic segmentation, and instance segmentation, aiming at object recognition under scene understanding, and is constructed by collecting complex scene pictures in natural backgrounds. This dataset contains 91 common object categories, a total of 328,000 pictures, and 2.5 million individual segmentation annotation instances to improve the accuracy of object localization. In the DPMv5-P and DPMv5-C model evaluations, it is shown that compared with the PASCAL VOC dataset, the COCO dataset has significantly higher picture complexity and stronger generalization ability of the training model.
[0043] In this embodiment, a ramp image semantic segmentation network is also used to represent the final segmentation result of the corresponding pixel points of the target object in the image with pixel points of the same color. The segmentation network includes a backbone sub-network, which serves as a feature extractor to extract features; a feature pyramid sub-network, which uses high-level features with a smaller resolution to perform convolution downsampling and upsampling to the previous feature and add them element by element to obtain the corresponding feature map; a proposal sub-network, which is used to predict the probability of the existence of the target object in the region and can be filtered according to the score threshold; and a fully convolutional sub-network for performing bounding box regression to generate a mask for the target object, etc.
[0044] When the image segmentation model is used for measuring the slope vegetation coverage rate, a large number of slope vegetation image data sets are required for model construction. However, the current condition of less slope image data has a great impact on the modeling accuracy. And this application uses the COCO large public data set and the ramp image semantic segmentation network to construct a pre-trained model, effectively solving the problems of difficulty in the image segmentation model for the slope vegetation coverage situation under the condition of small samples and poor model prediction accuracy.
[0045] Specifically, the pre-trained model is constructed based on the COCO data set and the ramp image semantic segmentation network in step S102. Specifically, the ramp image semantic segmentation network is composed of sub-networks such as a backbone sub-network, a feature pyramid sub-network, a proposal sub-network, and a fully convolutional sub-network. The process of constructing the pre-trained model includes:
[0046] S20: Input the original images in the COCO data set into the backbone sub-network and the feature pyramid sub-network in sequence to obtain the corresponding feature maps;
[0047] In this embodiment, the backbone sub-network (usually a ResNet network) and the feature pyramid sub-network (Feature Pyramid Network, FPN) are used to extract color, contour, and category features from the original images to obtain feature maps (Feature Maps).
[0048] S21: Set a preset number of candidate regions of interest at each pixel position in the feature map;
[0049] That is, each pixel in the feature map corresponds to multiple candidate regions of interest.
[0050] S22: Input each of the candidate regions of interest into the region proposal sub-network respectively, and output the probability scores of each candidate region of interest having the target object;
[0051] In this embodiment, the region proposal sub-network (Region Proposal Network, RPN) is used to output the probability scores of each of the candidate regions of interest having the target object to illustrate the probability size of the existence of the target object in this region.
[0052] S23. Determine whether each of the probability scores exceeds a preset score threshold. If the current probability score exceeds the preset score threshold, determine the corresponding current candidate region of interest as the target region of interest;
[0053] In this embodiment, high-score regions, i.e., candidate regions of interest with high probability scores, are selected according to the score threshold as the target regions of interest (ROIs).
[0054] S24. Perform bilinear interpolation and max pooling on each of the target regions of interest to align the pixel points in the original image with the pixel points of the corresponding target regions of interest;
[0055] In this embodiment, 4 sampling points are set for each target region of interest, and the target region of interest is scaled to a preset size by using bilinear interpolation and max pooling, so as to align the pixel points in the original image with the pixel points of the target region of interest and prevent misalignment of the pixel points between the original image and the target region of interest.
[0056] S25. Input the aligned target regions of interest into the fully convolutional sub-network to perform the bounding box regression task, and obtain the corresponding true bounding box function according to the following formula:
[0057]
[0058]
[0059]
[0060]
[0061] where, δ x 、δ y 、δ a 、δ b represent the four-dimensional vector of the original bounding box P, represents the true bounding box function after regression, and α x(.) 、α y(.) functions respectively represent the translation transformation functions of vectors x and y, and α a(.) 、α b(.) functions respectively represent the scale scaling functions of vectors a and b;
[0062] S26. Input the target regions of interest after performing the bounding box regression task into the fully convolutional sub-network to perform the multi-classification task. The multi-classification task includes:
[0063] S27. Obtain the binary mask prediction probability value of the target region of interest according to the following formula:
[0064]
[0065] Among them, γ represents the probability score that the corresponding target region of interest output by the region proposal sub-network has a target object, and the value range of θ(γ) is (0, 1);
[0066] S28. Determine whether the binary mask prediction probability value is greater than a preset prediction probability threshold. If the binary mask prediction probability value is greater than the preset prediction probability threshold, it is determined that the target region of interest contains a target object;
[0067] S29. Generate a corresponding mask (as shown in Figure 2 ) for the target object in the target region of interest after performing the multi-classification task, and obtain the image segmentation result. If the slope image semantic segmentation network can normally output the image segmentation result according to the COCO dataset, it can be considered that the construction of the pre-trained model is completed.
[0068] In step S29, it should be noted that the mask represents the pixel points covered by the target object, and such a set of pixel points is the image segmentation result. The actual generation of the target object mask is represented by the same color.
[0069] In this embodiment, for the training of the COCO large public dataset, the slope image semantic segmentation network is used for model training. In this slope image semantic segmentation network, the backbone sub-network and the feature pyramid sub-network are used to extract features such as color, contour, and category from the dataset to obtain the feature map. First, the region proposal sub-network is used to generate proposals for the feature map. The proposal represents the probability that the target may be included in this region. According to the probability, the ROI is intercepted on the feature map. Then, a corresponding binary mask is predicted for each ROI for binary classification. The IOU threshold is 0.5, that is, when the probability that the ROI is predicted to contain a target is greater than or equal to 0.5, it is considered that the ROI is part of the target. Finally, a bounding box regression task and a mask (Mask) generation are performed on these ROIs to obtain the segmentation target bounding box and mask as the image segmentation result.
[0070] When constructing the slope vegetation coverage model, there is a high requirement for the image segmentation ability of the selected image segmentation model. The present invention uses a slope image semantic segmentation network to perform the image segmentation task, which can give the pixel-level segmentation result of each target while detecting the target in the image, effectively improving the measurement accuracy of the slope vegetation coverage rate.
[0071] S103. Input all the vegetation sample images in the test set into the slope vegetation coverage transfer learning model to obtain an evaluation result including the relationship between the predicted value and the true value;
[0072] S104. Based on all the obtained evaluation results, calculate the evaluation coefficient ε according to the following formula:
[0073]
[0074] Among them, represents the set of predicted values output by the transfer learning model for the vegetation coverage situation on the slope surface, ω represents the set of true values from the test set, represents the intersection of the predicted value and the true value, represents the union of the predicted value and the true value;
[0075] In this embodiment, an evaluation coefficient is used as an evaluation index of the model to evaluate the image segmentation result of the test set. Among them, the evaluation coefficient ε is a function for evaluating the similarity of sets.
[0076] S105. After the evaluation coefficient meets the preset coefficient threshold, an optimized image segmentation model for the vegetation coverage situation on the slope surface is output;
[0077] S106. Input the collected target slope surface image into the image segmentation model for the vegetation coverage situation on the slope surface to obtain the vegetation segmentation result on the slope surface;
[0078] In this embodiment, the slope surface image of the target slope can be obtained by an unmanned aerial vehicle, then the target slope surface image is obtained from the slope surface image, and then the target slope surface image is input into the above-mentioned image segmentation model for the vegetation coverage situation on the slope surface that meets the accuracy requirements to obtain the vegetation segmentation result on the slope surface. S107. Quantitatively characterize the vegetation segmentation result on the slope surface based on pixel points to obtain the vegetation coverage rate on the slope surface and output it.
[0079] Combined with Figure 2 , in this embodiment, step S107 includes:
[0080] S10. Based on the measurement area selection instruction, pre-select the target slope surface area in the target slope surface image;
[0081] S11. Obtain the pixel amount ratio of the vegetation segmentation result in the target slope surface area according to the following formula:
[0082]
[0083] Among them, Ⅰ represents the number of vegetation segmentation pixel points in the target slope surface area, Ⅱ represents the number of pixel points corresponding to the total area of the target slope surface area, and the ratio R of the two represents the vegetation coverage rate on the slope surface.
[0084] This application uses a pixel-point-based quantitative characterization method to process the vegetation segmentation result of the image segmentation model for the vegetation coverage situation on the slope surface. Based on the pixel-level segmentation result obtained from the above vegetation image segmentation model, it is quantified into a vegetation coverage rate ratio.
[0085] An embodiment of the present invention further provides a measuring device for the vegetation coverage rate of a slope surface, and the measuring device for the vegetation coverage rate of the slope surface is used to execute any embodiment of the foregoing method for measuring the vegetation coverage rate of the slope surface. Specifically, please refer to Figure 3 , Figure 3 which is a schematic block diagram of the measuring device for the vegetation coverage rate of the slope surface provided by the embodiment of the present invention.
[0086] As Figure 3 shown, the measuring device 500 for the vegetation coverage rate of the slope surface includes:
[0087] A processing unit 501, configured to preprocess all collected vegetation sample images, and randomly split all the preprocessed vegetation sample images into a training set and a test set according to a preset ratio;
[0088] A migration unit 502, configured to construct a pre-trained model based on the COCO dataset and the slope image semantic segmentation network, and perform model migration on the pre-trained model by using all the vegetation sample images in the training set to obtain a migration learning model for the vegetation coverage situation of the slope surface;
[0089] An evaluation result acquisition unit 503, configured to input all the vegetation sample images in the test set into the migration learning model for the vegetation coverage situation of the slope surface to obtain an evaluation result including the relationship between the predicted value and the true value;
[0090] An evaluation coefficient calculation unit 504, configured to calculate an evaluation coefficient ε according to the following formula based on all the obtained evaluation results:
[0091]
[0092] wherein, represents the set of predicted values output by the migration learning model for the vegetation coverage situation of the slope surface, ω represents the set of true values from the test set, represents the intersection of the predicted value and the true value, represents the union of the predicted value and the true value;
[0093] An optimization unit 505, configured to output an optimized image segmentation model for the vegetation coverage situation of the slope surface after the evaluation coefficient meets a preset coefficient threshold;
[0094] An input unit 506, configured to input the collected target slope surface image into the image segmentation model for the vegetation coverage situation of the slope surface to obtain a slope surface vegetation segmentation result;
[0095] An output unit 507, configured to quantitatively characterize the slope surface vegetation segmentation result based on pixel points, obtain the slope surface vegetation coverage rate and output it.
[0096] The device can construct an image segmentation model of the slope vegetation coverage situation that can output a relatively accurate slope vegetation coverage rate by using fewer vegetation sample images.
[0097] In a specific embodiment, the output unit includes:
[0098] A target slope area unit for pre-selecting a target slope area in the target slope image based on a measurement area selection instruction;
[0099] A pixel quantity ratio calculation unit for obtaining the pixel quantity ratio of the slope vegetation segmentation result in the target slope area according to the following formula:
[0100]
[0101] Where Ⅰ represents the number of vegetation segmentation pixel points in the target slope area, Ⅱ represents the number of pixel points corresponding to the total area of the target slope area, and the ratio R of the two represents the slope vegetation coverage rate.
[0102] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described device and unit can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.
[0103] The above slope vegetation coverage rate measurement device can be implemented in the form of a computer program, and this computer program can run on a computer device as shown in Figure 4 shown.
[0104] Please refer to Figure 4 , Figure 4 which is a schematic block diagram of the computer device provided by the embodiment of the present invention. The computer device 1100 is a server, and the server can be an independent server or a server cluster composed of multiple servers.
[0105] Referring to Figure 4 , the computer device 1100 includes a processor 1102, a memory, and a network interface 1105 connected through a system bus 1101. Among them, the memory can include a non-volatile storage medium 1103 and an internal memory 1104.
[0106] The non-volatile storage medium 1103 can store an operating system 11031 and a computer program 11032. When the computer program 11032 is executed, the processor 1102 can be made to execute the slope vegetation coverage rate measurement method.
[0107] The processor 1102 is used to provide computing and control capabilities to support the operation of the entire computer device 1100.
[0108] The internal memory 1104 provides an environment for the operation of the computer program 11032 in the non-volatile storage medium 1103. When the computer program 11032 is executed by the processor 1102, the processor 1102 can be caused to execute the method for measuring the vegetation coverage rate of the slope surface.
[0109] The network interface 1105 is used for network communication, such as providing the transmission of data information, etc. Those skilled in the art can understand that Figure 4 the structure shown in is only a block diagram of some structures related to the solution of the present invention, and does not constitute a limitation on the computer device 1100 to which the solution of the present invention is applied. The specific computer device 1100 may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0110] Those skilled in the art can understand that Figure 4 the embodiments of the computer device shown in do not constitute a limitation on the specific composition of the computer device. In other embodiments, the computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements. For example, in some embodiments, the computer device may only include a memory and a processor. In such an embodiment, the structures and functions of the memory and the processor are the same as those of Figure 4 the embodiment shown, and will not be described in detail here.
[0111] It should be understood that in the embodiments of the present invention, the processor 1102 may be a central processing unit (CPU), and the processor 1102 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0112] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium may be a non-volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for measuring the vegetation coverage rate of the slope surface in the embodiments of the present invention is implemented.
[0113] The storage medium is a physical, non-transitory storage medium, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a magnetic disk, or an optical disc, etc., which are all physical storage media that can store program codes.
[0114] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, apparatuses, and units can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.
[0115] As described above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or substitutions within the technical scope disclosed by the present invention, and these modifications or substitutions should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for measuring the vegetation coverage rate of a slope surface, characterized in that, Including: Preprocess all the collected vegetation sample images, and randomly split all the preprocessed vegetation sample images into a training set and a test set according to a preset ratio; Construct a pre-trained model based on the COCO dataset and the slope image semantic segmentation network, and use all the vegetation sample images in the training set to perform model transfer on the pre-trained model to obtain a transfer learning model for the slope vegetation coverage; Use all the vegetation sample images in the test set to input into the transfer learning model for the slope vegetation coverage to obtain an evaluation result including the relationship between the predicted value and the true value; Based on all the obtained evaluation results, calculate the evaluation coefficient ε according to the following formula Among them, represents the set of predicted values output by the transfer learning model for the vegetation coverage of the slope surface, ω represents the set of true values from the test set, represents the intersection of the predicted value and the true value, represents the union of the predicted value and the true value; After the evaluation coefficient meets the preset coefficient threshold, output an optimized image segmentation model for the slope vegetation coverage; Input the collected target slope image into the image segmentation model for the slope vegetation coverage to obtain a slope vegetation segmentation result; Quantitatively characterize the slope vegetation segmentation result based on pixel points to obtain and output the slope vegetation coverage rate; The quantitatively characterizing the slope vegetation segmentation result based on pixel points to obtain and output the slope vegetation coverage rate includes: Based on the measurement area selection instruction, pre-select the target slope area in the target slope image; Obtain the pixel ratio of the slope vegetation segmentation result in the target slope area according to the following formula: Where Ⅰ represents the number of vegetation segmentation pixel points in the target slope area, Ⅱ represents the number of pixel points corresponding to the total area of the target slope area, and the ratio R of the two represents the slope vegetation coverage rate; The constructing a pre-trained model based on the COCO dataset and the slope image semantic segmentation network. Specifically, the slope image semantic segmentation network is composed of sub-networks such as a backbone sub-network, a feature pyramid sub-network, a proposal sub-network, and a fully convolutional sub-network. The process of constructing the pre-trained model includes: Input the original images in the COCO dataset into the backbone sub-network and the feature pyramid sub-network in sequence to obtain corresponding feature maps; Set a preset number of candidate regions of interest for each pixel position in the feature map; Input each of the candidate regions of interest into the region proposal sub-network respectively, and output the probability scores of each candidate region of interest having a target object; Judge whether each of the probability scores exceeds a preset score threshold. If the current probability score exceeds the preset score threshold, determine the corresponding current candidate region of interest as a target region of interest; Perform bilinear interpolation and maximum pooling processing on each of the target regions of interest to align the pixel points in the original image with the pixel points of the corresponding target regions of interest; Input the aligned target regions of interest into the fully convolutional sub-network to perform a bounding box regression task, and obtain the corresponding true bounding box function according to the following formula: Among them, δ x , δ y , δ a , δ b represent the four-dimensional vectors of the original border P, represents the true border function after regression, α x (.), α y (.) functions respectively represent the translation transformation functions of vectors x and y, and α a (.), α b (.) functions respectively represent the scale scaling functions of vectors a and b.
2. The method for measuring the vegetation coverage rate of a slope surface according to claim 1, wherein The randomly splitting all the preprocessed vegetation sample images into a training set and a test set according to a preset ratio includes: Randomly split all the preprocessed vegetation sample images into a training set and a test set according to a ratio of 7:
3.
3. The method for measuring the vegetation coverage rate of a slope surface according to claim 2, characterized in that, The preprocessing all the collected vegetation sample images includes: Obtain the vegetation boundary pixel points of the vegetation sample images; Highlight or mark the vegetation boundary pixel points on the current vegetation sample image.
4. The method for measuring the vegetation coverage rate of a slope surface according to claim 3, characterized in that, Input the target region of interest after performing the bounding box regression task into the fully convolutional sub-network to perform a multi-classification task, where the multi-classification task includes: Obtain the binary mask prediction probability value of the target region of interest according to the following formula: Among them, γ represents the probability score that the corresponding target region of interest output by the region proposal sub-network has a target object, and its value range is (0, 1); Determine whether the binary mask prediction probability value is greater than a preset prediction probability threshold. If the binary mask prediction probability value is greater than the preset prediction probability threshold, it is determined that the target region of interest contains the target object; Generate a corresponding mask for the target object in the target region of interest after performing the multi-classification task to obtain the image segmentation result.
5. A measuring device for the vegetation coverage rate of a slope surface, which implements the method for measuring the vegetation coverage rate of a slope surface according to any one of claims 1 to 4, characterized in that, Including: A processing unit for preprocessing all the collected vegetation sample images and randomly splitting all the preprocessed vegetation sample images into a training set and a test set according to a preset ratio; A migration unit for constructing a pre-trained model based on the COCO dataset and the slope image semantic segmentation network, and using all the vegetation sample images in the training set to perform model migration on the pre-trained model to obtain a slope vegetation coverage transfer learning model; An evaluation result acquisition unit for inputting all the vegetation sample images in the test set into the slope vegetation coverage transfer learning model to obtain an evaluation result including the relationship between the predicted value and the true value; An evaluation coefficient calculation unit for calculating the evaluation coefficient ε according to the following formula based on all the obtained evaluation results: Among them, represents the set of predicted values output by the transfer learning model for the slope vegetation coverage situation, ω represents the set of true values from the test set, represents the intersection of the predicted value and the true value, represents the union of the predicted value and the true value; An optimization unit for outputting an optimized slope vegetation coverage image segmentation model after the evaluation coefficient meets the preset coefficient threshold; An input unit for inputting the collected target slope image into the slope vegetation coverage image segmentation model to obtain the slope vegetation segmentation result; An output unit for quantitatively characterizing the slope vegetation segmentation result based on pixel points to obtain the slope vegetation coverage rate and output it.
6. The slope surface vegetation coverage rate measuring device according to claim 5, wherein The output unit includes: A target slope region unit for pre-selecting the target slope region in the target slope image based on the measurement region selection instruction; A pixel amount ratio calculation unit for obtaining the pixel amount ratio of the slope vegetation segmentation result in the target slope region according to the following formula: Where Ⅰ represents the number of vegetation segmentation pixel points in the target slope region, Ⅱ represents the number of pixel points corresponding to the entire area of the target slope region, and the ratio R of the two represents the slope vegetation coverage rate.
7. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the slope surface vegetation coverage rate measurement method according to any one of claims 1 to 4.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the processor executes the slope surface vegetation coverage rate measurement method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Wetland vegetation recognition method based on object-oriented deep learning model and transfer learning
CN113837134A