A method and device for identifying illegal buildings on roofs of existing buildings in cities

CN121904595BActive Publication Date: 2026-07-21SHENZHEN SCIENCE & TECHNOLOGY INSTITUTE OF URBAN SAFETY DEVELOPMENT +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN SCIENCE & TECHNOLOGY INSTITUTE OF URBAN SAFETY DEVELOPMENT
Filing Date
2026-03-23
Publication Date
2026-07-21

Smart Images

  • Figure CN121904595B_ABST
    Figure CN121904595B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of illegal building identification, and discloses a roof illegal building identification method and device for existing buildings in cities, which comprises the following steps: obtaining a target building optical remote sensing image and extracting a remote sensing feature set, dividing a training set and a verification set, and optimizing the hyperparameters of multiple sub-models with the maximum F1 score of positive samples as the target; determining the optimal decision threshold and the optimal recall rate of each sub-model through posterior probability calibration and decision threshold optimization; taking the maximum value of the optimal recall rate of the sub-models as the lower limit of the recall rate of an integrated model, combining weight normalization constraints, optimizing the weight combination of the sub-models, and retraining the probability fusion to obtain the integrated model for illegal building identification. The application does not require a large number of labeled samples, improves the degree of automation and identification accuracy, adapts to complex urban scenes, can provide a precise and efficient illegal building identification scheme for urban management, significantly reduces the supervision cost, and improves the intelligent level of urban housing safety supervision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of illegal construction identification technology, specifically to a method and device for identifying illegal rooftop constructions on existing urban buildings. Background Technology

[0002] Unauthorized additions or overloading of building roofs without planning permission directly alter the building's original load-bearing system, causing a redistribution of internal structural forces. These unintended load changes can easily lead to uneven settlement of the foundation or damage to load-bearing components, such as cracking and deformation, ultimately compromising the safety and stability of the main structure. The safety hazards arising from such actions not only pose a potential threat to the lives and property of residents but also present significant challenges to the daily management and public safety governance work of relevant departments.

[0003] The current mainstream technology for identifying illegal rooftop construction is deep learning-based change detection. This technology compares building images from different time periods to capture changes in the roof layout, thereby determining whether illegal construction exists. However, this method has significant limitations. It requires multiple images from different periods as training samples and manual annotation of change samples. In real-world scenarios, the number of rooftop illegal construction samples is scarce, and the formation and change cycles of illegal construction are difficult to capture. Obtaining a sufficient number of effective samples that meet training requirements is the biggest obstacle to the technology's practical application. Furthermore, the decision-making logic of a single deep learning model is relatively fixed, lacking adaptability to the diverse characteristics of rooftop illegal construction, such as variations in addition methods, diverse load types, and heterogeneous building materials. This makes it prone to false negatives and missed detections during actual detection. Especially given the inherent imbalance in the distribution of positive and negative samples, the model, after training, is prone to biased judgments towards the majority class (non-illegal construction samples), directly leading to low prediction accuracy and recall. This further reduces the model's detection accuracy and reliability in engineering practice. Summary of the Invention

[0004] This invention provides a method and apparatus for identifying illegal rooftop constructions on existing urban buildings, in order to solve the problems of limited sample size, long acquisition time, and inaccurate identification of illegal construction changes.

[0005] In a first aspect, the present invention provides a method for identifying illegal rooftop constructions on existing urban buildings, the method comprising:

[0006] Optical remote sensing image data of the roof of the target building is acquired. Based on the optical remote sensing image data, a feature set representing the illegal construction attributes of the roof of the target building is extracted. A sample set containing positive illegal construction samples and negative non-illegal construction samples is constructed. The sample set is divided into a training set and a validation set. With the goal of maximizing the F1 score of the positive samples, the hyperparameters of multiple sub-models are optimized using the training set to obtain the hyperparameter combination corresponding to each sub-model.

[0007] The output results of each sub-model are calibrated using the validation set, and the F1 score of positive class samples under different decision thresholds is calculated based on the predicted probability interval. The mapping relationship between F1 score and decision threshold is established, and the optimal decision threshold and corresponding optimal recall rate of each sub-model are determined.

[0008] Extract the maximum value of the optimal recall rate of all sub-models as the lower bound of the recall rate of the ensemble model, and determine the optimal weight combination of each sub-model by taking the sub-model weight normalization and the lower bound of recall rate as constraints and maximizing the F1 score of the positive class samples of the ensemble model as the objective.

[0009] The integrated model is obtained by probabilistic fusion retraining based on the optimal weight combination and optimal decision threshold of each sub-model. The integrated model is then used to identify whether there are illegal constructions on the roof of the target building.

[0010] This invention provides a method for identifying illegal rooftop constructions on existing urban buildings. By extracting remote sensing features, it optimizes sub-model parameters with the goal of maximizing the F1 score of the positive class. Probability calibration and threshold optimization are combined to improve the predictive performance of the sub-model. Furthermore, a lower limit for recall is set to ensure comprehensive identification of illegal constructions. Finally, an integrated model is constructed through multi-stage weight optimization and probability fusion to achieve a balance between high recall and precision. This method does not require massive amounts of labeled samples, improves automation and identification accuracy, and can adapt to complex urban scenarios. It provides a precise and efficient solution for illegal construction identification in urban governance, significantly reducing regulatory costs and improving the intelligence level of urban housing safety supervision.

[0011] In one optional implementation, with the goal of maximizing the F1 score of positive class samples, hyperparameter optimization is performed on multiple sub-models using the training set to obtain the hyperparameter combinations corresponding to each sub-model, including:

[0012] Initialize the search space of the hyperparameters to be optimized, and use a probabilistic surrogate model to fit the mapping relationship between the hyperparameter combination and the predicted F1 score of the positive class samples;

[0013] Based on the mapping relationship fitted by the surrogate model, the optimal combination of hyperparameters that maximizes the F1 score of positive class samples is found through iterative search.

[0014] This invention provides a method for identifying illegal rooftop constructions on existing urban buildings. The objective is to maximize the F1 score of positive class samples. This metric simultaneously considers both precision and recall in illegal construction identification, accurately addressing scenarios with few illegal construction samples and class imbalance, thus avoiding missed or false positives caused by single-dimensional optimization. By fitting the mapping relationship between hyperparameters and F1 scores using a probabilistic surrogate model and combining it with a data acquisition function to select high-contribution hyperparameter combinations, the optimal solution can be efficiently locked without exhaustive search, reducing computational costs and optimization time. During iteration, the model mapping relationship is verified and dynamically adjusted based on real F1 scores, ensuring the reliability and adaptability of hyperparameter combinations. This allows each sub-model to fully mine illegal construction information from remote sensing features, significantly improving single-model performance.

[0015] In one optional implementation, the output results of each sub-model are calibrated using a validation set, including:

[0016] A calibration mapping function is introduced to transform the original output of each sub-model into the true probability of positive samples. The calculation formula is as follows:

