Water body extraction method and device, electronic equipment and storage medium
Through random forest model and parallel computing technology, the water body extraction in remote sensing images is automatically processed, solving the problems of large amount of calculations and relying on manual participation in the prior art, and improving the efficiency and accuracy of water body extraction.
Patent Information
- Application Number
- CN202411217803.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-30
AI Technical Summary
The existing water body extraction algorithm has a large amount of calculation and relies on manual participation, which leads to inefficient efficiency and makes it difficult to automatically process water body extraction tasks in remote sensing images.
The random forest model is used to combine multiple water body indices, and the water body is automatically extracted by training and screening target indexes, and the processing is accelerated using CPU and GPU in parallel calculation.
It improves the efficiency and accuracy of water extraction, realizes automatic processing of remote sensing images, and reduces the need for manual intervention.
Smart Images

Figure CN119091320A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of remote sensing technology, and in particular to a water body extraction method, device, electronic equipment and storage medium. Background Art
[0002] Remote sensing technology has been widely used in the study of water extraction due to its advantages such as wide coverage and rich spectral information.
[0003] In related technologies, deep learning algorithms can be used to extract water bodies in remote sensing images more accurately. However, the computational complexity of deep learning algorithms is usually very large, requiring a large amount of computing resources to support their operation. In addition, the current mainstream water extraction algorithms rely heavily on the user's professional level and require manual participation in the operation of the algorithm, resulting in low water extraction efficiency. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides a water extraction method, device, electronic device and storage medium.
[0005] According to a first aspect of an embodiment of the present disclosure, a water extraction method is provided, comprising:
[0006] Acquisition of remote sensing images;
[0007] Segmenting the remote sensing image to obtain a target sub-image, wherein the target sub-image includes at least a portion of a water body area in the remote sensing image;
[0008] Calculating various water body indexes of the target sub-image respectively to obtain initial feature data;
[0009] Based on the initial feature data and the ground object sample data of the target sub-image, a random forest model is trained; wherein the ground object sample data is used to show the ground object type of each grid in the target sub-image, and the ground object type includes water bodies and non-water bodies, and the random forest model is used to characterize the relationship between the multiple water body indices and the ground object type;
[0010] Determine at least one target index among the multiple water body indices according to the importance scores of the multiple water body indices in the random forest model;
[0011] respectively calculating the at least one target index of the remote sensing image to obtain target feature data;
[0012] The target feature data is input into the trained random forest model to obtain a water body extraction result, and the water body extraction result is used to show the water body area in the remote sensing image.
[0013] In some embodiments, determining at least one target index from the multiple water body indices according to the importance scores of the multiple water body indices in the random forest model comprises:
[0014] Obtaining importance scores of the multiple water body indices, wherein the importance scores are generated during the training process of the random forest model;
[0015] The first N water body indices with the highest importance scores among the multiple water body indices are determined as target indices, where N is a positive integer.
[0016] In some embodiments, the method further comprises:
[0017] According to the correlation coefficient between the at least one target index, the at least one target index is screened so that no two target indexes after the screening have correlation; wherein the target indexes whose correlation coefficients satisfy a preset condition have correlation;
[0018] When the number of types of target indexes after screening is less than N, a new target index is determined again from the multiple water body indices so that the number of types of all target indexes is N and there is no correlation between any two target indices.
[0019] In some embodiments, the method further comprises:
[0020] When the remote sensing image is a remote sensing image collected during a target time period, first thermal radiation data of the remote sensing image is acquired, wherein a resolution of the first thermal radiation data is the same as a resolution of a target index of the remote sensing image;
[0021] The target feature data includes: the at least one target index of the remote sensing image and the first thermal radiation data.
[0022] In some embodiments, the acquiring the first thermal radiation data of the remote sensing image includes:
[0023] Among the multiple water body indices, the first M water body indices with the highest importance scores except the target index are determined as the first thermal inversion index, where M is a positive integer;
[0024] The first thermal inversion index of the remote sensing image is input into a pre-trained neural network model to obtain the first thermal radiation data.
[0025] In some embodiments, the training process of the neural network model includes:
[0026] Acquire second thermal radiation data of the remote sensing image, wherein the resolution of the second thermal radiation data is lower than that of the first thermal radiation data;
[0027] Resampling the first thermal inversion index of the remote sensing image to obtain a second thermal inversion index, wherein a resolution of the second thermal inversion index is the same as a resolution of the second thermal radiation data;
[0028] Based on the second thermal inversion index and the second thermal radiation data, the neural network model is trained, wherein the trained neural network model is used to characterize the mapping relationship between the thermal inversion index and the thermal radiation data of the same resolution.
[0029] In some embodiments, the random forest model includes a plurality of decision trees, the plurality of decision trees are run in parallel, and the running data of each decision tree in the plurality of decision trees is stored in a CPU cache and / or a storage unit of a graphics processor GPU;
[0030] The operation data includes at least one of the following:
[0031] Band information of the remote sensing image;
[0032] Parameters of each decision tree in the plurality of decision trees;
[0033] Importance scores of the various water body indices;
[0034] The initial feature data; and
[0035] The target characteristic data.
[0036] According to a second aspect of an embodiment of the present disclosure, there is provided a water extraction device, comprising:
[0037] An acquisition module, used for acquiring remote sensing images;
[0038] A segmentation module, used for segmenting the remote sensing image to obtain a target sub-image, wherein the target sub-image includes at least a part of the water area in the remote sensing image;
[0039] A first calculation module is used to calculate a plurality of water body indexes of the target sub-image respectively to obtain initial feature data;
[0040] A training module, used for training a random forest model based on the initial feature data and the ground object sample data of the target sub-image; wherein the ground object sample data is used to show the ground object type of each grid in the target sub-image, the ground object type includes water body and non-water body, and the random forest model is used to characterize the relationship between the multiple water body indexes and the ground object type;
[0041] A determination module, configured to determine at least one target index among the multiple water body indices according to importance scores of the multiple water body indices in the random forest model;
[0042] A second calculation module is used to calculate the at least one target index of the remote sensing image to obtain target feature data;
[0043] The extraction module is used to input the target feature data into the trained random forest model to obtain a water body extraction result, and the water body extraction result is used to show the water body area in the remote sensing image.
[0044] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0045] Processor; and
[0046] A memory, configured to store executable instructions of the processor;
[0047] The processor is configured to execute the method described in the first aspect by executing the executable instructions.
[0048] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in the first aspect is implemented.
[0049] The disclosed embodiment can acquire a remote sensing image and segment the remote sensing image to obtain a target sub-image, wherein the target sub-image includes at least part of the water body area in the remote sensing image. The initial feature data can be obtained by calculating the various water body indexes of the target sub-image respectively. The random forest model is trained based on the initial feature data and the ground object sample data of the target sub-image. According to the importance scores of the various water body indexes in the random forest model, at least one target index is determined among the various water body indexes. The target feature data can be obtained by calculating at least one target index of the remote sensing image respectively. The target feature data is input into the trained random forest model to obtain the water body extraction result. Therefore, the scheme provided by the disclosed embodiment can improve the efficiency of water body extraction, and at the same time, no manual intervention is required during the water body extraction process, and the water body extraction task for remote sensing images can be automatically completed. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A schematic flow chart of a water extraction method in an embodiment of the present disclosure is shown.
[0051] Figure 2 A schematic diagram of ground feature sample data of a target sub-area in an embodiment of the present disclosure is shown.
[0052] Figure 3A schematic diagram showing a water body extraction result of a target sub-region in an embodiment of the present disclosure is shown.
[0053] Figure 4 A comparison chart of operating efficiency when accelerated and not accelerated using a CPU and a GPU in an embodiment of the present disclosure is shown.
[0054] Figure 5 A schematic structural diagram of a water extraction device according to an embodiment of the present disclosure is shown.
[0055] Figure 6 A schematic structural diagram of an electronic device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0056] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0057] First, an embodiment of the present disclosure provides a water body extraction method, which can be executed by any electronic device.
[0058] Figure 1 A schematic diagram of a water extraction method according to an embodiment of the present disclosure is shown. Figure 1 As shown, the water extraction method provided in the embodiment of the present disclosure includes the following steps S101 to S107.
[0059] S101, acquiring remote sensing images.
[0060] It should be noted that remote sensing images can be collected by satellites, such as the Gaofen-1 (GF-1) satellite, the Ziyuan-3 (ZY-3) satellite, and the Sentinel-2 satellite.
[0061] Exemplarily, the remote sensing image may be a remote sensing image spliced from multi-source remote sensing data, that is, it may include spectral information of different bands collected by multiple satellites.
[0062] S102, segmenting the remote sensing image to obtain a target sub-image.
[0063] It should be noted that the target sub-image is a partial sub-image segmented from a complete remote sensing image, and the size of the target sub-image can be much smaller than the size of the remote sensing image. For example, when the size of the complete remote sensing image is 300km×300km, the size of the target sub-image can be 2km×2km.
[0064] For example, the disclosed embodiment can use the target sub-image to complete the training of the random forest model. Since the target sub-image is taken from the remote sensing image, the trained random forest model can more accurately extract water bodies from the area shown in the remote sensing image.
[0065] Exemplarily, in order to enable the random forest model to learn the water body characteristics of the area shown in the remote sensing image, the target sub-image may include at least part of the water body area in the remote sensing image.
[0066] S103, calculating various water body indexes of the target sub-image respectively to obtain initial feature data.
[0067] It should be noted that the index in remote sensing images is a type of numerical value calculated through the spectral information of different bands in the remote sensing data, which can be used to distinguish different types of land objects.
[0068] In some embodiments, the embodiments of the present disclosure pre-maintain a river surface information extraction index library (River-based Multiscale Singularity Index, RMSI) with a multi-scale singularity index. RMSI includes a variety of indexes related to water body extraction, for example, Normalized Difference Vegetation Index (NDVI), Enhanced Vegetation Index (EVI) and other different indexes. The multiple water body indices in the embodiments of the present disclosure are various indices related to water body extraction included in RMSI.
[0069] For example, the Normalized Difference Vegetation Index Among them, NIR is the spectral information of the near infrared band, and Red is the spectral information of the red light band. These spectral information can be obtained from remote sensing images. By calculating the NDVI index of each grid in the remote sensing image, the type of ground object corresponding to the grid can be determined by setting a threshold.
[0070] In addition, it is worth noting that the various water body indices in the embodiments of the present disclosure include remote sensing indices of various types (e.g., vegetation, buildings, bare soil, etc.), rather than just remote sensing indices used to refer to water body types. In other words, RMSI maintains remote sensing indices of various types related to water body extraction.
[0071] Exemplarily, the initial feature data may be a set of multiple water body indices of the target sub-image, and the resolution of each water body index in the set is the same. The resolution of the index may be understood as the accuracy of the index, or as the accuracy of the corresponding remote sensing image, for example, the resolution of the index may be 2m.
[0072] S104, training a random forest model based on the initial feature data and the ground object sample data of the target sub-image.
[0073] In some embodiments, the feature sample data is used to show the feature type of each grid in the target sub-image. During the training process of the random forest model, the feature sample data can be recorded in a table in xls format, that is, the corresponding relationship between each grid number (or coordinate) and the feature type number is recorded respectively. Among them, the feature types include water bodies and non-water bodies, and non-water bodies can be types such as farmland, buildings, mountains, and bare land.
[0074] For example, Figure 2 A schematic diagram of ground feature sample data of a target sub-area in an embodiment of the present disclosure is shown. Figure 2 In the figure, different types of features in the target sub-area are shown in different colors. Specifically, pink is used to show bare land type feature samples, purple is used to show building type feature samples, yellow is used to show farmland type feature samples, green is used to show mountain type feature samples, and blue is used to show river (water body) type feature samples.
[0075] The ground object sample data can be manually annotated or identified by a ground object recognition algorithm in the related art. It is understandable that, due to the small size of the target sub-image, even if the ground object recognition algorithm is used to completely identify the ground objects involved in the target sub-image, it can be quickly completed by calling a small amount of computing resources.
[0076] It should be noted that the random forest model is a bootstrap aggregating model composed of multiple decision trees. The random forest model can effectively handle problems with a large number of features (i.e., multiple water body indices in the present disclosure) and data, and does not require feature selection.
[0077] In the disclosed embodiment, by inputting the initial feature data and the ground object sample data into the random forest model, the random forest model can learn the relationship between multiple water body indices and ground object types. In other words, the trained random forest model can be used to characterize the relationship between multiple water body indices and ground object types.
[0078] For example, when the remote sensing image is segmented in S102, the ground object type contained in the segmented target sub-image can be the same as the ground object type contained in the remote sensing image. The ground object type includes water bodies and non-water bodies, and the non-water body can be farmland, buildings, mountains, bare land, etc.
[0079] In this way, the random forest model can not only learn the relationship between multiple water body indices and water bodies, but also learn the relationship between multiple water body indices and various non-water body objects in remote sensing images.
[0080] That is to say, when the trained random forest model is used to identify water bodies in complete remote sensing images, it can also identify various types of non-water objects in them, avoiding the random forest model from confusing non-water objects with water bodies. To a certain extent, it can improve the accuracy of water body identification and reduce the noise in the water body identification results.
[0081] S105, determining at least one target index from the multiple water body indices according to the importance scores of the multiple water body indices in the random forest model.
[0082] In some embodiments, the Gini index of the feature (water body index) can be used as the importance score of the feature in the random forest model. The larger the value of the Gini index, the greater the importance of the feature.
[0083] For example, the Gini index can be obtained during the training process of the random forest. During the training process of the random forest model, a portion of features is randomly considered each time a node is split. For each feature in the portion of features, the random forest model can obtain the Gini index of the feature by measuring the contribution of the feature to the node splitting.
[0084] Exemplarily, the average impurity reduction, out-of-bag error reduction, and other data of each feature (water body index) in the random forest model can also be used as the importance score of the feature. Since the method of scoring feature importance in the random forest model is common knowledge to those skilled in the art, for the sake of brevity, this embodiment of the present disclosure will not be described in detail.
[0085] In some embodiments, a water body index with a higher importance score may be screened out from a plurality of water body indexes according to the importance score of each water body index, and the water body index may be determined as the target index.
[0086] Exemplarily, the importance scores of multiple water body indices may be obtained, and the top N water body indices with the highest importance scores among the multiple water body indices may be determined as the target indices, where N is a positive integer. The importance scores are generated during the training process of the random forest model.
[0087] For example, the number of target indexes (i.e., N) can be preset based on experience, or the importance scores of multiple water body indexes can be sorted, and the number of water body indexes before the importance score in the sequence mutates is used as the number of target indexes. For example, assuming that there are 50 water body indexes in total, the 50 water body indexes are sorted from high to low according to the importance score. If the importance score of the water body index mutates between the 10th water body index and the 11th water body index, the number of target indexes is 10.
[0088] The disclosed embodiment can quickly complete the training of the random forest model and determine the target index through a small-sized target sub-image. By applying the trained random forest model to the complete remote sensing image and using the target index of the remote sensing image as the input of the random forest model, the efficiency of water body recognition can be improved while ensuring the accuracy of water body recognition.
[0089] S106, respectively calculating at least one target index of the remote sensing image to obtain target feature data.
[0090] It should be noted that at least one target index of the remote sensing image is the target index determined in S105. For example, if the top 10 water body indices with the highest importance are determined as target indices in S105, the 10 water body indices of the remote sensing image can be calculated respectively to obtain target feature data.
[0091] S107, inputting the target feature data into the trained random forest model to obtain a water body extraction result.
[0092] It should be noted that the water body extraction result can be used to show the water body area in the remote sensing image.
[0093] Exemplarily, the random forest model can output the land feature type of each grid in the remote sensing image, and the water body extraction result can be obtained by mapping the land feature type of each grid to the corresponding grid in the remote sensing image.
[0094] Exemplarily, different types of objects can be distinguished by different colors. By filling each grid in the remote sensing image with the color of the corresponding object type (for example, filling the grid identified as a water body with blue), a visualized water body extraction result can be obtained.
[0095] Thus, the water body extraction method provided by the embodiment of the present disclosure can effectively improve the efficiency of water body extraction by pre-training the random forest model and determining the target index using a small-size target sub-image, and then generalizing the trained random forest model and the determined target index to the complete remote sensing image for water body extraction. At the same time, no manual intervention is required during the water body extraction process, and the water body extraction task for remote sensing images can be automatically completed.
[0096] In some embodiments, post-processing may be performed on the visualized water body extraction results to improve the quality of the water body extraction results.
[0097] Exemplarily, the post-processing process may include two parts: denoising and morphology correction.
[0098] Among them, for denoising, the river network buffer data of the area shown in the remote sensing image can be used to mark the river boundary in the water body extraction result, and the grid identified as water body outside the river boundary can be corrected to non-water body. Subsequently, the denoising algorithm in the relevant technology can be used to remove the random noise of the water body extraction result within the river boundary.
[0099] As for morphological correction, edge detection algorithms such as Canny can be used to accurately locate river boundaries, and based on the morphological characteristics of the river, the truncated areas in the extraction results can be corrected (for example, the river shown in the remote sensing image may be truncated due to bridge / road occlusion), thereby further improving the accuracy of the extraction results.
[0100] The above introduces the specific implementation process of the water body extraction method provided by the embodiment of the present disclosure. In some embodiments, in the process of determining the above-mentioned target index, in addition to considering the importance score of the water body index, the correlation between the water body indexes can also be combined to make any two determined target indexes have no correlation, thereby reducing the risk of overfitting of the random forest model to a certain extent and improving the accuracy of the water body extraction results of the random forest model for remote sensing images.
[0101] Exemplarily, at least one target index may be screened according to the correlation coefficient between at least one target index determined in S105, so that no correlation exists between any two target indexes after the screening. The correlation coefficient between any two target indexes may be obtained by calculating the R-square between the two target indexes, or by calculating the Pearson correlation coefficient or the Spearman correlation coefficient between the two target indexes, which is not limited in the embodiments of the present disclosure.
[0102] Exemplarily, the target indices whose correlation coefficients satisfy a preset condition are correlated. Taking R-square as an example, a correlation threshold can be set, and when the R-square between two target indices is greater than the correlation threshold, it is determined that the two target indices are correlated.
[0103] For example, if the correlation coefficient between the first target index and the second target index of the target sub-image obtained by calculation is greater than a preset correlation threshold, the first target index or the second target index can be re-determined as a non-target index to ensure that there is no correlation between the water body indices determined as target indices.
[0104] Based on this, at least one target index determined in S105 can be screened. When the number of target indexes after screening is less than N, a new target index can be determined again from the multiple water body indices so that the number of all target indexes is still N and there is no correlation between any two target indices.
[0105] Wherein, N is the number of target indexes initially determined in S105. That is, if some target indexes are re-determined as non-target indexes in the process of screening the target indexes by using the correlation, new target indexes can be re-determined from the multiple water body indexes so that the total number of target indexes remains unchanged. When determining the new target index, in addition to considering the importance of the water body index, the correlation between the water body indexes also needs to be considered.
[0106] For example, when the target index is re-determined, the water body index with a higher importance score (for example, the importance score is greater than the threshold / the importance score ranking is within the specified ranking range) and has no correlation with any target index can still be preferred as the target index according to the importance of the water body index. The top K water body indices with the highest importance among the water body indices that have no correlation with any target index can also be directly determined as the target index.
[0107] In some embodiments, in addition to the importance scores of the indices and the correlation between the indices, the type of the index (e.g., vegetation, building, bare soil, water body, etc.) may also be considered when determining the target index to avoid too many indices of the same type in the target index. For example, the proportion of each type of index in the target index may be preconfigured to ensure that the target index contains multiple types of indices.
[0108] By incorporating the relevance of the target index and the type of index into consideration during the process of determining the target index, the final target index can reflect the characteristics of the water body from different angles, thereby improving the accuracy of the water body extraction results.
[0109] In some embodiments, after the target index is determined, the target index of the target sub-image can be input into the trained random forest model to verify the accuracy of water body extraction based on the target index in the small area shown in the target sub-image in advance. When the accuracy is greater than the preset accuracy threshold, the target index of the remote sensing image is input into the random forest model to obtain the water body extraction result of the complete remote sensing image.
[0110] For example, Figure 3 FIG. 1 is a schematic diagram showing a water body extraction result of a target sub-region in an embodiment of the present disclosure. Figure 3 In the figure, the blue area is the water extraction result obtained after the target index of the target sub-image is input into the random forest model. Figure 3 The water extraction results shown are similar to Figure 2 The consistency of the water body areas marked in the figure can verify the accuracy of the recognition results.
[0111] In some application scenarios, remote sensing images may have low clarity. For example, in the summer or dry season, due to the influence of cloudy weather or climate, the remote sensing images may not accurately reflect the characteristics of water bodies, which will lead to low accuracy of water body extraction results.
[0112] Since the temperature of water areas is usually quite different from that of surrounding areas, thermal radiation data of the area shown in remote sensing images can also be combined in the process of water body identification to solve the problem of low recognition accuracy in a specific period. That is, when it is impossible to clearly distinguish water areas from non-water areas visually, thermal radiation data can be introduced to assist in the identification of water areas by using the angle of temperature difference between water areas and non-water areas.
[0113] Exemplarily, when the remote sensing image is a remote sensing image collected during the target time period, the first thermal radiation data of the remote sensing image (the area shown) can be obtained. The resolution of the first thermal radiation data is the same as the resolution of the target index of the remote sensing image. At this time, the target feature data includes: at least one target index of the remote sensing image and the first thermal radiation data.
[0114] That is to say, the first thermal radiation data of the remote sensing image can be combined with the target index of the remote sensing image and input into a pre-trained random forest model to obtain a water body extraction result.
[0115] Since the resolution of thermal radiation data collected directly by satellites is usually lower than that of remote sensing images, it is necessary to downscale the thermal radiation data collected by satellites to make it have the same resolution as the target index of remote sensing images, so that it can be combined with the target index of remote sensing images to be input into the random forest model.
[0116] Exemplarily, the first thermal radiation data of the remote sensing image can be obtained by the following method:
[0117] Among the multiple water body indices, the first M water body indices with the highest importance scores except the target index are determined as the first thermal inversion index, where M is a positive integer, and its value can be set according to experience.
[0118] The first thermal inversion index of the remote sensing image is input into a pre-trained neural network model to obtain the first thermal radiation data.
[0119] Exemplarily, the neural network model may be an artificial neural network (ANN) model, such as a back propagation artificial neural network (BP-ANN) model.
[0120] In some embodiments, the training process of the neural network model may include:
[0121] Acquire second thermal radiation data of the remote sensing image, wherein the second thermal radiation data is thermal radiation data directly collected by a satellite (for example, TIRS band data of the Landsat 8 satellite), and the resolution of the second thermal radiation data is lower than that of the first thermal radiation data.
[0122] The first thermal inversion index of the remote sensing image is resampled to obtain a second thermal inversion index. The resampling method can be implemented using data processing software such as ArcGIS and ENVI, which is not described in detail in the disclosed embodiment. The resolution of the resampled second thermal inversion index is the same as the resolution of the second thermal radiation data.
[0123] Based on the second thermal inversion index and the second thermal radiation data, a neural network model can be trained. The trained neural network model is used to characterize the mapping relationship between the thermal inversion index and the thermal radiation data of the same resolution. That is, the neural network model in the embodiment of the present disclosure can map the first thermal inversion index to the first thermal radiation data by learning the mapping relationship between the second thermal inversion index and the second thermal radiation data, and according to the learned mapping relationship.
[0124] For example, during the training of the neural network model, the second thermal inversion index can be input into the neural network model to be trained to obtain predicted thermal radiation data. The training of the neural network model can be completed by calculating the loss between the predicted thermal radiation data and the second thermal radiation data and updating the parameters of the neurons through the back propagation algorithm.
[0125] Exemplarily, the neural network model in the embodiment of the present disclosure is a single-layer neural network model. Therefore, after determining the first thermal inversion index among multiple water body indices, the training process of the neural network model can be completed quickly so as to obtain the first thermal radiation data of the remote sensing image based on the neural network model.
[0126] The disclosed embodiment combines thermal radiation data with a target index and uses them together for water body extraction, thereby improving the accuracy of water body extraction during special periods (summer flood season and dry season).
[0127] In some embodiments, the random forest model includes multiple decision trees. In order to improve the training speed and computational efficiency of the random forest model in the present disclosure, the multiple decision trees in the random forest model can be run in parallel.
[0128] In addition, among multiple decision trees running in parallel, the running data of each decision tree can be stored in the cache of the central processing unit (CPU) or in the storage unit of the graphics processing unit (GPU). Of course, according to actual needs, part of the data can be stored in the CPU cache and part of the data can be stored in the storage unit of the GPU.
[0129] Exemplarily, the operating data may include: band information of a remote sensing image, parameters of each decision tree in a plurality of decision trees, importance scores of a plurality of water body indexes, initial feature data, and at least one of target feature data.
[0130] Therefore, during the operation of the random forest model, the parallel computing capabilities of the CPU and GPU can be fully utilized to improve the computational efficiency of the random forest model.
[0131] Exemplarily, when using the CPU to accelerate the computational efficiency of the random forest model, the running data can be stored in batches in the multi-core CPU cache, and the computational efficiency of the random forest model can be improved through multi-threaded parallel processing of the CPU.
[0132] Exemplarily, when using the CPU to accelerate the computational efficiency of the random forest model, the running data can be stored in batches in the multi-core CPU cache, and the computational efficiency of the random forest model can be improved through multi-threaded parallel processing of the CPU.
[0133] For example, the advantages of the CPU and GPU can be combined to select the optimal parallel processing method at different computing stages. For example, the CPU cache capacity is small, but the read and write speed is extremely fast, while the GPU storage unit capacity is large, but the read and write speed is not as fast as the CPU cache. Therefore, the CPU cache can be used first when the amount of data is small (for example, for the calculation of initial feature data), and the GPU storage unit can be used when the amount of data is large (for example, for the training of random forest models).
[0134] In addition, based on the use of CPU and GPU to accelerate the calculation of random forest models, the parameters of random forest models can be adjusted through preliminary experiments to further improve the operation efficiency, such as the number of decision trees in the random forest model, the depth of the decision tree, and the minimum number of split samples for nodes in the decision tree.
[0135] For example, a series of control experiments can be designed to evaluate the effects of different parameter combinations on the performance of water extraction, thereby determining the optimal parameter settings. In the process of parameter adjustment, it is necessary to pay attention to the balance between the accuracy and execution efficiency of the random forest model. By reasonably adjusting the parameters, the random forest model can take into account both the accuracy and execution efficiency of water extraction.
[0136] For example, Figure 4 The following is a comparison of the operating efficiency when the CPU and GPU are accelerated and not accelerated in the embodiment of the present disclosure. Figure 4 As shown in the figure, the more decision trees there are in the random forest model, the more obvious the acceleration effect is when the CPU cache and GPU storage units participate in the calculation.
[0137] Therefore, the embodiments of the present disclosure can effectively improve the operating efficiency of the random forest model by storing the operating data of the random forest model in the CPU cache and / or the storage unit of the GPU.
[0138] Based on the same inventive concept, the present disclosure also provides a water extraction device in the following embodiments. Figure 1 The method embodiment shown is similar, so the implementation of the water extraction device embodiment can refer to the above Figure 1 The implementation of the illustrated method embodiment will not be described in detail in detail.
[0139] Figure 5 A schematic diagram of the structure of a water extraction device in an embodiment of the present disclosure is shown. The water extraction device can be applied to an electronic device, and the electronic device includes multiple computing units.
[0140] Specifically, Figure 5 As shown, the water body extraction device 500 includes: an acquisition module 501, a segmentation module 502, a first calculation module 503, a training module 504, a determination module 505, a second calculation module 506 and an extraction module 507.
[0141] The acquisition module 501 is used to acquire remote sensing images.
[0142] The segmentation module 502 is used to segment the remote sensing image to obtain a target sub-image, where the target sub-image includes at least a portion of the water area in the remote sensing image.
[0143] The first calculation module 503 is used to calculate various water body indexes of the target sub-image respectively to obtain initial feature data.
[0144] The training module 504 is used to train the random forest model based on the initial feature data and the ground object sample data of the target sub-image. The ground object sample data is used to show the ground object type of each grid in the target sub-image, and the ground object type includes water body and non-water body. The random forest model is used to characterize the relationship between multiple water body indexes and ground object types.
[0145] The determination module 505 is used to determine at least one target index from the multiple water body indices according to the importance scores of the multiple water body indices in the random forest model.
[0146] The second calculation module 506 is used to calculate at least one target index of the remote sensing image to obtain target feature data.
[0147] The extraction module 507 is used to input the target feature data into the trained random forest model to obtain a water body extraction result, and the water body extraction result is used to show the water body area in the remote sensing image.
[0148] In some embodiments, the determination module 505 is specifically used to obtain importance scores of multiple water body indices, where the importance scores are generated during the training process of the random forest model. The top N water body indices with the highest importance scores among the multiple water body indices are determined as target indices, where N is a positive integer.
[0149] In some embodiments, the determination module 505 is further used to screen at least one target index according to the correlation coefficient between at least one target index, so that there is no correlation between any two target indexes after screening; wherein, the target indexes whose correlation coefficients meet the preset conditions are correlated. When the types of target indexes after screening are less than N, a new target index is determined again from the multiple water body indexes so that the types of all target indexes are N, and there is no correlation between any two target indexes.
[0150] In some embodiments, the water body extraction device 500 further includes: a processing module (not shown in the figure), which is used to obtain the first thermal radiation data of the remote sensing image when the remote sensing image is a remote sensing image collected in the target time period, and the resolution of the first thermal radiation data is the same as the resolution of the target index of the remote sensing image. At this time, the target feature data includes: at least one target index of the remote sensing image and the first thermal radiation data.
[0151] In some embodiments, the processing module is also used to determine the top M water body indices with the highest importance scores except the target index among multiple water body indices as the first thermal inversion index, where M is a positive integer; and input the first thermal inversion index of the remote sensing image into a pre-trained neural network model to obtain first thermal radiation data.
[0152] In some embodiments, the water body extraction device 500 further includes: a neural network module (not shown in the figure), which is used to obtain second thermal radiation data of the remote sensing image, and the resolution of the second thermal radiation data is lower than that of the first thermal radiation data. The first thermal inversion index of the remote sensing image is resampled to obtain a second thermal inversion index, and the resolution of the second thermal inversion index is the same as the resolution of the second thermal radiation data. Based on the second thermal inversion index and the second thermal radiation data, a neural network model is trained, wherein the trained neural network model is used to characterize the mapping relationship between the thermal inversion index and the thermal radiation data of the same resolution.
[0153] In some embodiments, the random forest model includes multiple decision trees, the multiple decision trees run in parallel, and the running data of each decision tree in the multiple decision trees is stored in the central processing unit CPU cache and / or the storage unit of the graphics processing unit GPU.
[0154] The operation data includes at least one of the following:
[0155] Band information of remote sensing images;
[0156] The parameters of each decision tree in multiple decision trees;
[0157] Importance scores for various water body indices;
[0158] Initial feature data; and
[0159] Target feature data.
[0160] Refer to the following Figure 6 hereinafter, an electronic device 600 capable of implementing the embodiments of the present disclosure is described. Figure 6 The electronic device 600 shown is only an example and should not bring any limitation to the functions and applicable scope of the embodiments of the present disclosure.
[0161] like Figure 6 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include but are not limited to: at least one processor 610, at least one memory 620, and a bus 630 connecting different system components (including the memory 620 and the processor 610).
[0162] The memory stores program codes, which can be executed by the processor 610, so that the processor 610 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of the present disclosure.
[0163] In some embodiments, the processor 610 may further perform the following steps of the above method embodiment:
[0164] Acquisition of remote sensing images;
[0165] Segmenting the remote sensing image to obtain a target sub-image, wherein the target sub-image includes at least a portion of the water body area in the remote sensing image;
[0166] Calculate various water body indexes of the target sub-image respectively to obtain initial feature data;
[0167] Based on the initial feature data and the ground object sample data of the target sub-image, a random forest model is trained; wherein the ground object sample data is used to show the ground object type of each grid in the target sub-image, and the ground object type includes water body and non-water body, and the random forest model is used to characterize the relationship between multiple water body indexes and ground object types;
[0168] According to the importance scores of the multiple water body indices in the random forest model, at least one target index is determined from the multiple water body indices;
[0169] respectively calculating at least one target index of the remote sensing image to obtain target feature data;
[0170] The target feature data is input into the trained random forest model to obtain the water body extraction result, which is used to show the water body area in the remote sensing image.
[0171] The memory 620 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 6201 and / or a cache memory 6202 , and may further include a read-only memory (ROM) 6203 .
[0172] The memory 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0173] Bus 630 may be a bus representing one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.
[0174] The electronic device 600 may also communicate with one or more external devices 640 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 600, and / or any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 660. Figure 6 As shown, the network adapter 660 communicates with other modules of the electronic device 600 via the bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0175] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0176] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the above-mentioned method of the present disclosure is stored thereon. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above-mentioned "Exemplary Method" section of the present disclosure.
[0177] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A water extraction method, characterized in that: include: Acquisition of remote sensing images; Segmenting the remote sensing image to obtain a target sub-image, wherein the target sub-image includes at least a portion of a water body area in the remote sensing image; Calculating various water body indexes of the target sub-image respectively to obtain initial feature data; Based on the initial feature data and the ground object sample data of the target sub-image, a random forest model is trained; wherein the ground object sample data is used to show the ground object type of each grid in the target sub-image, and the ground object type includes water bodies and non-water bodies, and the random forest model is used to characterize the relationship between the multiple water body indices and the ground object type; Determining at least one target index among the multiple water body indices according to the importance scores of the multiple water body indices in the random forest model; respectively calculating the at least one target index of the remote sensing image to obtain target feature data; The target feature data is input into the trained random forest model to obtain a water body extraction result, and the water body extraction result is used to show the water body area in the remote sensing image.
2. The method according to claim 1, characterized in that: Determining at least one target index from the multiple water body indices according to the importance scores of the multiple water body indices in the random forest model comprises: Obtaining importance scores of the multiple water body indices, wherein the importance scores are generated during the training process of the random forest model; The first N water body indices with the highest importance scores among the multiple water body indices are determined as target indices, where N is a positive integer.
3. The method according to claim 2, characterized in that The method further comprises: According to the correlation coefficient between the at least one target index, the at least one target index is screened so that no two target indexes after the screening have correlation; wherein the target indexes whose correlation coefficients satisfy a preset condition have correlation; When the number of types of target indexes after screening is less than N, a new target index is determined again from the multiple water body indices so that the number of types of all target indexes is N and there is no correlation between any two target indices.
4. The method according to claim 1, characterized in that: The method further comprises: When the remote sensing image is a remote sensing image collected during a target time period, first thermal radiation data of the remote sensing image is acquired, wherein a resolution of the first thermal radiation data is the same as a resolution of a target index of the remote sensing image; The target feature data includes: the at least one target index of the remote sensing image and the first thermal radiation data.
5. The method according to claim 4, characterized in that The step of acquiring first thermal radiation data of the remote sensing image comprises: Among the multiple water body indices, the first M water body indices with the highest importance scores except the target index are determined as the first thermal inversion index, where M is a positive integer; The first thermal inversion index of the remote sensing image is input into a pre-trained neural network model to obtain the first thermal radiation data.
6. The method according to claim 5, characterized in that The training process of the neural network model includes: Acquire second thermal radiation data of the remote sensing image, wherein the resolution of the second thermal radiation data is lower than that of the first thermal radiation data; Resampling the first thermal inversion index of the remote sensing image to obtain a second thermal inversion index, wherein a resolution of the second thermal inversion index is the same as a resolution of the second thermal radiation data; Based on the second thermal inversion index and the second thermal radiation data, the neural network model is trained, wherein the trained neural network model is used to characterize the mapping relationship between the thermal inversion index and the thermal radiation data of the same resolution.
7. The method according to claim 1, characterized in that The random forest model includes a plurality of decision trees, the plurality of decision trees are run in parallel, and the running data of each decision tree in the plurality of decision trees is stored in a central processing unit CPU cache and / or a storage unit of a graphics processing unit GPU; The operation data includes at least one of the following: Band information of the remote sensing image; Parameters of each decision tree in the plurality of decision trees; Importance scores of the various water body indices; The initial feature data; and The target characteristic data.
8. A water extraction device, characterized in that: include: An acquisition module, used for acquiring remote sensing images; A segmentation module, used for segmenting the remote sensing image to obtain a target sub-image, wherein the target sub-image includes at least a part of the water area in the remote sensing image; A first calculation module is used to calculate a plurality of water body indexes of the target sub-image respectively to obtain initial feature data; A training module, used for training a random forest model based on the initial feature data and the ground object sample data of the target sub-image; wherein the ground object sample data is used to show the ground object type of each grid in the target sub-image, the ground object type includes water body and non-water body, and the random forest model is used to characterize the relationship between the multiple water body indexes and the ground object type; A determination module, configured to determine at least one target index among the multiple water body indices according to importance scores of the multiple water body indices in the random forest model; A second calculation module is used to calculate the at least one target index of the remote sensing image to obtain target feature data; The extraction module is used to input the target feature data into the trained random forest model to obtain a water body extraction result, and the water body extraction result is used to show the water body area in the remote sensing image.
9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Remote sensing image information extraction method and device based on random forest and storage medium
CN112232171A
Cultivated land remote sensing image analysis method and device, equipment, storage medium and product
CN115861790A
Method and system of extraction of impervious surface of remote sensing image
US20200026953A1
Method for processing image, device and storage medium
US20220319141A1
Urban extent extraction method and apparatus based on random forest classification algorithm, and electronic device
WO2020063461A1
Cited By
Water body identification method and device
CN119888513A
A water body identification method and device
CN119888513B
