Construction method, classification method and device of waterlogging early warning classification model
Patent Information
- Application Number
- CN202611258257.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]本发明提供了一种内涝预警分类模型的构建方法、内涝预警分类方法、装置、电子设备、存储介质及程序产品,以解决内涝预警复核效率低的问题
[0019]本发明实施例提供了一种内涝预警分类模型的构建方法及内涝预警分类方法,通过对历史内涝报警数据和降雨数据进行整理与分析,提取报警持续时间、报警差值、阈值相对偏差、日累计降雨量、是否降雨等多个特征,并通过特征工程进行扩展。在此基础上,构建包含第一判断模型和第二判断模型的内涝预警分类模型,其中第一判断模型用于拟合内涝预警指标中的线性特征,第二判断模型用于拟合内涝预警指标中的非线性特征。通过寻优算法确定两个判断模型的模型参数、融合权重系数以及概率阈值,利用训练后的模型对新的内涝预警进行融合评估概率计算,并与概率阈值比较,从而自动判断该内涝预警是否为真实预警。由此,可以快速、低成本地识别内涝误报警,大幅减少人工复核的工作量和时间,提高城市内涝应急响应的效率和准确性。
Smart Images

Figure CN122925977A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of urban flooding early warning technology, specifically to a method for constructing an urban flooding early warning classification model, a classification method, and an apparatus thereof. Background Technology
[0002] In recent years, with the application and promotion of industrial internet technology in urban drainage and flood control, more and more cities have deployed monitoring equipment at flood-prone areas to collect data such as water level, flow rate, and rainfall in real time, and automatically trigger flood warnings based on preset thresholds. However, in actual operation, flood warning systems often generate a large number of false alarms due to factors such as sensor errors, environmental interference, and unreasonable threshold settings. Statistics show that the false alarm rate without manual verification is as high as approximately 60%, meaning that more than half of the warnings are not actual flood events. A large number of false alarms not only consume significant manpower for verification, but also may cause actual flood warnings to be submerged or not verified in a timely manner during rainfall, thus affecting the timeliness and accuracy of emergency response.
[0003] Currently, there are two main methods for handling false alarms about urban flooding: The first is manual verification, where staff check monitoring data or on-site conditions to confirm the authenticity of the alarm. However, this method is very time-consuming and labor-intensive, especially during periods of heavy rainfall when the number of alarms surges, making it difficult to complete manual verification in a timely manner and potentially delaying emergency response to real urban flooding events. The second method is to use automated system processes for comparison. For example, after an alarm is triggered, the system automatically retrieves surveillance video footage from the vicinity of the warning area, and the system or staff observe whether there is water accumulation on-site. If there is water accumulation, it is considered a real warning. However, this method is highly dependent on the coverage of video surveillance and the reading and analysis of video data, which not only increases the system construction cost and data processing time, but also makes it difficult to make effective judgments under poor video quality, nighttime, or severe weather conditions, making it difficult to implement this method on a large scale. Summary of the Invention
[0004] This invention provides a method for constructing a flood warning classification model, a flood warning classification method, a device, an electronic device, a storage medium, and a program product to solve the problem of low efficiency in flood warning verification.
[0005] In a first aspect, the present invention provides a method for constructing a waterlogging early warning classification model, wherein the waterlogging early warning classification model includes a first judgment model that fits the linear features of waterlogging early warning indicators and a second judgment model that fits the nonlinear features of waterlogging early warning indicators, and the method includes: Obtain a training sample set and a test sample set; wherein, the training sample set and the test sample set include urban flooding early warning indicators and their corresponding sample labels; The parameter combination of the urban flooding early warning classification model is determined by an optimization algorithm; wherein the parameter combination includes the model parameters of the first judgment model and the second judgment model, the fusion weight coefficient, and the probability threshold. Based on the parameter combination, the first judgment model and the second judgment model are trained respectively using the training sample set; The waterlogging warning indicators in the test sample set are input into the waterlogging warning classification model to obtain the fusion evaluation probability; wherein, the fusion evaluation probability is the result of weighted summation of the waterlogging probabilities generated by the first judgment model and the second judgment model according to the corresponding fusion weight coefficients; Using the probability threshold, the classification accuracy of the waterlogging early warning classification model is determined, and if the classification accuracy is greater than or equal to a preset threshold, the current waterlogging early warning classification model is determined to be a waterlogging early warning classification model.
[0006] In one alternative implementation, obtaining the training sample set and the test sample set includes: Obtain an initial sample set; wherein the initial sample set includes positive and negative samples characterizing urban flooding warnings; According to a preset ratio, the initial sample set is divided into an initial training sample set and an initial test sample set by random sampling. The initial training sample set and the initial test sample set are expanded using synthetic minority class oversampling technology and Gaussian noise to obtain a training sample set and a test sample set; wherein the number of positive samples in the training sample set is greater than the number of negative samples, and the deviation between the number of positive samples and the number of negative samples in the test sample set is less than or equal to a preset deviation.
[0007] In one alternative implementation, after obtaining the initial sample set, the method further includes: The original indices of each initial sample in the initial sample set are extended through feature engineering to obtain the extended indices of each initial sample. By concatenating the original indicators with the extended indicators, we obtain the flood warning indicators for each initial sample.
[0008] In one optional implementation, the waterlogging warning indicators from the test sample set are input into the waterlogging warning classification model to obtain the fusion evaluation probability, including: The waterlogging early warning indicators in the test sample set are input into the trained first judgment model and the second judgment model respectively to obtain the first waterlogging probability corresponding to the first judgment model and the second waterlogging probability corresponding to the second judgment model. The first waterlogging probability and the second waterlogging probability are weighted according to their corresponding fusion weight coefficients to obtain the fusion evaluation probability.
[0009] In one optional implementation, the classification accuracy of the urban flooding warning classification model is determined using the probability threshold, and if the classification accuracy is greater than or equal to a preset threshold, the current urban flooding warning classification model is determined to be an urban flooding warning classification model, including: Samples with a fusion evaluation probability greater than or equal to the probability threshold are identified as waterlogging samples; The classification accuracy of the waterlogging early warning classification model is determined based on the waterlogging samples and the waterlogging assessment labels. If the classification accuracy is greater than or equal to a preset threshold, the current urban flooding warning classification model will be determined as the urban flooding warning classification model.
[0010] In an optional implementation, the method further includes: If the classification accuracy is less than a preset threshold, the parameter combination of the urban flooding early warning classification model is regenerated through an optimization model. The waterlogging early warning classification model is trained based on the regenerated parameter combination, and the classification accuracy of the waterlogging early warning classification model is determined.
[0011] Secondly, the present invention provides a method for classifying urban flooding early warnings, the method comprising: Obtain the corresponding waterlogging warning indicators for waterlogging warnings; The waterlogging early warning indicators are respectively input into the first judgment model and the second judgment model in the waterlogging early warning classification model to obtain the first waterlogging probability and the second waterlogging probability; wherein, the waterlogging early warning classification model is constructed using the waterlogging early warning classification model construction method described in the first aspect of the above embodiments; The first waterlogging probability and the second waterlogging probability are weighted and summed according to their corresponding fusion weighting coefficients to obtain the fusion evaluation probability; If the probability of the fusion assessment is greater than or equal to the probability threshold, the current flood warning will be determined as a real warning.
[0012] In an optional implementation, the method further includes: If the probability of the fusion assessment is less than the probability threshold, the current flood warning will be determined as a false warning.
[0013] In one optional implementation, obtaining the waterlogging warning indicators corresponding to the waterlogging warning includes: Obtain the raw indicators corresponding to the urban flooding warning; The original indices are extended through feature engineering to obtain extended indices; By concatenating the original indicators with the extended indicators, we obtain the urban flooding early warning indicators.
[0014] Thirdly, the present invention provides a device for constructing an urban flooding early warning classification model, wherein the urban flooding early warning classification model includes a first judgment model that fits the linear features of urban flooding early warning indicators and a second judgment model that fits the nonlinear features of urban flooding early warning indicators, and the device includes: The sample acquisition module is used to acquire training sample sets and test sample sets; wherein, the training sample sets and the test sample sets include urban flooding early warning indicators and their corresponding sample labels; The parameter determination module is used to determine the parameter combination of the urban flooding early warning classification model through an optimization algorithm; wherein, the parameter combination includes the model parameters of the first judgment model and the second judgment model, the fusion weight coefficient, and the probability threshold; The model training module is used to train the first judgment model and the second judgment model respectively using the training sample set based on the parameter combination; The probability fusion module is used to input the waterlogging warning indicators in the test sample set into the waterlogging warning classification model to obtain the fusion evaluation probability; wherein, the fusion evaluation probability is the result of weighted summation of the waterlogging probabilities generated by the first judgment model and the second judgment model according to the corresponding fusion weight coefficients; The model determination module is used to determine the classification accuracy of the waterlogging early warning classification model using the probability threshold, and if the classification accuracy is greater than or equal to a preset threshold, the current waterlogging early warning classification model is determined to be a waterlogging early warning classification model.
[0015] Fourthly, the present invention provides a flood warning and classification device, the device comprising: The indicator acquisition module is used to acquire the waterlogging warning indicators corresponding to the waterlogging warning; The probability generation module is used to input the waterlogging warning indicators into the first judgment model and the second judgment model in the waterlogging warning classification model to obtain the first waterlogging probability and the second waterlogging probability; wherein, the waterlogging warning classification model is constructed using the waterlogging warning classification model construction method described in the first aspect of the above embodiments; The probability fusion module is used to sum the first waterlogging probability and the second waterlogging probability according to the corresponding fusion weight coefficients to obtain the fusion evaluation probability; The early warning classification module is used to determine the current urban flooding warning as a real warning when the fusion assessment probability is greater than or equal to the probability threshold.
[0016] Fifthly, the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method for constructing a waterlogging early warning classification model according to the first aspect or any corresponding embodiment described above, or the method for waterlogging early warning classification according to the second aspect or any corresponding embodiment described above.
[0017] In a sixth aspect, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method for constructing a flood warning classification model according to the first aspect or any corresponding embodiment thereof, or the method for flood warning classification according to the second aspect or any corresponding embodiment thereof.
[0018] In a seventh aspect, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the method for constructing a flood warning classification model according to the first aspect or any of its corresponding embodiments, or the method for flood warning classification according to the second aspect or any of its corresponding embodiments.
[0019] This invention provides a method for constructing a flood warning classification model and a flood warning classification method. By organizing and analyzing historical flood warning data and rainfall data, multiple features are extracted, including alarm duration, alarm difference, relative threshold deviation, daily cumulative rainfall, and whether rainfall occurred. These features are then expanded through feature engineering. Based on this, a flood warning classification model is constructed, comprising a first judgment model and a second judgment model. The first judgment model is used to fit the linear features of the flood warning indicators, while the second judgment model is used to fit the nonlinear features. An optimization algorithm is used to determine the model parameters, fusion weight coefficients, and probability thresholds of the two judgment models. The trained models are then used to perform a fusion evaluation probability calculation on new flood warnings and compare it with the probability thresholds to automatically determine whether the flood warning is a true warning. This allows for rapid and low-cost identification of false flood warnings, significantly reducing the workload and time required for manual review and improving the efficiency and accuracy of urban flood emergency response. Attached Figure Description
[0020] 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.
[0021] Figure 1 This is a flowchart illustrating the method for constructing a flood warning classification model according to an embodiment of the present invention.
[0022] Figure 2 This is a schematic diagram of the training process of an urban flooding early warning classification model provided in an embodiment of the present invention.
[0023] Figure 3(a) is a bar chart showing the number of positive and negative samples in the initial training sample set and the initial test sample set provided in an embodiment of the present invention.
[0024] Figure 3(b) is a bar chart showing the number of positive and negative samples in the training sample set and the test sample set provided in an embodiment of the present invention.
[0025] Figure 4 This is a comparison of ROC characteristic curves of different models provided in an embodiment of the present invention.
[0026] Figure 5 This is a comparison of PR feature curves for different models provided in an embodiment of the present invention.
[0027] Figure 6 This is a flowchart illustrating a method for classifying urban flooding warnings according to an embodiment of the present invention.
[0028] Figure 7 This is a structural block diagram of a device for constructing an urban flooding early warning classification model according to an embodiment of the present invention.
[0029] Figure 8 This is a structural block diagram of a flood early warning and classification device provided in an embodiment of the present invention.
[0030] Figure 9 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0031] 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.
[0032] 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.
[0033] In the field of urban flood monitoring, monitoring equipment such as water level gauges, flow meters, and rain gauges are typically deployed at flood-prone areas to collect flood-related data in real time. The monitoring system compares the collected water level or liquid level data with preset alarm thresholds. When the monitored value exceeds the threshold, an urban flood warning is automatically generated to remind relevant departments to take timely emergency response measures. A typical urban flood warning record often includes multiple indicators such as alarm duration, alarm difference, relative threshold deviation, daily cumulative rainfall, and whether it rained. Among them, alarm duration indicates the length of time the monitored value has exceeded the threshold; alarm difference indicates the extent to which the monitored value exceeds the threshold; relative threshold deviation indicates the relative degree to which the monitored value deviates from the threshold; and daily cumulative rainfall and whether it rained reflect the rainfall environment conditions that led to the flooding.
[0034] In actual operation, due to factors such as environmental interference, equipment drift, or changes in installation location, the monitoring data may fluctuate abnormally, causing the monitored value to momentarily exceed the threshold and trigger an early warning, even though no actual water accumulation has occurred on site. Alternatively, because the threshold settings do not fully consider the differences in terrain and drainage capacity of different flood-prone areas, some early warnings, even under rainfall conditions, may show monitoring data exceeding the threshold, but the extent, depth, or duration of water accumulation may not reach the level requiring emergency response. These factors collectively lead to a large number of false alarms in urban flood monitoring systems. According to statistics, the false alarm rate without manual verification is as high as about 60%, meaning that for every 10 flood warnings generated, about 6 are not actual flood events. A large number of false alarms not only increases the workload of manual verification, but also, during periods of heavy rainfall, the mixing of real flood events with false alarms may delay emergency response to actual flooding if verification is not timely.
[0035] Currently, handling false alarms related to urban flooding mainly relies on two methods: manual verification and video verification. Manual verification involves staff reviewing alarm data, on-site photos, or videos one by one to confirm whether actual flooding has occurred. While this method is relatively accurate, it is extremely time-consuming and labor-intensive, especially when a large number of alarms are generated in a short period, making it difficult for staff to process them all promptly and potentially missing the optimal emergency response window. Video verification involves the system automatically retrieving surveillance video footage from the vicinity of the warning area after an alarm is triggered, allowing staff or image recognition algorithms to observe whether water accumulation exists on-site. However, this method is highly dependent on the coverage of the video surveillance equipment and the quality of the video data, and the video reading and analysis process is time-consuming, increasing system construction and maintenance costs. The accuracy of video verification also decreases significantly at night, in rainy or foggy weather, or when the video is obstructed, making this method difficult to implement on a large scale.
[0036] In-depth analysis of historical flooding alarm data reveals differences between genuine and false alarms in several data characteristics. For example, genuine flooding is often accompanied by large alarm discrepancies, long alarm durations, and typically significant daily rainfall; while false alarms may be triggered by momentary interference, with short durations, small alarm discrepancies, or even in the absence of rainfall or with minimal rainfall. However, the relationship between these characteristics and alarm authenticity is not a simple linear one. Complex nonlinear couplings may exist between certain characteristics, such as the interaction between alarm discrepancies and relative deviations from thresholds, and the nonlinear modulating effect of rainfall on alarm duration. Current technologies have not effectively utilized these historical data characteristics for the automatic identification of false flooding alarms, failing to fully uncover the patterns inherent in the alarm data.
[0037] Based on this, this invention provides a method for constructing a flood warning classification model and a flood warning classification method. By organizing and analyzing historical flood warning data and rainfall data, multiple features are extracted, including alarm duration, alarm difference, relative threshold deviation, daily cumulative rainfall, and whether rainfall occurred. These features are then expanded through feature engineering. Based on this, a flood warning classification model is constructed, comprising a first judgment model and a second judgment model. The first judgment model is used to fit the linear features in the flood warning indicators, and the second judgment model is used to fit the nonlinear features. An optimization algorithm is used to determine the model parameters, fusion weight coefficients, and probability thresholds of the two judgment models. The trained models are then used to perform a fusion evaluation probability calculation on new flood warnings and compare it with the probability thresholds to automatically determine whether the flood warning is a true warning. This allows for rapid and low-cost identification of false flood warnings, significantly reducing the workload and time of manual review and improving the efficiency and accuracy of urban flood emergency response.
[0038] Please see Figure 1 and Figure 2 This invention provides a method for constructing an urban flooding early warning classification model. Figure 2 A schematic diagram of the urban flooding warning classification model according to an embodiment of the present invention is shown. The urban flooding warning classification model is used to identify whether an urban flooding warning is a true warning. Specifically, the urban flooding warning classification model includes a first judgment model and a second judgment model. The first judgment model is used to fit the linear features in the urban flooding warning indicators, and the second judgment model is used to fit the nonlinear features in the urban flooding warning indicators. By fusing the outputs of the two judgment models, the influence of both linear and nonlinear features on the authenticity of urban flooding warnings can be taken into account, thereby improving classification accuracy.
[0039] The method may include the following steps.
[0040] Step S110: Obtain a training sample set and a test sample set; wherein the training sample set and the test sample set include urban flooding early warning indicators and their corresponding sample labels.
[0041] In this embodiment, the training sample set and the test sample set include waterlogging warning indicators and their corresponding sample labels. Waterlogging warning indicators are data used to characterize waterlogging alarm features, and may include alarm duration, alarm difference, relative threshold deviation, daily cumulative rainfall, and whether it rained, etc. Sample labels are used to identify the true category of waterlogging alarms; for example, a true alarm is marked as "1", and a false alarm is marked as "0". The training sample set is used to train the waterlogging warning classification model, and the test sample set is used to evaluate the classification performance of the model.
[0042] Specifically, an initial sample set can be obtained from historical flood warning data and rainfall data. The initial sample set includes positive samples (real alarms) and negative samples (false alarms). According to a preset ratio, the initial sample set is divided into an initial training sample set and an initial test sample set through random sampling. After data balancing and augmentation, the training sample set and test sample set are obtained.
[0043] Step S120: Determine the parameter combination of the urban flooding early warning classification model through an optimization algorithm; wherein the parameter combination includes the model parameters of the first judgment model and the second judgment model, the fusion weight coefficient, and the probability threshold.
[0044] In this embodiment, the parameter combination includes the model parameters of the first judgment model, the model parameters of the second judgment model, the fusion weight coefficients, and the probability threshold. The optimization algorithm is an optimization algorithm used to search for the optimal parameter combination, which can automatically find the parameter combination that optimizes the model performance. For example, the optimization algorithm can be the Ant Colony Optimization Algorithm (ACO), but this embodiment of the invention does not limit the specific optimization algorithm.
[0045] Model parameters are used to configure the internal structure or training process of the first and second judgment models. Fusion weight coefficients are used to weight the flooding probabilities output by the two judgment models. A probability threshold is used to subsequently convert the fused evaluation probabilities into class labels. In a specific embodiment, as follows... Figure 2 The model architecture is shown below. The first decision model is a random forest model, and the second decision model is a 7-layer neural network model. A set of parameter combinations obtained using the ant colony optimization algorithm is shown in Table 1.
[0046] Table 1. Parameter combinations obtained using the ACO optimization algorithm
[0047] Step S130: Based on the parameter combination, train the first judgment model and the second judgment model respectively using the training sample set.
[0048] In this embodiment, during the training process of the first and second judgment models, the first judgment model learns to fit linear features based on the input urban flooding warning indicators, while the second judgment model learns to fit nonlinear features. After training, the first and second judgment models can respectively output the probability of urban flooding corresponding to the test samples.
[0049] Step S140: Input the waterlogging early warning indicators in the test sample set into the waterlogging early warning classification model to obtain the fusion evaluation probability; wherein, the fusion evaluation probability is the result of weighted summation of the waterlogging probabilities generated by the first judgment model and the second judgment model according to the corresponding fusion weight coefficients.
[0050] In this embodiment, the flood warning indicators are input into the first judgment model and the second judgment model respectively to obtain the first flood probability and the second flood probability. The fusion evaluation probability is the result of weighted summation of the first flood probability and the second flood probability according to their corresponding fusion weight coefficients. For example, the fusion evaluation probability can be expressed by the formula... Calculation. Among them, The probability of the first type of flooding is... The second highest probability of urban flooding. and These are the fusion weight coefficients corresponding to the first and second judgment models, respectively. In a specific embodiment, the fusion weight coefficients are obtained through the ant colony algorithm. It is 0.5640. It is 0.436.
[0051] Step S150: Using the probability threshold, determine the classification accuracy of the waterlogging early warning classification model, and if the classification accuracy is greater than or equal to the preset threshold, the current waterlogging early warning classification model is determined to be a waterlogging early warning classification model.
[0052] In this embodiment, the probability threshold is a critical value used to map the fusion evaluation probability to a category label. Specifically, when the fusion evaluation probability is greater than or equal to the probability threshold, the sample is determined to be a genuine warning; when the fusion evaluation probability is less than the probability threshold, the sample is determined to be a false warning.
[0053] The classification accuracy can be calculated by comparing the judgment result with the corresponding sample labels in the test sample set. Classification accuracy can be characterized by performance indicators such as precision, accuracy, recall, and F1 score; however, this embodiment of the invention does not specifically limit these metrics. A preset threshold is the minimum performance standard used to determine whether the classification accuracy meets the requirements. When the classification accuracy is greater than or equal to the preset threshold, the current urban flooding warning classification model is considered to have reached usable performance and is thus identified as an urban flooding warning classification model. In a specific embodiment, the probability threshold obtained through the ant colony algorithm is 0.2800. When the fusion evaluation probability is greater than or equal to 0.2800, it is determined to be a true warning; when the fusion evaluation probability is less than 0.2800, it is determined to be a false warning.
[0054] The method for constructing the urban flooding early warning classification model provided in the above embodiments fuses linear and nonlinear features by integrating a first judgment model and a second judgment model, respectively, and uses an optimization algorithm to determine model parameters, fusion weight coefficients, and probability thresholds. This enables the constructed urban flooding early warning classification model to quickly and accurately identify false alarms of urban flooding, reducing the workload and time cost of manual review and improving emergency response efficiency. Simultaneously, the automated parameter optimization process of this method avoids the tediousness of manual parameter tuning, reducing model construction costs.
[0055] In some embodiments, obtaining the training sample set and the test sample set in step S110 may include the following steps.
[0056] Step S111: Obtain an initial sample set; wherein the initial sample set includes positive and negative samples characterizing urban flooding warnings.
[0057] In this embodiment, the initial sample set is the original dataset used for subsequent training and testing of the urban flooding warning classification model. Specifically, the initial sample set can be obtained from historical urban flooding warning data and rainfall data. For example, urban flooding warning data and daily rainfall data from June 2024 to December 2025 can be collected, and the data from the two sources can be aligned and cleaned according to time to obtain valid data. The initial sample set obtained after alignment and cleaning may include 306 valid data points.
[0058] Positive samples are those representing genuine flood warnings. Specifically, samples corresponding to genuine warnings can be marked as "1". Negative samples are those representing false flood warnings. Specifically, samples corresponding to false warnings can be marked as "0". Positive and negative samples together constitute the initial sample set, which is used to train the flood warning classification model to identify the authenticity of flood warnings.
[0059] Step S112: According to a preset ratio, the initial sample set is divided into an initial training sample set and an initial test sample set by random sampling.
[0060] In this embodiment, the preset ratio is a pre-defined ratio between the number of training samples and the number of test samples. Specifically, the preset ratio can be determined based on factors such as the total number of samples and model training requirements. For example, the preset ratio can be 7:3, that is, 70.0% of the samples in the initial sample set are divided into the initial training sample set, and 30.0% of the samples are divided into the initial test sample set. This application embodiment does not limit the specific value of the preset ratio.
[0061] Random sampling is a statistical method used to divide an initial sample set into non-overlapping subsets. Specifically, random sampling can be stratified random sampling. Stratified random sampling divides the samples according to the distribution ratio of the sample labels, ensuring that the distribution of positive and negative samples in the initial training and initial test sets is largely consistent with the initial sample set. By using random sampling, sample partitioning bias can be reduced, improving the reliability of model training and evaluation.
[0062] The initial training sample set is the dataset used to train the urban flooding early warning classification model. The initial test sample set is the dataset used to evaluate the performance of the urban flooding early warning classification model. Both the initial training and initial test sample sets are derived from the initial sample set and have not yet undergone sample expansion.
[0063] Step S113: The initial training sample set and the initial test sample set are expanded using synthetic minority class oversampling technology and Gaussian noise to obtain a training sample set and a test sample set; wherein, the number of positive samples in the training sample set is greater than the number of negative samples, and the deviation between the number of positive samples and the number of negative samples in the test sample set is less than or equal to a preset deviation.
[0064] In this embodiment, synthetic minority oversampling is a data augmentation method used to increase the number of minority class samples. Specifically, synthetic minority oversampling can synthesize new minority class samples based on the proximity relationships of minority class samples in the feature space to improve the sample class imbalance problem. Specifically, synthetic minority oversampling can be used to increase the number of positive samples, making the distribution of positive and negative samples more balanced. In some embodiments, synthetic minority oversampling can be the SMOTE (Synthetic Minority Over-sampling Technique) algorithm; the specific implementation of synthetic minority oversampling is not limited in this application embodiment.
[0065] Sample expansion refers to the process of increasing the number of samples in a sample set. Specifically, sample expansion includes adding positive samples through synthetic minority class oversampling techniques, and generating perturbation samples by adding Gaussian noise to the flood warning indicators in the sample set. After expanding the initial training sample set and the initial test sample set respectively, a training sample set for training and a test sample set for testing are obtained.
[0066] Refer to Figure 3, which shows the sample distribution before and after sample expansion. Figure 3(a) shows the sample distribution before optimization using synthetic minority class oversampling. In this distribution, the number of negative samples in both the training and test sets is significantly greater than the number of positive samples, because most flood alarms are false alarms. Figure 3(b) shows the sample distribution after optimization using synthetic minority class oversampling. After sample expansion, the number of positive samples in the training set is significantly greater than the number of negative samples, and the number of training and test samples in the test set is approximately equal.
[0067] The number of positive samples in the training sample set is greater than the number of negative samples. Specifically, through sample expansion, the number of positive samples in the training sample set is increased to exceed the number of negative samples, achieving a relatively balanced state between the number of positive and negative samples in the training sample set, which is beneficial for the model to fully learn the features of positive samples. The deviation between the number of positive samples and the number of negative samples in the test sample set is less than or equal to a preset deviation. The preset deviation is a threshold used to limit the degree of difference between the number of positive and negative samples. Specifically, the difference between the number of positive samples and the number of negative samples in the test sample set can be controlled within the preset deviation range to ensure the objectivity and reliability of the test evaluation results. The preset deviation can be set according to actual needs; for example, the number of positive and negative samples in the test sample set can be basically equal, or the difference between the two can be less than or equal to the preset deviation. This embodiment of the invention does not limit the specific value of the preset deviation.
[0068] Through the above embodiments, the initial sample set is randomly sampled according to a preset ratio to divide it into an initial training sample set and an initial test sample set. The sample expansion is carried out by using synthetic minority class oversampling technology and Gaussian noise. In the case of a limited total number of samples and an imbalance between positive and negative samples, a balanced and more diverse training sample set and test sample set can be obtained. This improves the training stability and evaluation accuracy of the urban flooding early warning classification model and reduces model bias caused by sample imbalance.
[0069] In some embodiments, after step S111, the construction of the urban flooding early warning classification model may further include the following steps.
[0070] Step S1141: Extend the original indices of each initial sample in the initial sample set through feature engineering to obtain the extended indices of each initial sample.
[0071] In this embodiment, the original indicators refer to the initial feature indicators directly collected or extracted from the initial sample. Specifically, the original indicators may include alarm duration, alarm difference, threshold relative deviation, daily cumulative rainfall, and whether it rained, etc. Alarm duration indicates the length of time the monitored value continuously exceeds the alarm threshold; alarm difference indicates the difference between the current alarm monitored value and the alarm detection value of the first alarm; threshold relative deviation indicates the ratio of the difference between the current alarm monitored value and the alarm detection value of the first alarm to the set threshold; daily cumulative rainfall indicates the cumulative rainfall of the day; whether it rained indicates whether there was rainfall on the day. This embodiment of the invention does not limit the specific types and number of original indicators.
[0072] Feature engineering is a technique used to construct new features from original indicators. Specifically, feature engineering can include mathematical transformations, combinations, and encoding of original indicators to construct extended indicators that can more comprehensively and effectively express the characteristics of samples. Extended indicators refer to new feature indicators that are related to the original indicators and are constructed from them through feature engineering. By extending the original indicators through feature engineering, the implicit nonlinear relationships or combinatorial relationships in the original indicators can be made explicit, thereby enhancing the expressive power of the model.
[0073] For example, the number of original indicators can be 5. Feature engineering can expand these 5 original indicators to 20 categories, meaning the number of expanded indicators can be 15, resulting in 20 categories of flood warning indicators after concatenation. For instance, feature engineering may include performing square or logarithmic transformations on the alarm duration, binning the alarm difference, combining the relative deviation of the threshold with the daily cumulative rainfall, and performing a moving average on the daily cumulative rainfall. This embodiment of the invention does not limit the specific implementation of feature engineering or the number of expanded indicators.
[0074] Step S1142: Concatenate the original index with the extended index to obtain the flood warning index for each initial sample.
[0075] Concatenation refers to merging the original indicators and extended indicators along the feature dimension to form a flood warning indicator. Through concatenation, the flood warning indicator simultaneously includes both the original directly observed features and the derived features constructed through feature engineering, providing richer input information for the first and second judgment models.
[0076] See also Figure 2 , Figure 2 A schematic diagram of the urban flooding early warning classification model is shown. The urban flooding early warning indicators obtained by the above concatenation can be used as... Figure 2 The input features of the first and second judgment models in the waterlogging early warning classification model shown.
[0077] The above embodiments, through feature engineering extension and splicing, can make full use of the information in the existing original indicators without increasing the additional data collection cost, enrich the expressive power of the waterlogging early warning indicators, help improve the fitting ability of the waterlogging early warning classification model to linear and nonlinear features, and thus improve the accuracy of waterlogging false alarm identification.
[0078] In some embodiments, step S140, inputting the waterlogging warning indicators from the test sample set into the waterlogging warning classification model to obtain the fusion evaluation probability, may include the following steps.
[0079] Step S141: Input the waterlogging early warning indicators in the test sample set into the trained first judgment model and second judgment model respectively to obtain the first waterlogging probability corresponding to the first judgment model and the second waterlogging probability corresponding to the second judgment model.
[0080] In this embodiment, the first probability of flooding is the predicted probability output by the first judgment model for the input flooding warning indicator, used to characterize the likelihood that the flooding warning is a true warning. The second probability of flooding is the predicted probability output by the second judgment model for the input flooding warning indicator, used to characterize the likelihood that the flooding warning is a true warning.
[0081] Specifically, after training the first judgment model and the second judgment model using the training sample set based on the aforementioned parameter combination, both models possess the ability to predict urban flooding warning indicators. When the urban flooding warning indicators from the test sample set are input into the first and second judgment models respectively, the first judgment model can output a first probability of urban flooding based on its fitted linear features, and the second judgment model can output a second probability of urban flooding based on its fitted nonlinear features. The values of both the first and second probabilities of urban flooding can be in the range of [0,1], with larger values indicating a higher probability that the urban flooding warning is a true warning.
[0082] Step S142: Weight the first waterlogging probability and the second waterlogging probability according to the corresponding fusion weight coefficient to obtain the fusion evaluation probability.
[0083] In this embodiment, the fusion weight coefficient is a weighting coefficient used in the parameter combination to weight and fuse the waterlogging probabilities output by the first judgment model and the second judgment model. Specifically, the fusion weight coefficient corresponding to the first judgment model can be represented as w_1, and the fusion weight coefficient corresponding to the second judgment model can be represented as w_2. The fusion evaluation probability can be obtained by multiplying the first waterlogging probability and the second waterlogging probability by their respective fusion weight coefficients and then summing them. For example, the fusion evaluation probability can be calculated according to the following formula:
[0084] in, Indicates the probability of fusion evaluation. Indicates the probability of primary flooding. Indicates the probability of the second type of flooding. and These represent the fusion weight coefficients corresponding to the first judgment model and the second judgment model, respectively.
[0085] like Figure 2 As shown, the flood warning indicators in the test sample set are input into the first judgment model and the second judgment model, respectively. The first judgment model outputs the first flood probability, and the second judgment model outputs the second flood probability. The first and second flood probabilities are weighted and summed according to their corresponding fusion weight coefficients to obtain the fusion evaluation probability. The fusion evaluation probability is used to compare with the probability threshold to determine the classification accuracy of the flood warning classification model.
[0086] The above embodiments, by obtaining the waterlogging probabilities output by the first judgment model and the second judgment model respectively, and performing weighted fusion according to the corresponding fusion weight coefficients, can comprehensively consider the influence of linear and nonlinear features on the authenticity of the alarm, so that the fusion evaluation probability can more comprehensively reflect the possibility that the waterlogging warning is a real warning, thereby improving the classification accuracy of the waterlogging warning classification model.
[0087] In some embodiments, in step S150, the classification accuracy of the waterlogging warning classification model is determined using the probability threshold, and if the classification accuracy is greater than or equal to a preset threshold, the current waterlogging warning classification model is determined to be a waterlogging warning classification model, which may include the following steps.
[0088] Step S151: The samples whose fusion evaluation probability is greater than or equal to the probability threshold are identified as waterlogging samples.
[0089] In this embodiment, the flooding sample refers to a test sample that is determined by the flooding warning classification model to be a real flooding warning. Specifically, for each test sample in the test sample set, its fusion evaluation probability is compared with a probability threshold. When the fusion evaluation probability is greater than or equal to the probability threshold, the test sample is determined to be a flooding sample; when the fusion evaluation probability is less than the probability threshold, the test sample is determined to be a non-flooding sample, i.e., a false flooding warning. For example, the probability threshold can be 0.2800. When the fusion evaluation probability of a test sample is greater than or equal to 0.2800, the test sample is determined to be a flooding sample; when the fusion evaluation probability is less than 0.2800, the test sample is determined to be a non-flooding sample, i.e.:
[0090] in, This indicates the sample category determined by the urban flooding early warning classification model. Indicates the probability of fusion evaluation. This represents the optimal discrimination threshold, i.e., the probability threshold. When... When, it indicates that the corresponding test sample is determined to be a flood-affected sample; when When the time is right, it means that the corresponding test sample is determined to be a non-flood sample.
[0091] Step S152: Determine the classification accuracy of the waterlogging early warning classification model based on the waterlogging samples and the waterlogging assessment labels.
[0092] The flood assessment label refers to the true category label corresponding to each test sample in the test sample set. Specifically, the flood assessment label is the sample label, such as label "1" for a true alarm and label "0" for a false alarm. Classification accuracy is an indicator used to measure the classification performance of a flood warning classification model. Specifically, classification accuracy can be calculated by comparing the sample categories predicted by the model with the flood assessment labels. Classification accuracy can include one or more performance indicators such as precision, accuracy, recall, and F1 score. Among them, precision can be defined as the proportion of correctly classified samples out of the total number of test samples; accuracy can be defined as the proportion of true flood samples out of test samples identified as flood samples; recall can be defined as the proportion of true flood samples correctly identified as flood samples; and F1 score can be defined as the harmonic mean of precision and recall. This embodiment of the invention does not limit the specific type of classification accuracy indicator.
[0093] Please see Figure 4 , Figure 5 And Table 2, Figure 4 The diagram shows the ROC curves of a single random forest model (first judgment model), a single neural network model (second judgment model), and the urban flooding early warning classification model in this embodiment of the invention. Figure 4 The ROC curves of these three models are shown in Figure 1, and Table 2 compares the various performance indicators of the three models. By comparing the ROC curves, ROC curves, and various performance indicators in Table 2, the classification accuracy of the current urban flooding early warning classification model can be comprehensively evaluated.
[0094] Table 2 Comparison of performance metrics of different models
[0095] Step S153: If the classification accuracy is greater than or equal to a preset threshold, the current urban flooding warning classification model is determined as the urban flooding warning classification model.
[0096] In this embodiment, the preset threshold is the minimum performance requirement used to determine whether the classification accuracy meets the usable standard. Specifically, the preset threshold can be set in advance based on factors such as actual business needs, false alarm tolerance, and emergency response requirements. When the calculated classification accuracy is greater than or equal to the preset threshold, it indicates that the current urban flooding warning classification model has the required classification performance and can effectively identify false alarms related to urban flooding. Therefore, the current urban flooding warning classification model is determined as the urban flooding warning classification model. The urban flooding warning classification model is a model that has been trained and its performance verified, and can be used to automatically classify and identify newly generated urban flooding warnings.
[0097] The above embodiments determine waterlogging samples by comparing the fusion evaluation probability with a probability threshold, calculate the classification accuracy based on the waterlogging samples and waterlogging evaluation labels, and then determine whether the model is usable based on the comparison result of the classification accuracy with a preset threshold. This ensures that the final waterlogging early warning classification model has reliable classification performance, thereby effectively reducing false alarms and lowering the workload and time cost of manual review when applied to actual waterlogging early warning identification.
[0098] In some embodiments, after step S153, the method for constructing the urban flooding early warning classification model may further include step S154. Specifically, step S154 includes steps S1541 and S1542.
[0099] Step S1541: If the classification accuracy is less than a preset threshold, regenerate the parameter combination of the urban flooding early warning classification model through an optimization model.
[0100] In this embodiment, if the classification accuracy is less than a preset threshold, it indicates that the classification performance of the current urban flooding early warning classification model has not yet reached a usable standard, and the model parameters need further optimization. At this time, the optimization process can be restarted to search for a better combination of parameters.
[0101] An optimization model is an optimization model used to search for the optimal combination of parameters in a parameter space. Specifically, the optimization model can be an Ant Colony Optimization (ACO) model. The ACO model simulates the mechanism by which ants release pheromones during foraging and select paths based on pheromone concentrations to progressively search for the optimal combination of parameters for the objective function. In other embodiments, the optimization model can also be a particle swarm optimization model, a genetic algorithm model, a Bayesian optimization model, etc. This invention does not limit the specific type of optimization model.
[0102] The parameter combination is the set of parameters that need to be set for the waterlogging early warning classification model. Specifically, the parameter combination includes the model parameters of the first judgment model, the model parameters of the second judgment model, the fusion weight coefficients, and the probability threshold. The parameter combination is regenerated through the optimization model, which can update some parameters or update all parameters simultaneously. For example, when the classification accuracy is less than a preset threshold, the optimization model can search for neighboring regions in the parameter space based on the current parameter combination, or it can start optimizing again from a broader search range to obtain a new parameter combination.
[0103] Step S1542: Based on the regenerated parameter combination, train the waterlogging early warning classification model and determine the classification accuracy of the waterlogging early warning classification model.
[0104] In this embodiment, the first judgment model and the second judgment model can be configured according to the regenerated parameter combination. The first judgment model and the second judgment model can be retrained using the training sample set. Then, the waterlogging warning indicators in the test sample set are input into the retrained waterlogging warning classification model to obtain a new fusion evaluation probability. The fusion evaluation probability is classified according to the probability threshold in the regenerated parameter combination to calculate the new classification accuracy.
[0105] like Figure 2 As shown, the optimization model is located upstream of the urban flooding early warning classification model and is used to determine the parameter combination of the urban flooding early warning classification model. When the classification accuracy is less than a preset threshold, the optimization model can be rerun to output an updated parameter set to replace the corresponding parameters in Table 1 of the above embodiment.
[0106] Understandably, the aforementioned process of re-optimization, retraining, and re-evaluation can be iterative. That is, if the classification accuracy obtained after training based on the regenerated parameter combination is still less than the preset threshold, the parameter combination can be regenerated again through model optimization. This process is repeated until the classification accuracy is greater than or equal to the preset threshold, at which point the current urban flooding warning classification model is determined as the urban flooding warning classification model.
[0107] The above embodiments, by setting a preset threshold for classification accuracy and automatically triggering the optimization model to regenerate parameter combinations when the threshold is not met, can continuously optimize the parameter configuration of the urban flooding early warning classification model without manual intervention, allowing the model to gradually approach a better performance state. This reduces the complexity and time cost of manual parameter tuning while ensuring that the final urban flooding early warning classification model has the classification accuracy required for actual needs, thereby improving the reliability of urban flooding false alarm identification.
[0108] Please see Figure 6 This invention provides a method for classifying urban flooding early warnings. Figure 2A schematic diagram of the architecture of a flood warning classification model according to an embodiment of the present invention is shown. This flood warning classification method can be applied to urban flood monitoring systems to automatically classify and identify generated flood alarms and determine whether the flood alarm is a genuine warning. The method may include the following steps.
[0109] Step S210: Obtain the waterlogging warning indicators corresponding to the waterlogging warning.
[0110] In this embodiment, urban flooding warning refers to an alarm event triggered by the urban flooding monitoring system based on monitoring data. Flooding warning indicators are data used to characterize the features of the flooding alarm, and may include original indicators and extended indicators obtained by feature engineering. For example, flooding warning indicators may include alarm duration, alarm difference, threshold relative deviation, daily cumulative rainfall, whether rainfall occurred, and extended indicators constructed based on these original indicators. Specifically, the original indicators corresponding to the current flooding warning can be obtained from the flooding monitoring system, extended through feature engineering, and then concatenated with the extended indicators to obtain the current flooding warning indicator. In other embodiments, pre-concatenated flooding warning indicators can also be directly obtained; this embodiment of the invention does not limit this approach.
[0111] Step S220: Input the waterlogging early warning indicators into the first judgment model and the second judgment model in the waterlogging early warning classification model respectively to obtain the first waterlogging probability and the second waterlogging probability; wherein, the waterlogging early warning classification model is constructed using the construction method of the waterlogging early warning classification model described in any of the above embodiments.
[0112] In this embodiment, the urban flooding warning classification model includes a first judgment model and a second judgment model. The first judgment model is used to fit the linear features of the urban flooding warning indicators, and the second judgment model is used to fit the nonlinear features of the urban flooding warning indicators. The obtained urban flooding warning indicators are input into the first judgment model and the second judgment model, respectively. The first judgment model outputs a first urban flooding probability based on its fitted linear features, and the second judgment model outputs a second urban flooding probability based on its fitted nonlinear features. The first urban flooding probability and the second urban flooding probability respectively represent the probability that the corresponding model judges the current urban flooding warning to be a true warning.
[0113] Step S230: The first waterlogging probability and the second waterlogging probability are weighted and summed according to the corresponding fusion weight coefficients to obtain the fusion evaluation probability.
[0114] In this embodiment, the fusion weight coefficient is the optimal weight coefficient determined by an optimization algorithm during the construction of the urban flooding early warning classification model. For example, in the above embodiment of the urban flooding early warning classification model construction method, the fusion weight coefficient corresponding to the first judgment model determined by the optimization algorithm is 0.5640, and the fusion weight coefficient corresponding to the second judgment model is 0.436.
[0115] The probability of fusion assessment can be calculated using the following formula:
[0116] in, Indicates the probability of fusion evaluation. Indicates the probability of primary flooding. Indicates the probability of the second type of flooding. and These represent the fusion weight coefficients corresponding to the first judgment model and the second judgment model, respectively.
[0117] Step S240: If the fusion evaluation probability is greater than or equal to the probability threshold, the current flood warning is determined as a real warning.
[0118] In this embodiment, the probability threshold is the optimal discrimination threshold determined by an optimization algorithm during the construction of the urban flooding warning classification model. For example, in the above embodiment of the urban flooding warning classification model construction method, the probability threshold determined by the optimization algorithm can be 0.2800. When the fusion evaluation probability is greater than or equal to the probability threshold, it indicates that the probability of the current urban flooding warning being a real urban flooding event after fusion evaluation by the two judgment models reaches or exceeds the discrimination threshold. Therefore, the current urban flooding warning is determined to be a real warning, that is:
[0119] in, This indicates the sample category determined by the urban flooding early warning classification model. Indicates the probability of fusion evaluation. This represents the optimal discrimination threshold, i.e., the probability threshold. When... When, it indicates that the corresponding test sample is determined to be a flood-affected sample; when When the time is right, it means that the corresponding test sample is determined to be a non-flood sample.
[0120] The waterlogging early warning classification method provided in this invention uses a pre-constructed waterlogging early warning classification model to automatically classify and identify newly generated waterlogging early warnings. It can quickly determine the authenticity of an alarm without the need for manual review of alarm data or retrieval of video footage, thereby significantly reducing the workload and time cost of manual verification and improving the efficiency and accuracy of urban waterlogging emergency response.
[0121] In some embodiments, the waterlogging early warning classification method may further include step S250.
[0122] Step S250: If the fusion assessment probability is less than the probability threshold, the current flood warning is determined to be a false warning.
[0123] A false alarm refers to a situation where monitoring data triggers a flood warning, but no actual flooding or water accumulation occurs on-site, or the water accumulation level does not reach the point requiring emergency response. Specifically, after obtaining the fusion assessment probability corresponding to the current flood warning, this probability is compared with a probability threshold. When the fusion assessment probability is less than the probability threshold, it indicates that the probability of the current flood warning being a genuine flooding event, after being assessed by the two judgment models, has not reached the discrimination threshold; therefore, the current flood warning is determined to be a false alarm.
[0124] The above embodiments, by further limiting the judgment result when the fusion evaluation probability is less than the probability threshold in the waterlogging early warning classification method, can fully cover the two value cases of the fusion evaluation probability, enabling the waterlogging early warning classification model to clearly output the classification result of real or false early warning for each waterlogging early warning, thereby realizing automatic and rapid identification of false waterlogging alarms and reducing the workload and time cost of manual review.
[0125] In some embodiments, obtaining the waterlogging warning indicator corresponding to the waterlogging warning in step S210 may include the following steps.
[0126] Step S211: Obtain the raw indicators corresponding to the urban flooding warning.
[0127] In this embodiment, the raw indicators are initial characteristic indicators directly collected by the urban flooding monitoring system or extracted from monitoring data. Specifically, raw indicators may include alarm duration, alarm difference, threshold relative deviation, daily cumulative rainfall, and whether it has rained, etc. When the urban flooding monitoring system generates an urban flooding warning, the above-mentioned raw indicators can be extracted from the monitoring records corresponding to the warning.
[0128] Step S212: Extend the original index through feature engineering to obtain the extended index.
[0129] In this embodiment, feature engineering is a technique used to construct new features from original indicators. Extending the original indicators through feature engineering yields extended indicators. Extended indicators are derived feature indicators constructed based on the original indicators. Through feature engineering, the linear or non-linear relationships implicit in the original indicators can be made explicit, providing richer input features for subsequent classification. For example, the original indicators may be 5, but feature engineering can expand them to 20 categories, meaning there may be 15 extended indicators.
[0130] Step S213: Combine the original index with the extended index to obtain the urban flooding early warning index.
[0131] In this embodiment, concatenation involves merging the original and extended indicators along the feature dimension. By concatenating the original and extended indicators, the current flood warning indicator can be obtained. This flood warning indicator includes both the original observation features and the derived features constructed through feature engineering, ensuring consistency with the flood warning indicator used in the training phase of the flood warning classification model. This guarantees that the input feature dimension of the flood warning classification model in practical applications remains consistent with that in the training phase.
[0132] The above embodiments, by performing feature engineering expansion and splicing on the original indicators during the application stage, can ensure that the features of the actual input model are consistent with the features used during model training, avoiding the decline in classification performance due to feature inconsistency, thereby ensuring the accuracy and reliability of urban flooding early warning classification.
[0133] Please see Figure 7 This invention provides an apparatus for constructing an urban flooding early warning classification model. The urban flooding early warning classification model includes a first judgment model that fits the linear features of urban flooding early warning indicators and a second judgment model that fits the nonlinear features of urban flooding early warning indicators. The apparatus may include: The sample acquisition module 310 is used to acquire a training sample set and a test sample set; wherein, the training sample set and the test sample set include urban flooding early warning indicators and their corresponding sample labels.
[0134] The parameter determination module 320 is used to determine the parameter combination of the urban flooding early warning classification model through an optimization algorithm; wherein, the parameter combination includes the model parameters of the first judgment model and the second judgment model, the fusion weight coefficient, and the probability threshold; The model training module 330 is used to train the first judgment model and the second judgment model respectively using the training sample set based on the parameter combination.
[0135] The probability fusion module 340 is used to input the waterlogging early warning indicators in the test sample set into the waterlogging early warning classification model to obtain the fusion evaluation probability; wherein, the fusion evaluation probability is the result of weighted summation of the waterlogging probabilities generated by the first judgment model and the second judgment model according to the corresponding fusion weight coefficients.
[0136] The model determination module 350 is used to determine the classification accuracy of the waterlogging early warning classification model using the probability threshold, and if the classification accuracy is greater than or equal to a preset threshold, the current waterlogging early warning classification model is determined to be a waterlogging early warning classification model.
[0137] Please see Figure 8This invention provides a flood warning and classification device, comprising: The indicator acquisition module 410 is used to acquire the waterlogging warning indicators corresponding to the waterlogging warning.
[0138] The probability generation module 420 is used to input the waterlogging warning indicators into the first judgment model and the second judgment model in the waterlogging warning classification model to obtain the first waterlogging probability and the second waterlogging probability; wherein, the waterlogging warning classification model is constructed using the waterlogging warning classification model construction method described in any one of the above embodiments.
[0139] The probability fusion module 430 is used to sum the first waterlogging probability and the second waterlogging probability according to the corresponding fusion weight coefficient to obtain the fusion evaluation probability.
[0140] The early warning classification module 440 is used to determine the current urban flooding warning as a real warning when the fusion evaluation probability is greater than or equal to the probability threshold.
[0141] The specific functions and effects of the device for constructing the urban flooding early warning classification model and / or the device itself can be explained by referring to other embodiments in this specification, and will not be repeated here. Each module in the device for constructing the urban flooding early warning classification model and / or the device itself can be implemented entirely or partially through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0142] Please see Figure 9 One embodiment of the present invention provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the method for constructing a flood warning classification model as described in any of the above embodiments, or the flood warning classification method as described in any of the above embodiments.
[0143] One embodiment of the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method for constructing a flood warning classification model or the flood warning classification method described in any of the above embodiments.
[0144] An embodiment of the present invention also provides a computer program product comprising a computer program, which, when executed by a computer, causes the computer to perform the method for constructing the waterlogging early warning classification model as described in any of the above embodiments or the waterlogging early warning classification method as described in any of the above embodiments.
[0145] It is understood that the specific examples in this document are only intended to help those skilled in the art better understand the embodiments described herein, and are not intended to limit the scope of the invention.
[0146] It is understood that in the various embodiments described in this specification, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments described in this specification.
[0147] It is understood that the various implementation methods described in this specification can be implemented individually or in combination, and the implementation methods in this specification are not limited in this respect.
[0148] Unless otherwise stated, all technical and scientific terms used in the embodiments of this specification have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of this specification. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items. The singular forms "a," "the," and "the" as used in the embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0149] It is understood that the processor in this invention can be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method implementation can be completed by the integrated logic circuitry in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this specification. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this specification can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0150] It is understood that the memory in this invention can be volatile memory or non-volatile memory, or may include both. Specifically, the non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM). It should be noted that the memory in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0151] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present invention are all information and data authorized by the user or fully authorized by all parties, and corresponding operation entry points are provided for the user to choose to authorize or refuse.
[0152] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this specification.
[0153] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the aforementioned method implementations, and will not be repeated here.
[0154] In the several embodiments provided in this specification, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0155] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0156] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0157] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of this specification, in essence, or the parts that contribute to the prior art, or parts of the technical solutions, can be embodied in the form of software products. These computer software products are stored in a storage medium and include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this specification. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0158] The above description is merely a specific embodiment of this specification, but the scope of protection of this invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this specification should be included within the scope of protection of this specification. Therefore, the scope of protection of this invention should be determined by the scope of the claims.
Claims
1. A method for constructing a classification model for urban flooding early warning, characterized in that, The urban flooding early warning classification model includes a first judgment model that fits the linear features of urban flooding early warning indicators and a second judgment model that fits the nonlinear features of urban flooding early warning indicators. The method includes: Obtain a training sample set and a test sample set; wherein, the training sample set and the test sample set include urban flooding early warning indicators and their corresponding sample labels; The parameter combination of the urban flooding early warning classification model is determined by an optimization algorithm; wherein the parameter combination includes the model parameters of the first judgment model and the second judgment model, the fusion weight coefficient, and the probability threshold. Based on the parameter combination, the first judgment model and the second judgment model are trained respectively using the training sample set; The waterlogging warning indicators in the test sample set are input into the waterlogging warning classification model to obtain the fusion evaluation probability; wherein, the fusion evaluation probability is the result of weighted summation of the waterlogging probabilities generated by the first judgment model and the second judgment model according to the corresponding fusion weight coefficients; Using the probability threshold, the classification accuracy of the waterlogging early warning classification model is determined, and if the classification accuracy is greater than or equal to a preset threshold, the current waterlogging early warning classification model is determined to be a waterlogging early warning classification model.
2. The method according to claim 1, characterized in that, Obtain the training sample set and the test sample set, including: Obtain an initial sample set; wherein the initial sample set includes positive and negative samples characterizing urban flooding warnings; According to a preset ratio, the initial sample set is divided into an initial training sample set and an initial test sample set by random sampling. The initial training sample set and the initial test sample set are expanded using synthetic minority class oversampling technology and Gaussian noise to obtain a training sample set and a test sample set; wherein the number of positive samples in the training sample set is greater than the number of negative samples, and the deviation between the number of positive samples and the number of negative samples in the test sample set is less than or equal to a preset deviation.
3. The method according to claim 2, characterized in that, After obtaining the initial sample set, the method further includes: The original indices of each initial sample in the initial sample set are extended through feature engineering to obtain the extended indices of each initial sample. By concatenating the original indicators with the extended indicators, we obtain the flood warning indicators for each initial sample.
4. The method according to claim 1, characterized in that, The waterlogging warning indicators from the test sample set are input into the waterlogging warning classification model to obtain the fusion evaluation probability, including: The waterlogging early warning indicators in the test sample set are input into the trained first judgment model and the second judgment model respectively to obtain the first waterlogging probability corresponding to the first judgment model and the second waterlogging probability corresponding to the second judgment model. The first waterlogging probability and the second waterlogging probability are weighted according to their corresponding fusion weight coefficients to obtain the fusion evaluation probability.
5. The method according to claim 1, characterized in that, Using the probability threshold, the classification accuracy of the urban flooding early warning classification model is determined, and if the classification accuracy is greater than or equal to a preset threshold, the current urban flooding early warning classification model is determined to be an urban flooding early warning classification model, including: Samples with a fusion evaluation probability greater than or equal to the probability threshold are identified as waterlogging samples; The classification accuracy of the waterlogging early warning classification model is determined based on the waterlogging samples and the waterlogging assessment labels. If the classification accuracy is greater than or equal to a preset threshold, the current urban flooding warning classification model will be determined as the urban flooding warning classification model.
6. The method according to claim 5, characterized in that, The method further includes: If the classification accuracy is less than a preset threshold, the parameter combination of the urban flooding early warning classification model is regenerated through an optimization model. The waterlogging early warning classification model is trained based on the regenerated parameter combination, and the classification accuracy of the waterlogging early warning classification model is determined.
7. A method for classifying urban flooding early warning, characterized in that, The method includes: Obtain the waterlogging warning indicators corresponding to the waterlogging warning; The waterlogging early warning indicators are respectively input into the first judgment model and the second judgment model in the waterlogging early warning classification model to obtain the first waterlogging probability and the second waterlogging probability; wherein, the waterlogging early warning classification model is constructed using the construction method of the waterlogging early warning classification model according to any one of claims 1 to 6; The first waterlogging probability and the second waterlogging probability are weighted and summed according to their corresponding fusion weighting coefficients to obtain the fusion evaluation probability; If the probability of the fusion assessment is greater than or equal to the probability threshold, the current flood warning will be determined as a real warning.
8. The method according to claim 7, characterized in that, The method further includes: If the probability of the fusion assessment is less than the probability threshold, the current flood warning will be determined as a false warning.
9. The method according to claim 7 or 8, characterized in that, Obtain the flood warning indicators corresponding to the flood warning, including: Obtain the raw indicators corresponding to the urban flooding warning; The original indices are extended through feature engineering to obtain extended indices; By concatenating the original indicators with the extended indicators, we obtain the urban flooding early warning indicators.
10. A device for constructing a classification model for urban flooding early warning, characterized in that, The urban flooding early warning classification model includes a first judgment model that fits the linear characteristics of urban flooding early warning indicators and a second judgment model that fits the nonlinear characteristics of urban flooding early warning indicators. The device includes: The sample acquisition module is used to acquire training sample sets and test sample sets; wherein, the training sample sets and the test sample sets include urban flooding early warning indicators and their corresponding sample labels; The parameter determination module is used to determine the parameter combination of the urban flooding early warning classification model through an optimization algorithm; wherein, the parameter combination includes the model parameters of the first judgment model and the second judgment model, the fusion weight coefficient, and the probability threshold; The model training module is used to train the first judgment model and the second judgment model respectively using the training sample set based on the parameter combination; The probability fusion module is used to input the waterlogging warning indicators in the test sample set into the waterlogging warning classification model to obtain the fusion evaluation probability; wherein, the fusion evaluation probability is the result of weighted summation of the waterlogging probabilities generated by the first judgment model and the second judgment model according to the corresponding fusion weight coefficients; The model determination module is used to determine the classification accuracy of the waterlogging early warning classification model using the probability threshold, and if the classification accuracy is greater than or equal to a preset threshold, the current waterlogging early warning classification model is determined to be a waterlogging early warning classification model.
11. A flood warning and classification device, characterized in that, The device includes: The indicator acquisition module is used to acquire the waterlogging warning indicators corresponding to the waterlogging warning; The probability generation module is used to input the waterlogging warning indicators into the first judgment model and the second judgment model in the waterlogging warning classification model to obtain the first waterlogging probability and the second waterlogging probability; wherein, the waterlogging warning classification model is constructed using the construction method of the waterlogging warning classification model according to any one of claims 1 to 6; The probability fusion module is used to sum the first waterlogging probability and the second waterlogging probability according to the corresponding fusion weight coefficients to obtain the fusion evaluation probability; The early warning classification module is used to determine the current urban flooding warning as a real warning when the fusion assessment probability is greater than or equal to the probability threshold.
12. An electronic device, characterized in that, include: A memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method for constructing the waterlogging early warning classification model according to any one of claims 1 to 6 or the waterlogging early warning classification method according to any one of claims 7 to 9.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program for causing a computer to execute the method for constructing the waterlogging early warning classification model according to any one of claims 1 to 6 or the waterlogging early warning classification method according to any one of claims 7 to 9.