[0017]

[0018] in, The calibrated probability. This is the output of the original model before calibration. and These are scalar parameters obtained by fitting parameters to the validation set.

[0019] The present invention provides a method for identifying illegal rooftop constructions on existing urban buildings. Addressing the problem of insufficient illegal construction samples and class imbalance leading to deviations in the original output probabilities of sub-models from the true distribution, this method introduces a calibration mapping function to transform the uncalibrated outputs of each sub-model into positive class sample probabilities that fit the real-world scenario. By fitting scalar parameters to a validation set, the method accurately corrects prediction biases caused by data distribution deviations, avoiding situations where the original output probabilities are too high or too low. The calibrated probabilities are more statistically interpretable and can truly reflect the likelihood of illegal constructions on the target building.

[0020] In one optional implementation, the F1 score of positive class samples under different decision thresholds is calculated based on the predicted probability interval, a mapping relationship between the F1 score and the decision threshold is established, and the optimal decision threshold and corresponding optimal recall rate of each sub-model are determined, including:

[0021] Traverse the probability prediction interval, calculate the F1 score of positive class samples under different decision thresholds, and establish the mapping relationship between F1 score and decision threshold;

[0022] The decision threshold corresponding to the maximum F1 score of the positive class sample is extracted based on the mapping relationship, and is used as the optimal decision threshold.

[0023] Based on the maximum F1 score, locate the recall corresponding to the maximum F1 score in the precision-recall mapping graph of each sub-model, and use it as the optimal recall of the corresponding sub-model.

[0024] The present invention provides a method for identifying illegal rooftop constructions on existing urban buildings. By traversing the predicted probability interval and establishing a mapping relationship between F1 score and decision threshold, the optimal decision threshold for each sub-model is accurately determined. This overcomes the limitations of default thresholds in scenarios with imbalanced illegal construction samples. The threshold is determined with the goal of maximizing the F1 score, while also considering the precision and recall rate of illegal construction identification. This provides key support for optimizing the performance of sub-models. The optimal recall rate is located based on the maximum F1 score. This clarifies the upper limit of the recall capability of a single sub-model and lays the foundation for setting a lower limit of recall rate for subsequent integrated models and controlling the risk of missed detections of illegal constructions. This further improves the reliability and adaptability of the overall identification scheme and helps to balance the contradiction between missed detections and false detections.

[0025] In one optional implementation, the optimal weight combination for each sub-model is determined by using weight normalization and recall lower bound as constraints, with the objective of maximizing the F1 score of the positive class samples in the ensemble model, including:

[0026] By introducing weighting coefficients into the conventional probabilistic graphical model, an improved probabilistic graphical model is constructed, expressed as follows:

[0027]

[0028] in, This indicates that multiple sub-models have been calibrated for the samples. The overall predicted probability, For the first After calibration, the sub-models were used on the samples. The predicted probability, These are the corresponding weights for the sub-models;

[0029] Using a multi-stage grid search strategy, with weight normalization and recall lower bound as constraints, and aiming to maximize the F1 score of positive class samples in the ensemble model, we perform weight combination optimization to determine the optimal weight combination for each sub-model.

[0030] The present invention provides a method for identifying illegal rooftop constructions on existing urban buildings. By introducing weight coefficients into a probabilistic graphical model to construct an improved model, the contribution of each sub-model can be flexibly adjusted to avoid the influence of defects in a single model on the overall result. This solves the problem of inflated joint probability that is prone to occur in traditional fusion methods. By using weight normalization and recall lower bound as constraints, it ensures that the weight allocation of the integrated model is reasonable and not lower than the recall capability of any sub-model, effectively controlling the risk of missed detection of illegal constructions. The multi-stage grid search strategy combines coarse and fine search to accurately retrieve the optimal weight combination that maximizes the F1 score of the integrated model, achieving a balance between high recall and low false positive rate.

[0031] In one optional implementation, weight combination optimization is performed to determine the optimal weight combination for each sub-model, including:

[0032] Within the first preset weight range, traverse multiple weight combinations with a first step length;

[0033] Iterate through each weight combination, use the improved probabilistic graphical model to perform probability fusion, and calculate the recall corresponding to different decision thresholds. Under the condition that the recall is not less than the lower limit of recall, determine the weight combination and decision threshold when the F1 score of the positive class sample is maximized.

[0034] Within the second preset weight range, multiple weight combinations are traversed with a second step length, and each weight combination is traversed repeatedly. Probability fusion is performed using an improved probabilistic graphical model. At the same time, the recall corresponding to different decision thresholds is calculated. Under the condition that the recall is not less than the lower limit of recall, the steps of determining the weight combination and decision threshold when the F1 score of the positive class sample is maximized are obtained, thus obtaining the optimal weight combination and decision threshold. The second step length is less than the first step length.

[0035] In one alternative implementation, if the recall rate cannot meet the condition of not being less than the lower limit of recall rate, then the optimal weight combination and decision threshold are determined based on the lower limit of recall rate.

[0036] The present invention provides a method for identifying illegal rooftop constructions on existing urban buildings. It utilizes a larger first-step length for coarse searching, quickly traversing a preset weight range to initially pinpoint weight intervals close to the optimal solution, avoiding blind searching. A smaller second-step length is then used for fine searching, accurately identifying the optimal weight combination, balancing search efficiency and solution accuracy. A recall rate not less than a lower limit is constrained to ensure the ensemble model's ability to detect all illegal construction samples, effectively controlling the risk of missed detections. Maximizing the F1 score is the objective, adapting weight allocation to the performance differences of each sub-model, achieving a balance between high recall and low false positive rate. For cases where the recall rate is insufficient, the optimal solution is directly determined based on the lower limit of recall, ensuring usable model parameters can still be output even in extreme situations, guaranteeing the robustness and practicality of the solution.

[0037] Secondly, the present invention provides a device for identifying illegal rooftop constructions on existing urban buildings, the device comprising:

[0038] The feature acquisition and sub-model training module is used to acquire optical remote sensing image data of the roof of the target building, extract feature sets representing the illegal construction attributes of the roof of the target building based on the optical remote sensing image data, construct a sample set containing positive samples of illegal construction and negative samples of non-illegal construction, divide the sample set into training set and validation set, aim to maximize the F1 score of positive samples, use the training set to optimize the hyperparameters of multiple sub-models, and obtain the hyperparameter combination corresponding to each sub-model.

[0039] The optimal parameter determination module is used to perform posterior probability calibration on the output results of each sub-model using the validation set, calculate the F1 score of positive class samples under different decision thresholds based on the predicted probability interval, establish the mapping relationship between F1 score and decision threshold, and determine the optimal decision threshold and corresponding optimal recall rate for each sub-model.

[0040] The optimal weight combination determination module is used to extract the maximum value of the optimal recall rate of all sub-models as the lower bound of the recall rate of the ensemble model. With the normalization of sub-model weights and the lower bound of recall rate as constraints, and with the goal of maximizing the F1 score of positive class samples of the ensemble model, the optimal weight combination of each sub-model is determined.

