Intelligent clustering and machine learning intelligent remote sensing classification method and system thereof
By employing intelligent clustering and machine learning methods, the problems of unusable partitioning results and low computational efficiency in remote sensing classification are solved, achieving high-precision and interpretable partitioning results that are applicable to remote sensing classification and GIS operations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SICHUAN PROVINCIAL INST OF LAND SCI & TECH (SICHUAN PROVINCIAL SATELLITE APPL TECH CENT)
- Filing Date
- 2026-06-10
- Publication Date
- 2026-07-10
Smart Images

Figure CN122368660A_ABST
Abstract
Description
Technical Field
[0001] This invention provides an intelligent clustering and machine learning-based intelligent remote sensing classification method and system, belonging to the field of remote sensing technology. Background Technology
[0002] In recent years, high-resolution multispectral / multitemporal remote sensing data has grown rapidly. Traditional pixel-based classification methods (such as random forests, SVMs, and shallow feature learning) generally assume that samples are independent and identically distributed, making it difficult to fully utilize spatial autocorrelation and contextual information. In real-world scenarios, the spectral differences between ground features exhibit significant spatial non-stationarity due to the influence of topography, season, imaging conditions, and human activities. This leads to significant differences in the spectral distribution of similar ground features in different regions, mixing of dissimilar features at boundaries, and small patch phenomena such as "salt and pepper noise," reducing the robustness and generalizability of the model.
[0003] To alleviate the above problems, common approaches in research and engineering practice include: introducing spatial context using deep convolutional networks (but with high annotation and transfer costs); using superpixel / segmentation first, supplemented by MRF / CRF post-processing (noise reduction but decoupling from the learning process); and using geographic weighting or regionalized modeling (e.g., by grid / slice / administrative region) to mitigate non-stationarity (but the regions are mostly fixed in the prior). These methods either rely on a large number of annotations or lack a unified goal between "regional partitioning - model training - spatial constraints." The partitioning is neither adaptively optimized for class purity nor can it simultaneously guarantee connectivity and minimum size constraints. The resulting partition surfaces are often fragmented or overlapping, making them difficult to use directly in GIS operations. At the same time, remote sensing samples generally suffer from class imbalance and small tail classes, and the use of neighborhood information and cross-regional supplementation is insufficient. Hyperparameter selection often relies on experience, making it difficult to quantitatively assess the quality of regional models. If the entire image is written back during the inference stage, seams and artifacts are easily generated at the partition boundaries. Overall, there is an urgent need for a process that integrates "spatial adaptive clustering (aiming at minimizing heterogeneity) - geometric surface construction (non-overlapping and usable) - regionalized machine learning (including supplementation and parameter tuning) - in-mask write-back and quality control" into a unified process, and uses interpretable indicators (such as entropy, connectivity, and accuracy thresholds) for closed-loop evaluation and control to improve the accuracy and engineering usability of remote sensing classification at the regional scale.
[0004] Existing technologies primarily employ geographic weighted / geographic random forest partitioning modeling schemes. To address the spatial heterogeneity in remote sensing and geographic data, academia and engineering practice widely utilize "local sub-model" methods such as Geographic Random Forest (GRF) and Geographic Weighted Random Forest (GWRF). At each geographic location, neighborhood samples are selected using kernel functions and bandwidth to fit a local random forest (RF), forming a spatialized prediction map across the entire domain composed of numerous local models. This approach has been proven effective in remote sensing classification and population and disaster susceptibility assessment by reducing residual autocorrelation and improving accuracy and interpretability. However, this technology suffers from the following technical problems:
[0005] (1) Geometric partitioning cannot be directly applied in engineering. Existing methods mostly remain at the level of continuous predicted values or raster levels, lacking explicit partitioning results that meet the needs of GIS engineering. The partition shapes are often scattered, overlapping, or broken, lacking both good topological connectivity and minimum size constraints, and cannot directly support subsequent spatial management, mapping, and rule weighting tasks. This structural deficiency results in a significant gap between the model output and the actual engineering implementation.
[0006] (2) Insufficient spatial consistency and class balance; due to abrupt changes in local model parameters at the partition boundaries, phenomena such as prediction discontinuity and seam artifacts are prone to occur, which undermine the consistency and smoothness within the region. At the same time, there is a lack of cross-region supplementation or weight balancing mechanisms for small categories with scarce samples, resulting in low tail class recognition rate and high false negative and false positive rates, and the overall model is not robust enough under conditions of unbalanced class distribution. This directly affects the generalization performance of the partition model under complex spatial distribution conditions.
[0007] (3) Optimization and computational efficiency are limited; existing technologies lack adaptive optimization for specific tasks in terms of bandwidth selection and kernel function settings, and often rely on global experience or cross-validation, which cannot effectively reduce class heterogeneity within partitions. At the same time, point-by-point local fitting has a huge computational load. In large-scale high-resolution data scenarios, the training and inference processes are time-consuming and memory pressure is high. The lack of batching and in-mask optimization mechanisms leads to high engineering deployment and iteration costs. Summary of the Invention
[0008] This invention provides an intelligent clustering and machine learning-based intelligent remote sensing classification method and system. It addresses three core shortcomings: partition geometric availability, spatial consistency and balance, and scalability efficiency. The invention proposes the following specific technical problems and research objectives for engineering implementation.
[0009] (1) Geometric partition availability: It solves the problem that it is difficult to directly generate engineering-level vector partitions from continuous predicted values, and realizes the automatic construction of explicit partition surfaces that meet the requirements of non-overlapping, good connectivity, minimum scale and topological constraints, so as to ensure that they can be directly used for GIS management and rule assignment.
[0010] (2) Task adaptive partition optimization: to solve the problem of bandwidth / kernel parameters being disconnected from task objectives, with category purity, entropy or uncertainty as optimization objectives, linking partition and model parameters for adaptive search, reducing heterogeneity within partition and improving discriminative power.
[0011] (3) Boundary continuity and seam control: To solve the problem of boundary artifacts and prediction discontinuity caused by abrupt changes in adjacent local model parameters, we introduce intra-regional consistency and inter-regional smoothing constraints to stabilize the boundary morphology and suppress patching.
[0012] (4) District-level quality assessment and gating: To solve the problem of relying solely on global accuracy without the lack of district-level quality control, a district-level assessment and gating write-back mechanism based on interpretable indicators such as verification accuracy, entropy value, and connectivity is established to trigger automatic repartitioning or retraining.
[0013] (5) Class imbalance and small sample robustness: To solve the problem of missed detection and misjudgment caused by the scarcity of tail class samples, a joint strategy of cross-region supplementation, cost-sensitive learning and prior constraints is constructed to improve the generalization performance of minority classes in multi-region scenarios.
[0014] (6) Scalable computing and engineering efficiency: Solve the problems of large computational load, high memory consumption and slow inference in point-by-point local fitting, realize batch training and in-mask inference for partitioning, block and parallel acceleration, incremental update and versioning, so as to support the near real-time deployment of ultra-large range high-resolution data.
[0015] To address the aforementioned technical issues, this invention proposes an intelligent clustering and machine learning-based intelligent remote sensing classification method. Within a unified process, it achieves: spatial partitioning with entropy minimization as the objective, iterative optimization with connectivity and minimum size constraints, generation of non-overlapping, usable partition surfaces for engineering applications, partitioned random forest training, and region-by-region mask write-back, with region-level quality closed-loop control of output quality. This scheme handles engineering data interfaces (Shapefile / GeoTIFF), with configurable parameters and reproducible steps.
[0016] A smart clustering and machine learning-based intelligent remote sensing classification method specifically includes the following steps:
[0017] (1) Data access and preprocessing;
[0018] Training sample vectors, remote sensing images, and optional sample spectral fields b1–b7; samples and images maintain the same coordinate system; if inconsistent, automatic reprojection alignment is performed in the subsequent partitioning and classification stage; image band count ≥ 1; sample geometry is valid; NoData values are read from image bands and used for filtering during sample and inference;
[0019] (2) Global heterogeneity measurement;
[0020] Global heterogeneity was measured using Shannon entropy, calculated based on the sample class distribution, serving as an optimization control. This was used to verify the effectiveness of the optimization by subsequently comparing whether the "weighted entropy after partitioning" decreased.
[0021] ,
[0022] in: For global heterogeneity, global entropy; Total number of categories; For category indexing, ; For category The probability of it in the entire sample is calculated as follows:
[0023] , For category The number of samples; The total number of samples;
[0024] (3) Spatial adjacency graph construction and initial partitioning;
[0025] A K-nearest neighbor undirected graph is constructed using sample coordinates for connectivity determination and neighborhood search; initial clustering is performed, and if b1–b7 exist, the "spectral + standardized coordinates" feature is used; otherwise, the "category + standardized coordinates" feature is used to perform KMeans partitioning to obtain the initial Zone_ID; feature standardization adopts mean-variance normalization; KMeans random seed;
[0026] (4) Entropy-constrained iterative optimization;
[0027] ,
[0028] in: Weighted heterogeneity after partitioning, weighted entropy; Number of partitions; For partitioned indexes, ; For the first The sample set within each partition; For partitioning Number of samples within; The total number of all samples; For partitioning Internal Category The conditional probability is defined as:
[0029] ,
[0030] in: For partitioning Belongs to the category The number of samples;
[0031] Try migrating point by point to the candidate region where its neighborhood appears, and only accept the migration if: it does not violate connectivity: the source region is still simply connected after the point moves out; it is not less than the minimum size: the size of the source region does not fall below min_zone_size (50); it can reduce entropy: the new weighted entropy is strictly lower than the current one; after each round of iteration, the Zone_ID is compactly renumbered, with a maximum of max_iter_refine=30 iterations, and the process stops when it converges.
[0032] (5) Spatial smoothing and structural repair;
[0033] Each point is reassigned based on the majority neighborhood partition, and this only takes effect when "the weighted entropy is not increased, the source region connectivity is not disrupted, and the size lower limit is not triggered"; maximum speeds=2; connected component decomposition is performed within the partition, retaining the largest component; fragments are merged based on the majority neighborhood partition, with no entropy increase as the standard; maximum passes=5; for regions with a size less than the threshold, each point is merged into the majority neighborhood partition, still requiring no entropy increase; maximum passes=5;
[0034] (6) Partition validity report and point result output;
[0035] Print global entropy, weighted entropy after partitioning, percentage decrease, connectivity index, and the size and entropy of each zone; generate a point shapefile with the final Zone_ID;
[0036] (7) Geometric reconstruction and generation of non-overlapping partition surfaces;
[0037] Generate Voronoi polygons using points as seeds; perform make_valid or buffer(0) geometric repair on open / invalid regions; use the overall data envelope for envelope trimming to avoid infinite faces; can be replaced with actual ROI boundaries; dissolve by Zone_ID to obtain non-overlapping partitioned face Shapefiles;
[0038] (8) Preparation for zoning and classification (reprojection and fusion);
[0039] Reproject the partition planes and sample vectors onto the image coordinate system; skip if they are already consistent. Perform union fusion on multi-faceted planes with the same Zone_ID.
[0040] (9) Sample extraction and neighboring area replenishment;
[0041] Directly read the pixel value of the point and filter NoData; find the intersection with the area and rasterize the mask pixel value within the intersection envelope window, supporting the maximum sampling limit per area; if the number of samples of a certain type is less than the threshold, traverse the neighboring areas according to the priority "Touches>Intersects>centroid distance" and extract samples of that type to make up the difference until the threshold is reached or the neighboring areas are exhausted.
[0042] (10) Two-stage training and validation within partitions;
[0043] Safely split into 85%:15% for training and validation; if the number of categories is insufficient, use the full amount as the training set and leave the validation set empty to avoid stratified error reporting;
[0044] In the first stage, random search: randomly sample within the parameter space, combine with cross-validation, and roughly screen the best range; the number of iterations adapts to the sample size;
[0045] In the second stage, local grid: construct a small grid centered on the roughly screened optimum for fine-tuning, and select the one with the best performance on the validation set or cross-validation;
[0046] Recording and gating: print the key parameters and accuracy of the final model; if the district-level validation accuracy < acc_threshold, skip this district and write it back;
[0047] (11) Prediction within the mask and writing back by area;
[0048] Calculate the pixel window of the area envelope, rasterize the area into a binary mask; only predict the valid pixels within the mask; predict in batches according to the batch size to control memory occupancy; write the prediction results into the corresponding window of the output raster, only update the pixels within the mask, and keep the rest unchanged; after completing the iteration of all areas, refresh the cache and close the dataset.
[0049] An intelligent clustering and machine learning intelligent remote sensing classification system for implementing an intelligent clustering and machine learning intelligent remote sensing classification method, including:
[0050] (1) Data input module, used to read samples and images, and parse the spatial reference and NoData;
[0051] (2) Graph construction and initial partitioning module, used to calculate KNN adjacency and perform KMeans initial partitioning;
[0052] (3) Partition optimization module, responsible for iterative refinement, majority smoothing, connectivity repair, minimum scale repair and convergence control;
[0053] (4) Geometric reconstruction and surface generation module, used to generate Voronoi surfaces, perform geometric legalization, clipping and area-by-area fusion;
[0054] (5) Sample management and sample supplementation module, used for point or surface sample extraction, neighboring area priority sample supplementation and sample statistics;
[0055] (6) Training and validation module, used for two-stage hyperparameter search, model training and district-level accuracy evaluation;
[0056] (7) Inference and Write-back Module, used for region mask generation, batch inference and region window write-back;
[0057] (8) Quality assessment and feedback module, used to calculate district-level entropy, connectivity, and accuracy, and to execute gating and skipping strategies;
[0058] The modules communicate with each other through a standard data interface, supporting single-machine multi-core processing and batch processing.
[0059] The technical effects of this invention are as follows:
[0060] (1) Entropy-constrained spatial partitioning optimization method;
[0061] The method proposed in this invention performs a feasibility assessment before each migration, merging, or repair operation, ensuring that the partitioning structure is optimized without compromising the overall information stability due to local adjustments. This method is widely applicable to scenarios such as remote sensing classification, geographic mapping, and ecological monitoring, and is particularly suitable for tasks requiring high sensitivity to spatial patterns.
[0062] (2) Adjacency-first sample supplementation and class balancing mechanism;
[0063] To address the issues of uneven regional sample distribution and insufficient tail class samples, this invention employs a neighboring region priority sorting strategy, supplementing samples in the order of "direct contact—boundary intersection—centroid closest," while setting an upper limit on the proportion to prevent class imbalance. This mechanism combines spatial approximation with class balance, effectively improving the recognition accuracy of minority classes while maintaining the model's generalization ability, making it suitable for geographic and remote sensing classification scenarios with high class imbalance.
[0064] (3) Local inference and batch write-back techniques within the mask;
[0065] By rasterizing the target partition into a binary mask and generating a minimum bounding rectangular window, batch inference and prediction results are written back to the pixels within the mask. This method processes only the necessary regional data, significantly reducing memory usage and disk I / O load, making it particularly suitable for distributed or batch processing scenarios of high-resolution remote sensing imagery. Furthermore, the batch write-back strategy avoids duplicate overwriting and conflicting updates, improving the overall efficiency and controllability of the inference stage. Attached Figure Description
[0066] Figure 1 This is a flowchart of the present invention.
[0067] Figure 2 The test area image (sentinel2 RGB:B4,B3,B2) is used as an example.
[0068] Figure 3 These are the sampling points in the test area for the example (red dots: training sample points; green dots: test sample points).
[0069] Figure 4 The classification results are from conventional methods;
[0070] Figure 5 The results of the classification using the experimental method are shown in the example. Detailed Implementation
[0071] The specific technical solutions of the present invention will be described in conjunction with the accompanying drawings and embodiments.
[0072] like Figure 1 As shown, this invention proposes an intelligent clustering and machine learning-based intelligent remote sensing classification method and system, which achieves the following within a unified process: spatial partitioning with entropy minimization as the objective, iterative optimization with connectivity and minimum size constraints, generation of non-overlapping engineering-usable partition surfaces, partitioned random forest training and region-by-region mask write-back, and output quality control with region-level quality closed-loop control. This scheme handles engineering data interfaces (Shapefile / GeoTIFF), with configurable parameters and reproducible steps.
[0073] Specifically, the following steps are included:
[0074] (1) Data access and preprocessing;
[0075] Input data: Training sample vectors (points or polygons, including the CLASS_ID field), remote sensing imagery (multi-band GeoTIFF), and optional sample spectral fields b1–b7, such as... Figure 2 As shown.
[0076] Spatial consistency: The samples and images maintain the same coordinate system; if they are not consistent, they will be automatically reprojected and aligned in the subsequent partitioning and classification stage.
[0077] Process conditions: Number of image bands ≥ 1; Sample geometry valid; NoData value can be read from image bands and used for filtering during sample and inference.
[0078] (2) Global heterogeneity measurement;
[0079] Global heterogeneity is measured using Shannon entropy, calculated based on the sample class distribution, serving as a control for optimization. This allows for subsequent comparisons to verify the effectiveness of the optimization by checking whether the "weighted entropy after partitioning" decreases.
[0080]
[0081] in: For global heterogeneity, global entropy; Total number of categories; For category indexing, ; For category The probability of it in the entire sample is calculated as follows:
[0082] , For category The number of samples; The total number of samples;
[0083] (3) Spatial adjacency graph construction and initial partitioning;
[0084] Adjacency graph: Construct a K-nearest neighbor undirected graph (K=12, and symmetric) based on the sample coordinates, used for connectivity determination and neighborhood search.
[0085] Initial clustering: If b1–b7 exist, use the “spectral + standardized coordinates” feature; otherwise, use the “category + standardized coordinates” feature to perform KMeans partitioning and obtain the initial Zone_ID (number of zones N_zones=10).
[0086] Process conditions: Feature standardization uses mean-variance normalization; KMeans random number of 42, n_init=10.
[0087] (4) Entropy-constrained iterative optimization (including constraints);
[0088] Objective function: Minimize the partitioned weighted average entropy.
[0089] ,
[0090] in: Weighted heterogeneity after partitioning, weighted entropy; Number of partitions; For partitioned indexes, ; For the first The sample set within each partition; For partitioning Number of samples within; The total number of all samples; For partitioning Internal Category The conditional probability is defined as:
[0091] ,
[0092] in: For partitioning Belongs to the category The number of samples;
[0093] Feasible move: Attempt to migrate point by point to a candidate region appearing in its neighborhood. Migration is accepted only if: it does not violate connectivity (the source region remains simply connected after the point moves out); it is not less than the minimum size (the source region size does not fall below min_zone_size (50)); and it reduces entropy (the new weighted entropy is significantly lower than the current one, threshold 1e-8). After each iteration, the Zone_ID is compactly renumbered, with a maximum iteration count of max_iter_refine=30. The process stops upon convergence.
[0094] (5) Spatial smoothing and structural repair (without increasing entropy);
[0095] Majority Smoothing: Reassigns a value to each point based on the majority neighborhood partition, and only takes effect when "the weighted entropy is not increased, the source region connectivity is not disrupted, and the lower bound of the scale is not triggered"; at most, smooths=2.
[0096] Connectivity repair: Decompose connected components within the partition and retain the largest component; fragments (including single points) are merged according to the majority of their neighbors, without increasing entropy; the maximum number of passes is 5.
[0097] Minimum size repair: For regions smaller than the threshold, merge them point by point into the majority of neighboring regions, while still requiring no increase in entropy; maximum passes=5.
[0098] (6) Partition validity report and point result output;
[0099] Reporting metrics: Print global entropy, weighted entropy after partitioning, percentage decrease, connectivity metrics (average number of components ≤ 1.5 is considered good), and size and entropy of each partition.
[0100] Output: Generates a point Shapefile with the final Zone_ID (for face generation and partitioned modeling).
[0101] (7) Geometric reconstruction and generation of non-overlapping partition surfaces;
[0102] Voronoi construction: Generate Voronoi polygons with points as seeds; perform make_valid or buffer(0) geometric repair on open / invalid regions.
[0103] Boundary clipping: Clipping is done using the overall data envelope to avoid infinite surfaces; it can be replaced with the actual ROI boundary.
[0104] Dissolve by Zone: Dissolve by Zone_ID to obtain non-overlapping Shapefiles.
[0105] (8) Preparation for zoning and classification (reprojection and fusion);
[0106] Reprojection: Reproject the partition surface and sample vectors into the image coordinate system (skip if already consistent).
[0107] Zone surface fusion: Union and fuse multiple surfaces with the same Zone_ID to reduce duplicate processing and overlap.
[0108] (9)Sample extraction and neighboring area sample supplementation;
[0109] Point sample: Directly read the pixel value of the point position and filter out NoData.
[0110] Surface sample: Intersect with the zone surface, rasterize within the envelope window of the intersection, and take the masked pixel values, supporting the maximum sampling limit per surface.
[0111] Sample supplementation for under-sampled classes: If the number of samples of a certain class is less than the threshold (min_required_per_class = 20), traverse the neighboring areas according to the priority "Touches > Intersects > centroid distance", extract samples of this class to supplement until reaching the standard or the neighboring areas are exhausted, as Figure 3 shown.
[0112] (10)Two-stage training and validation within the partition;
[0113] Safe split: 85% / 15% training / validation; If the number of classes is insufficient (e.g., a certain class < 2), then use the full amount as the training set and set the validation set to empty to avoid stratified error reporting.
[0114] Stage 1 (random search): Randomly sample within the parameter space, combine with cross-validation (stratified / ordinary KFold), and roughly screen the best range; The number of iterations adapts to the sample size (≤200).
[0115] Stage 2 (local grid): Build a small grid around the roughly screened optimum for fine-tuning, and select the one with the best performance on the validation set or cross-validation.
[0116] Recording and gating: Print the key parameters and accuracy of the final model; If the district-level validation accuracy < acc_threshold (default 0.60), then skip this district and write it back.
[0117] (11)Prediction within the mask and writing back by district;
[0118] Window and mask: Calculate the pixel window of the district envelope, rasterize the district surface into a binary mask; Only predict the valid pixels within the mask.
[0119] Batch inference: Predict in batches according to the batch size (default 50,000) to control memory usage; Write the prediction results to the corresponding window of the output raster, only update the pixels within the mask, and keep the rest unchanged.
[0120] Resource release: After completing the iteration of all regions, refresh the cache and close the dataset.
[0121] (12) Output the results;
[0122] Output results: The classification results are generated and output according to the above classification method. See Figure 5 ;and Figure 4 Compared to the classification results of conventional methods, the recognition accuracy is improved. Figure 4 In the conventional classification results, the overall accuracy was 66.43%; the Kappa coefficient was 0.5450. Figure 5 In the classification results, the overall accuracy was 70.89% and the Kappa coefficient was 0.6731.
[0123] A smart clustering and machine learning-based smart remote sensing classification system is also provided to implement the aforementioned smart clustering and machine learning-based smart remote sensing classification method; including:
[0124] Data input module: Reads samples and images, and resolves spatial references and NoData.
[0125] Graph construction and initial partitioning module: calculates KNN adjacency and performs KMeans initial partitioning.
[0126] Partition optimization module (entropy constraint): responsible for iterative refinement, majority smoothing, connectivity repair, minimum size repair and convergence control.
[0127] Geometric Reconstruction and Surface Generation Module: Generates Voronoi surfaces, performs geometric legalization, trimming, and region-by-region merging.
[0128] Sample Management and Supplementation Module: Point / area sample extraction, neighboring area priority supplementation, and sample statistics.
[0129] Training and Validation Module: Two-stage hyperparameter search, model training, and regional accuracy evaluation.
[0130] Inference and Write-back Module: Region Mask Generation, Batch Inference, and Region-by-Region Window Write-back.
[0131] Quality assessment and feedback module: Statistical analysis of regional entropy, connectivity, and accuracy; execution of gating and skipping strategies.
[0132] The modules communicate with each other through standard data interfaces (Shapefile / GeoTIFF / OGR / GDAL), supporting single-machine multi-core and batch processing.
[0133] Key algorithm details and implementation points of this invention:
[0134] (1) Adjacency graph and connectivity determination.
[0135] KNN symmetry: ensures the graph is undirected and stable; K=12 is the default and can be adjusted according to the sample density.
[0136] Connectivity determination: Calculate the number of connected components for the subgraph of nodes within the region. Migration or repair must ensure that the number of components is 1.
[0137] (2) Rapid updates of entropy and weighted entropy.
[0138] Intra-region count caching: In implementation, the category count and entropy of each region can be cached. Point migration only updates the source and target regions, avoiding global duplicate scanning (the code has been implemented by direct recalculation, and the project can be optimized by caching).
[0139] (3) Most smoothing and repair “non-entropy” constraints.
[0140] Threshold: Smooth or repair the newly calculated weighted entropy at each step. If the entropy is not higher than the current value and the connectivity / scale conditions are met, then the change is executed to ensure that the optimization direction is consistent.
[0141] (4) Geometric reliability of Voronoi surface.
[0142] Invalidation handling: First, legalize open regions or self-intersecting surfaces; if this fails, degenerate to buffer(0) for repair.
[0143] Clipping boundary: Use an overall bounding rectangle; in actual engineering, it is recommended to clip using the actual ROI to reduce edge overlay.
[0144] (5) Regionalized training and two-stage parameter tuning.
[0145] Secure segmentation: When there are very few categories, avoid hierarchical errors and invalid validation.
[0146] Random search: Parameters include n_estimators, max_depth, min_samples_split, min_samples_leaf, max_features, and class_weight; the number of iterations adapts to the sample size, combined with KFold / StratifiedKFold.
[0147] Local grid: A small-scale enumeration is performed around the optimal coarse screen, resulting in more robust results.
[0148] Gated write-back: If the district-level verification accuracy is lower than the threshold (default 0.60), the write-back is skipped directly to avoid negative contributions.
[0149] (6) Batch reasoning and writing back within the mask.
[0150] Window positioning: Use area encapsulation to obtain the smallest window, reducing I / O.
[0151] Masking rasterization: Boundary coverage is controlled with the ALL_TOUCHED=TRUE policy.
[0152] Batch inference: controls peak memory usage; only updates pixels within the mask, keeping other pixels unchanged, facilitating partition-level incremental updates.
[0153] The process flow and implementation conditions of this invention are as follows:
[0154] Required process: Adjacency graph construction → Initial partitioning → Entropy constraint iterative optimization → Smoothing and repair → Partition validity report → Voronoi surface generation and region fusion → Reprojection alignment → Sample extraction and supplementation → Two-stage training and gating → Mask inference and write-back.
[0155] Key parameters (configurable):
[0156] Partition side: N_zones=10, K_neighbors=12, max_iter_refine=30, min_zone_size=50, max_majority_sweeps=2, max_contig_fix_passes=5, max_size_fix_passes=5.
[0157] Classification side: acc_threshold=0.60, min_required_per_class=20, random / grid search range and number of folds adapt to sample size.
[0158] Environment and Interface: Supports GDAL / OGR and GeoPandas / Shapely; input and output are standard Shapefile / GeoTIFF.
[0159] The key technologies of this invention include:
[0160] (1) Entropy Constraint + Spatial Connectivity Partition Optimization Algorithm: This algorithm uses partition weighted information entropy as the global objective and optimizes the region partitioning by evaluating migration operations point by point, ensuring that the spatial partitioning conforms to the principle of minimizing information entropy while maintaining spatial connectivity and the minimum partition size limit. Any smoothing, repair, or merging operation must follow the "no entropy increase" rule to fundamentally avoid structural damage caused by excessive splitting or disordered merging. Compared with traditional partitioning methods based on single similarity or distance, this method can significantly improve the stability and interpretability of partitioning while preserving the original spatial pattern, and provide high-quality spatial unit input for subsequent partition-based machine learning.
[0161] (2) Spatial optimization and candidate region constraints based on adjacency graphs: A point-level adjacency graph is constructed using K-nearest neighbors or Delaunay triangulation to determine spatial adjacency relationships and the set of candidate target regions. During the optimization process, point-level migration, category correction, or partition merging is performed only within directly adjacent partitions, effectively reducing the high computational cost and low efficiency risks associated with global search. This strategy retains the constraint of spatial similarity on the optimization results while ensuring the convergence speed and controllability of local adjustments in complex scenarios. This structured candidate set design is particularly suitable for partition optimization tasks involving large-scale remote sensing data or high-resolution geographic data.
[0162] (3) Partitioned machine learning and quality gating mechanism: For each optimized partition, samples are extracted independently and the model is trained. A two-stage hyperparameter optimization strategy of random search + grid fine-tuning is adopted to quickly explore the global optimal interval and finely adjust the local parameters. The model accuracy is evaluated through the partition-level validation set. If it is lower than the preset threshold, the prediction write-back step is skipped directly, thereby removing low-quality results from the final output. This "quality gating" mechanism can effectively maintain the overall prediction accuracy and stability when there are significant sample differences or data noise in the partitions, and prevent local low-quality results from affecting the global analysis.
Claims
1. An intelligent remote sensing classification method based on intelligent clustering and machine learning, characterized in that, The process includes the following steps: spatial partitioning with entropy minimization as the objective, iterative optimization with connectivity and minimum size constraints, generation of partition surfaces that are usable for non-overlapping engineering, partitioned random forest training and region-by-region mask write-back, and output quality control with region-level quality closed-loop control.
2. The intelligent clustering and machine learning intelligent remote sensing classification method according to claim 1, characterized in that, Specifically, the following steps are included: (1) Data access and preprocessing; Training sample vectors, remote sensing images, and optional sample spectral fields, such as b1–b7; samples and images maintain the same coordinate system; if inconsistent, they are automatically reprojected and aligned in the subsequent partitioning and classification stage; the number of image bands is ≥1; Sample geometry is valid; NoData values are read from image bands and used for filtering during sample and inference; (2) Global heterogeneity measurement; Global heterogeneity was measured using Shannon entropy, calculated based on the sample class distribution, serving as an optimization control. This was used to verify the effectiveness of the optimization by subsequently comparing whether the "weighted entropy after partitioning" decreased. , in: For global heterogeneity, global entropy; Total number of categories; For category indexing, ; For category The probability of it in the entire sample is calculated as follows: , For category The number of samples; The total number of samples; (3) Spatial adjacency graph construction and initial partitioning; A K-nearest neighbor undirected graph is constructed using sample coordinates for connectivity determination and neighborhood search; initial clustering is performed, and if b1–b7 exist, the "spectral + standardized coordinates" feature is used; otherwise, the "category + standardized coordinates" feature is used to perform KMeans partitioning to obtain the initial Zone_ID; feature standardization adopts mean-variance normalization; KMeans random seed; (4) Entropy-constrained iterative optimization; Minimize the partitioned weighted average entropy; , in: Weighted heterogeneity after partitioning, weighted entropy; Number of partitions; For partitioned indexes, ; For the first The sample set within each partition; For partitioning Number of samples within; The total number of all samples; For partitioning Internal Category The conditional probability is defined as: , in: For partitioning Belongs to the category The number of samples; Try migrating point by point to the candidate region where its neighborhood appears, and only accept the migration if: it does not violate connectivity: the source region is still simply connected after the point moves out; it is not less than the minimum size: the size of the source region does not fall below min_zone_size (50); it can reduce entropy: the new weighted entropy is strictly lower than the current one; after each round of iteration, the Zone_ID is compactly renumbered, with a maximum of max_iter_refine=30 iterations, and the process stops when it converges. (5) Spatial smoothing and structural repair; Each point is reassigned based on the majority neighborhood partition, and this only takes effect if it does not increase the weighted entropy, does not disrupt the source region connectivity, and does not trigger the size lower limit; maximum sweats=2; within the partition, connected component decomposition is performed, and the largest component is retained; fragments are merged based on the majority neighborhood partition, with no entropy increase as the standard; maximum passes=5; for regions with a size less than the threshold, each point is merged into the majority neighborhood region, still requiring no entropy increase; maximum passes=5; (6) Partition validity report and point result output; Print out the global entropy, weighted entropy after partitioning, percentage decrease, connectivity index, and the size and entropy of each zone; generate a point shapefile with the final Zone_ID; (7) Geometric reconstruction and generation of non-overlapping partition surfaces; Generate Voronoi polygons using points as seeds; perform make_valid or buffer(0) geometric repair on open / invalid regions; use the overall data envelope for envelope trimming to avoid infinite faces; can be replaced with actual ROI boundaries; dissolve by Zone_ID to obtain non-overlapping partitioned face Shapefiles; (8) Preparation for zoning and classification; Reproject the partition surface and sample vectors into the image coordinate system. If they are already consistent, skip this step; perform union fusion on multiple surfaces with the same Zone_ID. (9)Sample extraction and neighboring area sample supplementation; Directly read the pixel values at the points, filtering out NoData; find the intersection with the area surface, rasterize within the envelope window of the intersection to obtain the masked pixel values, supporting the maximum sampling limit for each surface; if the number of a certain type of sample is less than the threshold, traverse the neighboring areas according to the priority "Touches>Intersects>Centroid distance", extract samples of this type to supplement until reaching the standard or exhausting the neighboring areas. (10)Two-stage training and validation within the partition; Safely split it into 85%:15% as the training and validation sets; if the number of classes is insufficient, use the full amount as the training set and leave the validation set empty to avoid stratified error reporting. Stage 1, random search: randomly sample within the parameter space, combined with cross-validation, to roughly screen the best range; the number of iterations adapts to the sample size. Stage 2, local grid: construct a small grid centered on the roughly screened optimum for fine-tuning, and select the one with the best performance in the validation set or cross-validation. Recording and gating: print the key parameters and accuracy of the final model; if the district-level validation accuracy < acc_threshold, skip this district and write it back. (11)Prediction within the mask and writing back by district; Calculate the pixel window of the district envelope, rasterize the district surface into a binary mask; only predict the valid pixels within the mask; predict in batches according to the batch size to control memory occupancy; write the prediction results into the corresponding window of the output raster, only update the pixels within the mask, and keep the rest unchanged; after completing the iteration of all districts, refresh the cache and close the dataset.
3. An intelligent remote sensing classification system based on intelligent clustering and machine learning, characterized in that, Used to implement the intelligent clustering and machine learning intelligent remote sensing classification method described in claim 1 or 2; including: (1)Data input module, used to read samples and images, and parse the spatial reference and NoData; (2)Graph construction and initial partitioning module, used to calculate KNN adjacency and perform KMeans initial partitioning; (3)Partition optimization module, responsible for iterative refinement, majority smoothing, connectivity repair, minimum scale repair, and convergence control; (4)Geometric reconstruction and surface generation module, used to generate Voronoi surfaces, perform geometric legalization, clipping, and fusion by district; (5)Sample management and supplementation module, used for point or surface sample extraction, neighboring area priority sample supplementation, and sample statistics; (6)Training and validation module, used for two-stage hyperparameter search, model training, and district-level accuracy evaluation; (7)Inference and writing back module, used for district mask generation, batch inference, and writing back by district window; (8)Quality assessment and feedback module, used to calculate district-level entropy, connectivity, and accuracy, and perform gating and skipping strategies; Each module is transmitted through a standard data interface, supporting single-machine multi-core and batch processing.