[0041] The illegal construction identification module is used to perform probabilistic fusion retraining based on the optimal weight combination and optimal decision threshold of each sub-model to obtain an integrated model, which is then used to identify whether there are illegal constructions on the roof of the target building.

[0042] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the method described in the first aspect or any corresponding embodiment thereof.

[0043] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the method described in the first aspect or any corresponding embodiment thereof. Attached Figure Description

[0044] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0045] Figure 1 This is a schematic diagram of an application scenario according to an embodiment of the present invention;

[0046] Figure 2 This is a schematic diagram of the first process of a method for identifying illegal rooftop constructions on existing urban buildings according to an embodiment of the present invention.

[0047] Figure 3 This is a schematic diagram illustrating the extraction process of remote sensing feature sets of building tops in the method for identifying illegal rooftop constructions of existing urban buildings according to an embodiment of the present invention.

[0048] Figure 4 This is a schematic diagram of the second process of the method for identifying illegal rooftop constructions on existing urban buildings according to an embodiment of the present invention;

[0049] Figure 5 This is a mapping diagram of the F1 score and decision threshold of positive class samples in the method for identifying illegal roof constructions on existing urban buildings according to an embodiment of the present invention.

[0050] Figure 6 This is a precision-recall mapping diagram in the method for identifying illegal rooftop constructions on existing urban buildings according to an embodiment of the present invention.

[0051] Figure 7 This is a schematic diagram illustrating the process of optimal weight combination search and probability fusion in the method for identifying illegal rooftop constructions on existing urban buildings according to an embodiment of the present invention.

[0052] Figure 8 This is a schematic diagram of the multi-segment weighted search space in the method for identifying illegal rooftop constructions on existing urban buildings according to an embodiment of the present invention.

[0053] Figure 9 This is a schematic diagram showing the performance comparison results of the integrated model and sub-model of the method for identifying illegal roof constructions on existing urban buildings according to an embodiment of the present invention.

[0054] Figure 10 This is a structural block diagram of a rooftop illegal construction identification device for existing urban buildings according to an embodiment of the present invention.

[0055] Figure 11 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0057] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.

[0058] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0059] As an optional application scenario of this invention, such as Figure 1 As shown, the illegal construction identification system may include at least one terminal device and at least one server. Figure 1 The system is illustrated in the example, which includes a computer 101, a mobile terminal 102, and a server 103, and the terminal devices such as the computer 101 and the mobile terminal 102 are connected to the server 103 through a network 110.

[0060] Specifically, the terminal device can be a smartphone, tablet, laptop, PDA, desktop computer, game console, smart TV, smart wearable device, in-vehicle terminal, VR (Virtual Reality) device, AR (Augmented Reality) device, etc. Server 103 can be a standalone physical server, a server cluster, a distributed system, or a cloud server providing cloud services. Network 110 can be a wired or wireless network, examples of which include, but are not limited to, the Internet, corporate intranet, local area network, wide area network, mobile communication network, and combinations thereof.

[0061] This invention provides a method for identifying illegal rooftop constructions on existing urban buildings. By leveraging the advantages of probabilistic fusion of multiple sub-models, it captures the complementary predictive information of each sub-model to balance the contradiction between missed and false positives in illegal construction identification, achieving high-precision identification of illegal construction samples with high recall and low false positives.

[0062] According to an embodiment of the present invention, an embodiment of a method for identifying illegal rooftop constructions on existing urban buildings is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0063] This embodiment provides a method for identifying illegal rooftop constructions on existing urban buildings, which can be used in the aforementioned computer system. Figure 2 This is a flowchart of a method for identifying illegal rooftop constructions on existing urban buildings according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:

[0064] Step S201: Obtain optical remote sensing image data of the roof of the target building, and extract a feature set representing the illegal construction attributes of the roof of the target building based on the optical remote sensing image data. Construct a sample set containing positive illegal construction samples and negative non-illegal construction samples. Divide the sample set into a training set and a validation set. With the goal of maximizing the F1 score of the positive samples, use the training set to optimize the hyperparameters of multiple sub-models to obtain the hyperparameter combination corresponding to each sub-model.

[0065] Specifically, a single building is taken as the smallest spatial analysis unit, such as... Figure 3 The diagram illustrates the extraction process of remote sensing features for building rooftops. Multiple optical remote sensing image features related to illegal construction identification are extracted for each target building. These features include, but are not limited to, spectral, color, and texture characteristics. This constructs the original remote sensing feature set for illegal construction on the rooftops of the target buildings. Then, feature engineering is used to reduce the dimensionality of the original feature set, forming a preferred subset of features, which serves as the typical feature set for illegal construction. The optical remote sensing images primarily originate from multispectral data acquired by open-source satellite platforms such as Sentinel-2. Building positive and negative sample labels are determined and labeled through a combination of professional remote sensing visual interpretation and on-site inspection. The typical feature set for illegal construction utilizes a fusion filtering and packaging feature selection method to reduce the dimensionality of the original remote sensing feature set, thus addressing the problem of high-dimensional feature redundancy.

[0066] Specifically, based on the complementarity of algorithmic principles, the representativeness of model performance, and the maturity of practical applications, multiple heterogeneous classifiers of different categories are selected as sub-models. Heterogeneous classifiers refer to classification models that differ significantly in algorithmic principles, decision logic, or data representation, and that are statistically close to independent events. The sample set is divided into a training set and a validation set to obtain the hyperparameter combinations corresponding to each sub-model, thus completing the training process for the sub-models.

[0067] Positive samples refer to buildings with changes in their rooftops indicating illegal construction, while negative samples refer to buildings without such changes. The F1 score is a statistical metric used to evaluate the performance of binary classification models, ranging from 0 to 1, and is determined by calculating the harmonic mean of precision and recall. To address the problem of model skewness towards the majority class (non-illegal construction category) due to imbalanced sample distribution, and to enable each sub-model to more accurately identify whether there are illegal constructions on the rooftops of buildings, a Bayesian hyperparameter optimization strategy guided by the F1 score of positive samples is adopted. This strategy iteratively corrects the posterior distribution of the objective function to achieve the optimal hyperparameter configuration for each sub-model.

[0068] Step S202: Use the validation set to perform posterior probability calibration on the output results of each sub-model, calculate the F1 score of positive class samples under different decision thresholds based on the predicted probability interval, establish the mapping relationship between F1 score and decision threshold, and determine the optimal decision threshold and corresponding optimal recall rate for each sub-model.

[0069] Specifically, based on the obtained optimal hyperparameter sub-model, the model output probability is calibrated using the validation set to ensure that the output probability can truly reflect the confidence that the sample belongs to the positive class. Since the illegal construction identification task is a typical class imbalanced classification problem, positive class samples (illegal constructions) are scarce. If the default threshold of 0.5 is directly used as the classification threshold, it will often lead to an increase in the model's missed detection of positive class samples, which cannot meet the actual detection requirements.

[0070] The decision threshold is the critical probability value that divides the predicted probability output by the model into positive and negative samples. For example, if the decision threshold is 0.6, then a sample is classified as positive if the probability of being classified as positive is greater than 0.6 (and negative if the probability is less than 0.4), and negative if the probability of being classified as positive is less than 0.6 (and negative if the probability is greater than 0.4). This is just an example and is not a limitation.

[0071] For imbalanced classification tasks, the default decision threshold of 0.5 is usually not the optimal decision threshold. Therefore, based on the probability prediction interval [0,1], the F1 score of positive class samples under different decision thresholds is calculated, and the mapping relationship between F1 score and decision threshold is established. In this way, the optimal decision threshold and the corresponding optimal recall rate of each sub-model are determined.

[0072] Step S203: Extract the maximum value of the optimal recall rate of all sub-models as the lower bound of the recall rate of the ensemble model, and determine the optimal weight combination of each sub-model with the constraints of weight normalization and lower bound of recall rate, and with the goal of maximizing the F1 score of the positive class samples of the ensemble model.

[0073] Specifically, the optimal recall rates of all sub-models are compared, and the maximum value is taken as the lower limit of the recall rate of the ensemble model. For example, if the recall rate of the first sub-model is 88%, the recall rate of the second sub-model is 90%, and the recall rate of the third sub-model is 86%, then the lower limit of the recall rate is 90%.

[0074] The ensemble model extracts and integrates the advantages of multiple sub-models to output the optimal judgment result. The sum of the normalized weights of each sub-model is set to 1, and the lower bound of recall is used as constraints. The objective is to maximize the F1 score of the positive class samples in the ensemble model. This determines the optimal weight combination for each sub-model. Under the optimal weight combination, the ensemble model can accurately identify illegal construction targets while maintaining high recall.

[0075] Step S204: Perform probabilistic fusion retraining based on the optimal weight combination and optimal decision threshold of each sub-model to obtain the integrated model. Use the integrated model to identify whether there are illegal constructions on the roof of the target building.

[0076] Specifically, illegal construction refers to actions taken on the roof of an existing building without planning permission that alter its load-bearing capacity, such as roof additions or overloading. An ensemble model is obtained by probabilistic fusion retraining based on the optimal weight combination and optimal decision threshold of each sub-model. In practical applications, when it is necessary to identify whether there are illegal constructions on the roof of a building, the current remote sensing features of the target building are input into the ensemble model to accurately identify whether there are illegal constructions on the roof of the target building.

[0077] This embodiment provides a method for identifying illegal structures on the rooftops of existing urban buildings. By extracting remote sensing features, it optimizes sub-model parameters to maximize the positive class F1 score. It then improves the predictive performance of the sub-model by combining posterior probability calibration and threshold optimization. Furthermore, it sets a lower limit for recall to ensure comprehensive identification of illegal structures. Finally, it constructs an ensemble model through multi-stage weight optimization and probability fusion, achieving a balance between high recall and precision. This method does not require massive amounts of labeled samples, improves automation and identification accuracy, and can adapt to complex urban scenarios. It provides a precise and efficient solution for illegal structure identification in urban governance, significantly reducing regulatory costs and enhancing the intelligence level of urban housing safety supervision.

[0078] This embodiment provides a method for identifying illegal rooftop constructions on existing urban buildings, which can be used in the aforementioned computer system. Figure 4 This is a flowchart of a method for identifying illegal rooftop constructions on existing urban buildings according to an embodiment of the present invention, such as... Figure 4 As shown, the process includes the following steps:

[0079] Step S301: Obtain optical remote sensing image data of the roof of the target building, extract feature set representing the illegal construction attributes of the roof of the target building based on the optical remote sensing image data, construct a sample set containing positive illegal construction samples and negative non-illegal construction samples, divide the sample set into training set and validation set, with the goal of maximizing the F1 score of positive samples, use the training set to optimize the hyperparameters of multiple sub-models, and obtain the hyperparameter combination corresponding to each sub-model.

[0080] Specifically, step S301 includes:

[0081] Step S3011: Initialize the search space of the hyperparameters to be optimized, and use a probabilistic surrogate model to fit the mapping relationship between the hyperparameter combination and the predicted F1 score of the positive class samples.

[0082] Specifically, based on the algorithmic characteristics of the selected classifier, the search space X for initializing the hyperparameters to be optimized is determined, i.e., the range of values ​​for the model hyperparameters (e.g., learning rate, maximum depth, regularization coefficient, etc. for a tree model). A probabilistic surrogate model (e.g., a Gaussian process model) is then used to fit the hyperparameter combination. With optimization objectives The mapping relationship between them. Among them, This represents the F1 score prediction of the surrogate model for positive class samples on the training set. The probabilistic surrogate model can predict the mean performance and uncertainty of unsearched regions based on existing evaluation results.

[0083] Step S3012: Based on the predicted mapping relationship fitted by the surrogate model, find the optimal combination of hyperparameters that maximizes the F1 score of the positive class samples through iterative search.

[0084] Specifically, based on the posterior distribution of the probabilistic surrogate model, in the validation set, a collection function (e.g., Expected Improvement (EI)) is used to evaluate the expected contribution of each hyperparameter combination in the search space to improving model performance. The hyperparameter combination with the largest expected contribution is selected to obtain the true F1 score for the positive class. Subsequently, this evaluation result (hyperparameter combination and its corresponding positive class F1 score) is added as a new sample to the historical dataset to update the posterior distribution of the probabilistic surrogate model, gradually optimizing the surrogate model's fit to the performance mapping relationship.

[0085] Repeat the above iterative process of evaluation, selection, training, and feedback until the preset number of iterations or the target performance index converges, and finally output the optimal hyperparameter combination with the highest positive class F1 score among all evaluation combinations.

[0086] The method for identifying illegal rooftop constructions on existing urban buildings provided in this embodiment aims to maximize the F1 score of positive class samples. This metric simultaneously considers the precision and recall of illegal construction identification, precisely addressing scenarios with few illegal construction samples and class imbalance, avoiding missed or false positives caused by single-dimensional optimization. By fitting the mapping relationship between hyperparameters and F1 scores using a probabilistic surrogate model and combining it with a data acquisition function to select high-contribution hyperparameter combinations, the optimal solution can be efficiently locked without exhaustive search, reducing computational costs and optimization time. During the iteration process, the model mapping relationship is verified and dynamically adjusted based on the real F1 scores, ensuring the reliability and adaptability of the hyperparameter combinations. This allows each sub-model to fully mine illegal construction information from remote sensing features, significantly improving the performance of a single model.

[0087] Step S302: Use the validation set to perform posterior probability calibration on the output results of each sub-model, calculate the F1 score of positive class samples under different decision thresholds based on the predicted probability interval, establish the mapping relationship between F1 score and decision threshold, and determine the optimal decision threshold and corresponding optimal recall rate for each sub-model.

[0088] Specifically, step S302 includes:

[0089] Step S3021: Traverse the probability prediction interval, calculate the F1 score of positive class samples under different decision thresholds, and establish the mapping relationship between F1 score and decision threshold.

[0090] Specifically, the probability prediction interval refers to the probability range of all possible outputs of the model being [0,1]. The closer the value is to 1, the higher the probability that the sample belongs to the positive class (illegal construction), and the closer the value is to 0, the lower the probability. A step size is set, for example, at intervals of 0.01, to discretize [0,1] into a series of candidate decision thresholds (…). like 0.01, 0.02, 0.03...0.99, 1.0).

[0091] Calculate the F1 score of positive samples for each threshold. For each decision threshold, evaluate the classification performance of the sub-model on the validation set. For example, when the decision threshold is set to 0.3, count the number of samples with a predicted probability ≥ 0.3 that are actually illegal (true positive), the number of samples with a predicted probability ≥ 0.3 that are actually not illegal (false positive), and the number of samples with a predicted probability < 0.3 that are actually illegal (false negative). Then calculate the F1 score of the positive samples using the formula: F1 = 2 × true positive / (2 × true positive + false positive + false negative).

[0092] Each decision threshold is correlated with its calculated F1 score to construct a mapping table or performance trend curve between decision thresholds and F1 scores, such as... Figure 5The diagram shows the mapping relationship between the F1 score of positive class samples and the decision threshold. For example, a decision threshold of 0.3 corresponds to an F1 score of 0.91, and a decision threshold of 0.4 corresponds to an F1 score of 0.88. By establishing this mapping relationship, we can quantitatively evaluate the trade-off between precision (representing the level of false positives) and recall (representing the level of false negatives) and the overall classification performance of the sub-model under the decision threshold.

[0093] Step S3022: Extract the decision threshold corresponding to the maximum F1 score of the positive class sample based on the mapping relationship, and use it as the optimal decision threshold.

[0094] Specifically, based on the mapping relationship between the F1 score of positive class samples and the decision threshold, the decision threshold corresponding to the highest F1 score is found and set as the optimal decision threshold for the sub-model. : ,For example Figure 5 The maximum F1 score is 0.909, corresponding to a decision threshold of 0.308. The optimal decision thresholds for each sub-model are not necessarily the same. For example, the optimal decision threshold for the first sub-model is 0.308, while the optimal decision threshold for the second sub-model may be 0.28. This is just an example and is not a limitation.

[0095] The F1 score is the harmonic mean of precision and recall, representing a comprehensive indicator of the model's accuracy and completeness in identifying illegal structures. A maximum F1 score signifies that the sub-model, on the current validation set, has achieved an optimal balance between avoiding misclassification of normal rooftops and avoiding oversight of illegal structures. The optimal decision threshold represents the classification boundary where the sub-model achieves its best overall performance on the validation set.

[0096] Step S3023: Based on the maximum F1 score, locate the recall corresponding to the maximum F1 score in the precision-recall mapping graph of each sub-model, and use it as the optimal recall of the corresponding sub-model.

[0097] Specifically, for each model, a precision-recall (PR) mapping curve is plotted based on the validation set, as follows: Figure 6 As shown, each point on the curve corresponds to a specific F1 score, with the horizontal axis representing recall and the vertical axis representing precision. Mapping the maximum F1 score determined by the optimal decision threshold obtained in step S3032 onto this curve locates its corresponding horizontal axis value. This value represents the recall of the sub-model at its optimal overall performance (highest F1 score), defined as the recall rate of the model at the optimal decision threshold, i.e., the optimal recall rate. : For example, a threshold of 0.308 corresponds to a recall rate of 0.889, which means that when the sub-model applies this decision threshold to divide positive and negative samples, it can find 88.9% of the real illegal buildings.

[0098] Based on the optimal decision threshold, the corresponding recall value is determined in the precision-recall (PR) curve of each sub-model, and this value is marked as the optimal recall of that sub-model. This optimal recall represents the recall ability of a single model for illegal construction samples when the overall performance is optimal. It is used as the lower limit constraint value of recall when constructing subsequent ensemble models to ensure that the false negative risk of the ensemble model is not higher than the best level of any single model.

[0099] The method for identifying illegal rooftop constructions on existing urban buildings provided in this embodiment accurately finds the optimal decision threshold for the suitable sub-model by traversing the predicted probability interval and establishing a mapping relationship between the F1 score and the decision threshold. This avoids the adaptation defects of the default threshold in the scenario of imbalanced illegal construction samples. The threshold is determined with the goal of maximizing the F1 score, while taking into account the accuracy and recall rate of illegal construction identification. This provides key support for the performance optimization of the sub-model. The optimal recall rate is located based on the optimal threshold, which not only clarifies the upper limit of the recall capability of a single sub-model, but also lays the foundation for setting the lower limit of the recall rate for the subsequent integrated model and ensuring that the risk of missed illegal construction is controllable. This further improves the reliability and adaptability of the overall identification scheme and balances the contradiction between missed and false positives.

[0100] In some optional implementations, the outputs of each sub-model are calibrated using a validation set, including:

[0101] A calibration mapping function (such as the sigmoid function) is introduced to transform the original output of each sub-model into the true probability of positive samples. The calculation formula is as follows:

[0102]

[0103] in, The calibrated probability. This is the output of the uncalibrated atomic model. and These are scalar parameters obtained by fitting parameters to the validation set.

[0104] The method for identifying illegal rooftop constructions on existing urban buildings provided in this embodiment addresses the problem of discrepancies between the original output probabilities of sub-models and the true distribution caused by a small number of illegal construction samples and class imbalance. By introducing a calibration mapping function, the uncalibrated output results of each sub-model are transformed into positive class sample probabilities that fit the real scene. By fitting scalar parameters with a validation set, the prediction bias caused by data distribution deviations is accurately corrected, avoiding situations where the original output probabilities are too high or too low. The calibrated probabilities are more statistically interpretable and can truly reflect the possibility of illegal constructions on the target building.

[0105] Step S303: Extract the maximum value of the optimal recall rate of all sub-models as the lower bound of the recall rate of the ensemble model, and determine the optimal weight combination of each sub-model with the constraint of weight normalization and lower bound of recall rate, aiming to maximize the F1 score of positive class samples of the ensemble model.

[0106] Specifically, step S303 includes:

[0107] Step S3031: Introduce weighting coefficients into the conventional probabilistic graphical model to construct an improved probabilistic graphical model, the expression of which is:

[0108]

[0109] in, This indicates that multiple sub-models have been calibrated for the samples. The overall predicted probability, For the first After calibration, the sub-models were used on the samples. The predicted probability, These are the corresponding weights for the sub-models.

[0110] Specifically, conventional probabilistic fusion models (such as the classic Noisy-OR model) typically assume that each sub-model contributes equally to the result, without considering the performance differences between sub-models. If directly fused, poorly performing sub-models may introduce noise into the ensemble model. When multiple sub-models make low-confidence judgments, the joint probability output by the ensemble model will be artificially inflated, leading to misjudgments. Therefore, it is necessary to assign differentiated weights based on the performance of the sub-models. Higher weights should be given to high-performing sub-models to allow them to dominate the ensemble model's decisions, while the weights of low-performing sub-models should be reduced, thereby ensuring and improving the overall prediction accuracy of the ensemble model.

[0111] In the above expression, This represents the overall probability of illegal construction predicted by the ensemble model for the building to be detected. For example, a result of 0.85 indicates that there is an 85% probability that illegal construction exists. This represents the total number of sub-models. For example, if there are three heterogeneous sub-models, then... ; This means that the weight of each sub-model cannot be less than 0.

[0112] A fusion rule that can dynamically adjust the contribution of sub-models is constructed. The improved Noisy-OR model achieves nonlinear probability fusion through weighted product operation, providing a basic framework for subsequent optimal weight search. Its search process is defined as an optimization problem with the goal of maximizing the F1 score of the ensemble model and satisfying the constraints of weight normalization and recall lower bound.

[0113] Step S3032: Using a multi-stage grid search strategy, with weight normalization and recall lower bound as constraints, and aiming to maximize the F1 score of positive class samples in the ensemble model, the optimal weight combination of each sub-model is determined.

[0114] Specifically, to adjust the contribution of each sub-model to the final result based on their different predictive performance, weights need to be set to maximize the positive class F1 score of the ensemble model. This requires finding the optimal weight combination in the improved Noisy-OR model. and the optimal decision threshold of the ensemble learning model Design a multi-stage grid search strategy that, under the condition of satisfying the weight normalization constraint (i.e., the sum of the weights of all sub-models is 1), aims to achieve a recall rate that is not lower than the recall floor. As a constraint, the goal is to maximize the F1 score of the ensemble model, and the weight combination is optimized.

[0115] When assigning weights to each sub-model, three constraints must be met: the weight range of each sub-model is [0,1], and the sum of the weights is 1; the recall of the ensemble model must not be less than the lower limit of recall to ensure that no illegal samples are missed; and the positive class samples of the ensemble model have the highest F1 score.

[0116] Extract the optimal recall rate for each sub-model, and use the maximum recall rate of all sub-models as the lower bound of the recall performance of the ensemble model, also known as the recall floor. This is to ensure that the recall rate of the ensemble model for positive samples is no less than that of any of the sub-models. , .

[0117] The method for identifying illegal rooftop constructions on existing urban buildings provided in this embodiment improves the model by introducing weight coefficients into the probabilistic graphical model. This allows for flexible adjustment of the contribution of each sub-model, avoiding the impact of single-model defects on the overall result and solving the problem of artificially high joint probabilities that often occur in traditional fusion methods. By using weight normalization and recall lower bounds as constraints, the method ensures that the weight allocation of the integrated model is reasonable and not lower than the recall capability of the optimal sub-model, effectively controlling the risk of missed detection of illegal constructions. The multi-stage grid search strategy combines coarse and fine searches to accurately locate the optimal weight combination that maximizes the F1 score of the integrated model, achieving a balance between high recall and low false positive rate.

[0118] In some optional implementations, weight combination optimization is performed to determine the optimal weight combination for each sub-model, including:

[0119] Step a1: Within the first preset weight range, traverse multiple weight combinations with the length of the first step.

[0120] Specifically, the first step is set to a length of 0.1, and the weight combinations of each sub-model are traversed within the preset weight range [0,1]. For example... Figure 7 The diagram shows the process of optimal weight combination search and probability fusion.

[0121] Step a2: Iterate through each weight combination, perform probability fusion using the improved probabilistic graphical model, and calculate the recall corresponding to different decision thresholds. Under the condition that the recall is not less than the lower limit of recall, determine the weight combination and decision threshold when the F1 score of the positive class sample is maximized.

[0122] Specifically, for each weight combination, the improved Noisy-OR model is substituted into it for probability fusion, the prediction probability of the ensemble model is calculated, and the precision, recall, and F1 score are calculated iteratively under different decision thresholds. The recall rate is then satisfied. Under the given parameter combinations, search for the weight combination that maximizes the F1 score. (As the initial optimal weights in the coarse search phase) and the decision threshold t ,Will As the initial optimal solution, the recall rate of this coarse search weight model is used as the recall floor for the fine search stage.

[0123] Step a3: Within the second preset weight range, traverse multiple weight combinations with a second step length, and repeat the traversal of each weight combination. Use the improved probabilistic graphical model to perform probability fusion, and calculate the recall corresponding to different decision thresholds. Under the condition that the recall is not less than the lower limit of recall, determine the weight combination and decision threshold when the F1 score of the positive class sample is maximized, and obtain the optimal weight combination and decision threshold. The second step length is less than the first step length.

[0124] Specifically, the second preset weight range is smaller than or lower than the preset weight range. A small search interval is defined centered on the initially optimal weights obtained from the coarse search. For example, if the initially optimal weights are (0.4, 0.3, 0.3), then the interval is ±0.1 for each weight. That is, the weights of the first sub-model are 0.3-0.5, the second sub-model is 0.2-0.4, and the third sub-model is 0.2-0.4. The search step size is reduced to a second step size of 0.02 for traversal. Probability fusion is also performed based on the improved Noisy-OR model. Consistent with the coarse search, the optimal weight combination that maximizes the F1 score is determined while satisfying the recall floor. With the optimal decision threshold Otherwise, the recall floor is selected as the optimal solution, and the final optimal solution is obtained at this stage. .

[0125] After multi-stage weight search, the optimal weight combination is utilized. and optimal decision threshold Configure and solidify the integration model. Figure 8 Taking three sub-models as an example, the search logic and core concepts of this weight allocation are intuitively demonstrated, effectively determining the optimal weight combination and achieving high-precision identification of illegal roof constructions. The three vertices and sides of the triangle represent the weights of the three sub-models respectively. The values ​​of these three factors are all between 0 and 1, and their sum is always 1, satisfying the weight normalization constraint. The feasible region of the ensemble model that satisfies the lower limit of recall and the infeasible region that does not satisfy the recall constraint are defined by the recall constraint boundary line. The coarse / fine search space illustrates the search range of the two stages, where the fine search space is a small area near the initial solution after the coarse search has locked it. The F1 score distribution represents the different weight combinations in the weight space that enable the ensemble model to obtain the same F1 score. The optimal solution of the weight combination that satisfies the constraint is the point with the highest F1 score in the feasible region. If a weight solution that strictly satisfies the recall constraint cannot be found in the feasible region, the weight combination with the highest F1 score is selected from the region closest to the constraint boundary as the optimal solution (red dot in the figure), maximizing the F1 score while maximizing the recall constraint.

[0126] In some alternative implementations, if the recall rate cannot meet the condition of not being less than the lower limit of recall rate, the optimal weight combination and decision threshold are determined based on the lower limit of recall rate.

[0127] Specifically, if no combination is found that satisfies the recall rate being no less than the lower limit, the weight combination with the recall rate closest to the lower limit is directly selected as the preliminary optimal solution to avoid search failure.

[0128] The method for identifying illegal rooftop constructions on existing urban buildings provided in this embodiment utilizes a larger first-step length for coarse search, quickly traversing the preset weight range to initially lock in weight intervals close to the optimal solution, avoiding blind search. A smaller second-step length is then used for fine search, accurately identifying the optimal weight combination, balancing the needs of global exploration and local optimization. With a recall rate not less than a lower limit as a constraint, the method ensures the integrated model's ability to detect all illegal construction samples, effectively controlling the risk of missed detections. Maximizing the F1 score is the objective, adapting weight allocation to the performance differences of each sub-model, achieving a balance between high recall and low false positive rate. For cases where the recall rate is insufficient, the optimal solution is directly determined based on the lower limit of the recall rate, ensuring that usable model parameters can still be output even in extreme cases, guaranteeing the robustness and practicality of the solution.

[0129] Step S304: Perform probabilistic fusion retraining based on the optimal weight combination and optimal decision threshold of each sub-model to obtain the integrated model. Use the integrated model to identify whether there are illegal constructions on the roof of the target building.

[0130] Specifically, the remote sensing feature set extracted by the method described in step S301 for the target building to be detected is input into the integrated model. The integrated model outputs the probability of illegal construction prediction. If the probability is greater than the optimal decision threshold, it is determined that there is illegal construction.

[0131] In one specific embodiment, taking the fusion of three sub-models as an example, the optimal weight combination obtained by applying multi-segment weight search is described. and optimal threshold The model is retrained using probabilistic fusion to obtain an ensemble model that balances recall and false positive rate (i.e., maximizing recall and maximizing F1 score). The performance comparison results between the ensemble model and the sub-models are as follows: Figure 9 As shown.

[0132] This embodiment also provides a device for identifying illegal rooftop constructions on existing urban buildings. This device is used to implement the above embodiments and preferred embodiments, and details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0133] This embodiment provides a device for identifying illegal rooftop constructions on existing urban buildings, such as... Figure 10 As shown, it includes:

[0134] The feature acquisition and sub-model training module 1001 is used to acquire optical remote sensing image data of the roof of the target building, extract feature sets representing the illegal construction attributes of the roof of the target building based on the optical remote sensing image data, construct a sample set containing positive illegal construction samples and negative non-illegal construction samples, divide the sample set into training set and validation set, aim to maximize the F1 score of positive samples, use the training set to optimize the hyperparameters of multiple sub-models, and obtain the hyperparameter combination corresponding to each sub-model.

[0135] The optimal parameter determination module 1002 is used to perform posterior probability calibration on the output results of each sub-model using the validation set, calculate the F1 score of positive class samples under different decision thresholds based on the predicted probability interval, establish the mapping relationship between F1 score and decision threshold, and determine the optimal decision threshold and corresponding optimal recall rate for each sub-model.

[0136] The optimal weight combination determination module 1003 is used to extract the maximum value among the optimal recall rates of all sub-models as the lower bound of the recall rate of the ensemble model. With the normalization of sub-model weights and the lower bound of recall rate as constraints, and with the goal of maximizing the F1 score of the positive class samples of the ensemble model, the optimal weight combination of each sub-model is determined.

[0137] The illegal construction identification module 1004 is used to perform probabilistic fusion retraining based on the optimal weight combination and optimal decision threshold of each sub-model to obtain an integrated model, and to use the integrated model to identify whether there is illegal construction on the roof of the target building.

[0138] In some alternative implementations, the sub-model training module 1001 includes:

[0139] The prediction mapping fitting unit is used to initialize the search space of the hyperparameters to be optimized and to fit the mapping relationship between the hyperparameter combination and the predicted F1 score of the positive class samples using a probabilistic surrogate model.

[0140] The model training unit is used to find the optimal combination of hyperparameters that maximizes the F1 score of positive class samples through iterative search based on the mapping relationship fitted by the surrogate model.

[0141] In some optional implementations, the optimal parameter determination module 1002 includes:

[0142] The mapping relationship establishment unit is used to traverse the probability prediction interval, calculate the F1 score of positive class samples under different decision thresholds, and establish the mapping relationship between the F1 score and the decision threshold.

[0143] The optimal threshold determination unit is used to extract the decision threshold corresponding to the maximum F1 score of the positive class sample based on the mapping relationship, and use it as the optimal decision threshold.

[0144] The optimal recall determination unit is used to locate the recall corresponding to the maximum F1 score in the precision-recall mapping relationship of each sub-model based on the maximum F1 score, and use it as the optimal recall of the corresponding sub-model.

[0145] In some optional implementations, the optimal weight combination determination module 1003 includes:

[0146] An improved probabilistic graphical model building unit is introduced to introduce weight coefficients into a conventional probabilistic graphical model to construct an improved probabilistic graphical model.

[0147] The multi-stage grid search unit is used to optimize the weight combination by using a multi-stage grid search strategy, with weight normalization and recall lower bound as constraints, and with the goal of maximizing the F1 score of the positive class samples of the ensemble model. This optimizes the weight combination of each sub-model.

[0148] The rooftop illegal construction identification device for existing urban buildings provided in this embodiment of the invention can execute the rooftop illegal construction identification method for existing urban buildings provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method. Further functional descriptions of the above modules and units are the same as in the corresponding embodiments described above, and will not be repeated here.

[0149] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.

[0150] The following is a detailed reference. Figure 11 The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, a graphics processing unit, etc.) 1101, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1102 or a program loaded from memory 1108 into random access memory (RAM) 1103. The RAM 1103 also stores various programs and data required for the operation of the electronic device. The processor 1101, ROM 1102, and RAM 1103 are interconnected via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.

[0151] Typically, the following devices can be connected to I / O interface 1105: input devices 1106 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 1107 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 1108 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1109. Communication device 1109 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 11 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.

[0152] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 1109, or installed from a memory 1108, or installed from a ROM 1102. When the computer program is executed by the processor 1101, it performs the functions defined in the method for identifying illegal rooftop constructions on existing urban buildings according to embodiments of the present invention.

[0153] Figure 11 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.

[0154] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the method for identifying illegal rooftop constructions on existing urban buildings shown in the above embodiments is implemented.

[0155] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0156] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for identifying illegal rooftop constructions on existing urban buildings, characterized in that, The method includes: Acquire optical remote sensing image data of the roof of the target building, extract feature set representing the illegal construction attributes of the roof of the target building based on the optical remote sensing image data, construct a sample set containing positive illegal construction samples and negative non-illegal construction samples, divide the sample set into training set and validation set, take maximizing the F1 score of positive samples as the objective, use the training set to optimize the hyperparameters of multiple sub-models, and obtain the hyperparameter combination corresponding to each sub-model; The output results of each sub-model are calibrated using the validation set, and the F1 score of positive class samples under different decision thresholds is calculated based on the predicted probability interval. The mapping relationship between F1 score and decision threshold is established, and the optimal decision threshold and corresponding optimal recall rate of each sub-model are determined. Extract the maximum value among the optimal recall rates of all sub-models as the lower bound of the ensemble model's recall rate. Using sub-model weight normalization and the lower bound of recall rate as constraints, and aiming to maximize the F1 score of the positive class samples in the ensemble model, determine the optimal weight combination for each sub-model. This includes introducing weight coefficients into the conventional probabilistic graphical model to construct an improved probabilistic graphical model, expressed as: in, This indicates that multiple sub-models have been calibrated for the samples. The overall predicted probability, For the first After calibration, the sub-models were used on the samples. The predicted probability, For the first The weights of each sub-model This represents the total number of sub-models. Using a multi-stage grid search strategy, with weight normalization and recall lower bound as constraints, and aiming to maximize the F1 score of the positive class samples in the ensemble model, the optimal weight combination for each sub-model is determined. This includes: within a first preset weight range, traversing multiple weight combinations with a first step length; traversing each weight combination, performing probability fusion using an improved probabilistic graphical model, and simultaneously calculating the recall corresponding to different decision thresholds; under the condition that the recall is not less than the recall lower bound, determining the weight combination and decision threshold when the F1 score of the positive class samples is maximized; within a second preset weight range, traversing multiple weight combinations with a second step length, and repeatedly traversing each weight combination, performing probability fusion using an improved probabilistic graphical model, and simultaneously calculating the recall corresponding to different decision thresholds; under the condition that the recall is not less than the recall lower bound, determining the weight combination and decision threshold when the F1 score of the positive class samples is maximized, thus obtaining the optimal weight combination and decision threshold. The second step length is less than the first step length. The integrated model is obtained by probabilistic fusion retraining based on the optimal weight combination and optimal decision threshold of each sub-model. The integrated model is then used to identify whether there are illegal constructions on the roof of the target building.

2. The method according to claim 1, characterized in that, With the objective of maximizing the F1 score of positive class samples, the hyperparameters of multiple sub-models are optimized using the training set to obtain the hyperparameter combinations corresponding to each sub-model, including: Initialize the search space of the hyperparameters to be optimized, and use a probabilistic surrogate model to fit the mapping relationship between the hyperparameter combination and the predicted F1 score of the positive class samples; Based on the predicted mapping relationship fitted by the surrogate model, the optimal combination of hyperparameters that maximizes the F1 score of positive class samples is found through iterative search.

3. The method according to claim 1, characterized in that, The output results of each sub-model are calibrated using the validation set, including: A calibration mapping function is introduced to transform the original output of each sub-model into the true probability of positive samples. The calculation formula is as follows: in, The calibrated probability. This is the output of the original model before calibration. and These are scalar parameters obtained by fitting parameters to the validation set.

4. The method according to claim 1 or 3, characterized in that, Based on the predicted probability interval, the F1 score of positive class samples under different decision thresholds is calculated, the mapping relationship between F1 score and decision threshold is established, and the optimal decision threshold and corresponding optimal recall rate of each sub-model are determined, including: Traverse the probability prediction interval, calculate the F1 score of positive class samples under different decision thresholds, and establish the mapping relationship between F1 score and decision threshold; Based on the mapping relationship, the decision threshold corresponding to the maximum F1 score of the positive class sample is extracted as the optimal decision threshold; Based on the maximum F1 score, the recall corresponding to the maximum F1 score is located in the precision-recall relationship of each sub-model, and is taken as the optimal recall of the corresponding sub-model.

5. The method according to claim 1, characterized in that, If the recall rate cannot meet the condition of being no less than the lower limit of recall rate, then the optimal weight combination and decision threshold are determined based on the lower limit of recall rate.

6. A device for identifying illegal rooftop constructions on existing urban buildings, characterized in that, The device includes: The feature acquisition and sub-model training module is used to acquire optical remote sensing image data of the roof of the target building, extract feature sets representing the illegal construction attributes of the roof of the target building based on the optical remote sensing image data, construct a sample set containing positive illegal construction samples and negative non-illegal construction samples, divide the sample set into a training set and a validation set, maximize the F1 score of the positive samples, and use the training set to optimize the hyperparameters of multiple sub-models to obtain the hyperparameter combination corresponding to each sub-model. The optimal parameter determination module is used to perform posterior probability calibration on the output results of each sub-model using the validation set, calculate the F1 score of positive class samples under different decision thresholds based on the predicted probability interval, establish the mapping relationship between F1 score and decision threshold, and determine the optimal decision threshold and corresponding optimal recall rate for each sub-model. The optimal weight combination determination module extracts the maximum value among the optimal recall rates of all sub-models as the lower bound of the ensemble model's recall rate. Using sub-model weight normalization and the lower bound of recall rate as constraints, and aiming to maximize the F1 score of the positive class samples in the ensemble model, it determines the optimal weight combination for each sub-model. This includes introducing weight coefficients into the conventional probabilistic graphical model to construct an improved probabilistic graphical model, expressed as: in, This indicates that multiple sub-models have been calibrated for the samples. The overall predicted probability, For the first After calibration, the sub-models were used on the samples. The predicted probability, For the first The weights of each sub-model This represents the total number of sub-models. Using a multi-stage grid search strategy, with weight normalization and recall lower bound as constraints, and aiming to maximize the F1 score of the positive class samples in the ensemble model, the optimal weight combination for each sub-model is determined. This includes: within a first preset weight range, traversing multiple weight combinations with a first step length; traversing each weight combination, performing probability fusion using an improved probabilistic graphical model, and simultaneously calculating the recall corresponding to different decision thresholds; under the condition that the recall is not less than the recall lower bound, determining the weight combination and decision threshold when the F1 score of the positive class samples is maximized; within a second preset weight range, traversing multiple weight combinations with a second step length, and repeatedly traversing each weight combination, performing probability fusion using an improved probabilistic graphical model, and simultaneously calculating the recall corresponding to different decision thresholds; under the condition that the recall is not less than the recall lower bound, determining the weight combination and decision threshold when the F1 score of the positive class samples is maximized, thus obtaining the optimal weight combination and decision threshold. The second step length is less than the first step length. The illegal construction identification module is used to perform probabilistic fusion retraining based on the optimal weight combination and optimal decision threshold of each sub-model to obtain an integrated model, which is then used to identify whether there are illegal constructions on the roof of the target building.

7. An electronic device, characterized in that, include: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of any one of claims 1 to 5.