XGBoost model-based catering place area fire risk prediction method and system
Through the regional fire risk prediction method of catering places based on XGBoost model, a 'man-machine-circuit-manufacturing' risk index system was constructed, which solved the problem of insufficient systematic prediction of fire risk in catering places in the existing technology, and achieved regional fires in catering places Accurate prediction and scientific assessment of risks.
Patent Information
- Application Number
- CN202411483738.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-11
AI Technical Summary
The existing technology mainly stays at the assessment level in the prediction of fire risk in catering places. It lacks systematic risk prediction research, making it difficult to accurately predict the size of fire risk in different areas.
Based on the XGBoost model, the regional fire risk prediction method of catering places is constructed by constructing a risk prediction index system from four aspects: 'human-machine-ring-pipe', obtaining historical fire accident data, performing data preprocessing and index screening, and constructing the XGBoost model. Divide fire risk levels to achieve systematic prediction of regional fire risks in catering places.
It has achieved accurate prediction of regional fire risks in catering venues in cities across the country, provided a scientific basis for risk assessment, and helped catering venues to carry out effective fire management.
Smart Images

Figure CN119417224A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fire risk prediction, and in particular to a method and system for predicting regional fire risks in a restaurant based on an XGBoost model. Background Art
[0002] With the rapid development of cities, the number of catering places such as farmhouses and private restaurants is increasing. Such catering places have the characteristics of high personnel mobility and large fire load. Once a fire occurs, it is very easy to cause mass casualties. At the same time, the large number of such places, the wide distribution range, the low accuracy of risk prediction, and the difficulty of fire inspection by grassroots fire departments are the difficulties in fire management. Therefore, it is of great significance to the fire management of catering places to carry out regional fire risk prediction of catering places and clarify the risk of fire in catering places in different regions.
[0003] At present, in the field of fire risk research, some scholars have proposed relevant fire risk assessment and prediction methods and invented relevant patents. Application publication number CN118153938A published a fire correlation chain risk assessment method based on fault tree and Bayesian network, constructed a fault tree for catering places, and used Bayesian network to carry out fire risk assessment to clarify the fire risk of catering places. Application publication number CN116629605A published a fire risk prediction method for wooden ancient buildings, which predicted the fire risk level of wooden ancient buildings by selecting the fire risk factors of wooden ancient buildings and the fire risk level of previous years. Application publication number CN117575320A published a forest fire risk prediction method based on graph convolutional neural network, considering the impact of meteorological, topographic, and vegetation spatiotemporal data in the adjacent areas of the target area on the occurrence and propagation of fire, predicting the forest fire risk in the target area, and understanding the law of forest fire occurrence. Through the investigation of existing patents, it was found that the research on the fire risk of catering places in the above applications only stayed at the assessment level, and the systematic research on the prediction of fire risk of catering places was limited.
[0004] In response to the above shortcomings, this patent aims to propose a method and system for predicting regional fire risks in catering venues based on the XGBoost model. According to the actual situation of catering venues, a regional fire risk prediction index system for catering venues is constructed from the four aspects of "man-machine-environment-management". Historical fire accidents in catering venues are collected, and the number of regional fire accidents in catering venues each month is counted, and integrated with the fire risk prediction indicators to form an initial data set; the data is pre-processed, and key indicators are screened to form an XGBoost model input data set, the XGBoost model is trained and adjusted, and an XGBoost model for predicting regional fire risks in catering venues is constructed. Four levels are used to divide the risk level of the XGBoost model from low to high, and a method for predicting regional fire risks in catering venues is established to predict the risk of regional fires in catering venues in cities across the country. Summary of the invention
[0005] The present invention aims to propose a method and system for predicting regional fire risks in catering places based on the XGBoost model, construct an index system for predicting regional fire risks in catering places, obtain fire risk prediction index data and historical fire accidents in catering places, and count the number of fires occurring in regional catering places each month, merge them with the fire risk prediction index data, standardize the fire risk prediction index data using a standardized processing method, use a recursive feature elimination method to carry out index screening, eliminate indicators with lower importance, clarify key indicators, form an XGBoost model input data set, train and adjust the XGBoost model, construct an XGBoost model for predicting regional fire risks in catering places, and establish a method for predicting regional fire risks in catering places.
[0006] The present invention proposes a method for predicting regional fire risks in catering establishments based on an XGBoost model, wherein the method specifically comprises:
[0007] (1) Based on the actual situation of catering venues, establish a regional fire risk prediction index system for catering venues from the four aspects of "man-machine-environment-management";
[0008] (2) obtaining the fire risk prediction index data and the historical fire accidents of the catering establishments, and counting the number of fire accidents occurring in the catering establishments in the region each month, and integrating them with the fire risk prediction index data to form an initial data set;
[0009] (3) Based on the initial data set, the standardization processing method is used to standardize the initial data set, the recursive feature elimination method is used to screen the fire risk prediction indicators, the indicators with lower importance are eliminated, the key indicators are clarified, and the principal component analysis method is used to reduce the dimension of the key indicators to form the XGBoost model input data set;
[0010] (4) According to the XGBoost model input data set, the training set and the validation set are divided into a ratio of 8:2, the XGBoost model parameter space is constructed, the XGBoost model is adjusted by using the random grid search and k-fold cross validation method, and the optimal parameters of the model are selected;
[0011] (5) Based on the optimal parameters of the model, the XGBoost model is established, and the risk probability is divided into four risk levels in an equal interval manner, and represented from low to high as "low risk", "general risk", "medium risk" and "high risk". The probability labeled 1 in the prediction result of the model is matched with the risk level, the risk level corresponding to the probability is clarified, and the regional fire risk prediction method for catering places based on the XGBoost model is established.
[0012] (6) Using the catering venue regional fire risk prediction method, predict the risk of regional fires in catering venues in cities across the country. The present invention proposes a catering venue regional fire risk prediction method based on the XGBoost model, which is characterized in that the catering venue regional fire risk prediction index system is established, specifically including:
[0013] The regional fire risk prediction index system for catering establishments includes personnel factors, establishment factors, environmental factors and fire management factors;
[0014] The personnel factors mainly include the number of people in the region, population growth rate, average years of education, unemployment rate and per capita disposable income level;
[0015] The venue factors mainly include the number of catering venues in the area and the electricity consumption;
[0016] The environmental factors are divided into natural environmental factors and social environmental factors. Natural environmental factors include maximum temperature, minimum temperature, average temperature, dew point temperature, relative humidity, maximum wind speed, maximum gust, precipitation, rainfall, snowfall, precipitation hours, surface pressure, and dominant wind direction; social environmental factors include GDP, number of colleges and universities, number of municipal fire hydrants, average fire extinguishing time in history, average time for historical police response, province, and region;
[0017] The fire management factors mentioned above mainly include the number of historical fire accidents, the number of fire agencies, the financial revenue-expenditure ratio of fire rescue teams, the investigation and handling of reports on fire products, the number of cases of unqualified fire products, and fire policy documents.
[0018] The present invention proposes a method for predicting regional fire risk in a catering place based on an XGBoost model, characterized in that the key indicator determination process is used to form the XGBoost model input data set, specifically including:
[0019] Acquire the historical fire risk prediction index data of the region and the historical fire accidents of the catering establishments, and count the number of fires occurring in the catering establishments in the region each month, and merge them with the fire risk prediction index data to form the initial data set;
[0020] The standardization processing method is used to perform the standardization processing on the initial data set, and the data range is scaled to the interval [-1,1]. The calculation method is as follows:
[0021] z=(xu) / s
[0022] In the formula, z represents the value after the standardization process, x represents the initial data, u represents the average value of the initial data, and s represents the standard deviation of the initial data;
[0023] Based on the recursive feature elimination method, the importance of the fire risk prediction index is determined, and the indexes with lower importance are eliminated. The importance refers to the importance degree of the model input index in the model.
[0024] Based on the recursive feature elimination method, a machine learning model that can determine the importance of the fire risk prediction index is selected, the initial data set is used to carry out model training, appropriate model evaluation indicators such as ROC AUC and F1 score are selected, the model performance is evaluated, the importance of the fire risk prediction index is output, the index with the lowest importance is eliminated, the data set after the index is eliminated is substituted into the model training, the above steps are repeated, and the index corresponding to the best model performance is selected as the model input index; the principal component analysis method is used to reduce the dimension of the model input index to form the XGBoost model input data set.
[0025] Based on the principal component analysis method, the covariance matrix of the data is calculated using the standardized data matrix, and the calculation method is as follows:
[0026]
[0027] Where C represents the covariance matrix, X norm represents the standardized data matrix, and n represents the number of model input indicators;
[0028] Based on the principal component analysis method, the eigenvalues and eigenvectors of the covariance matrix are calculated. The specific calculation method is as follows:
[0029] Ce=λe
[0030] Where e represents the orthogonal normalized eigenvector, e = {e1, e2, ..., e n}, λ is the corresponding eigenvalue, λ={λ1,λ2,...,λ n};
[0031] Based on the principal component analysis method, the score of each principal component is calculated. The higher the score of the principal component, the more information the principal component explains in the data, and the more important the principal component is. The calculation method is as follows:
[0032] Y=X norm e
[0033] Wherein, Y represents the score matrix of the principal component, Y = {y1, y2, ..., y n};
[0034] Based on the principal component analysis method, the cumulative contribution rate of the first k principal components is calculated. The cumulative contribution rate of the principal components indicates the ability of the first k principal components to integrate the original variables. The higher the cumulative contribution rate, the better the ability of the principal components to integrate the original variables. Generally, the first few features that can represent more than 90% of the information of the original data are selected as input variables. The calculation method of the cumulative contribution rate of the principal components is as follows:
[0035]
[0036] In the formula, Q k represents the cumulative contribution rate of the first k (k≤n) principal components, λ i represents the i-th eigenvalue.
[0037] The present invention proposes a method for predicting regional fire risks in catering establishments based on an XGBoost model, characterized in that the XGBoost model parameter optimization is used to establish the method for predicting regional fire risks in catering establishments, specifically including:
[0038] The XGBoost model input data set is divided proportionally, wherein 80% of the data set is used as a training set and 20% is used as a validation set;
[0039] Construct the XGBoost model parameter space, the parameters specifically include the number of decision trees n_estimators, the maximum depth of the decision tree max_depth, the minimum weight of the child node min_child_weight, the minimum segmentation loss gamma, the sample sampling ratio subsample, the sampling ratio of the column when constructing the decision tree colsample_bytree, the L1 regularization term reg_alpha, the L2 regularization term reg_lambda, and the learning rate learning_rate;
[0040] Based on the random grid search method, determine the specific values of the parameters in the XGBoost model parameter space;
[0041] Based on the random grid search method, the XGBoost library native interface is called using Python 3 to call the XGBoost model, the number of model parameter sampling is set to 300 times, the k-fold cross-validation method and the training set are selected to perform model parameter optimization, and the ROC_AUC, F1_score and other evaluation indicators are selected to evaluate the model training effect, and the optimal parameters of the model are determined;
[0042] Based on the k-fold cross-validation method, the training set is divided into k parts on average, where one part is selected as the validation set each time, and the remaining k-1 parts are selected as the training set. The model is first trained using the k-1 training sets, and then the remaining 1 part of the data is used as the validation set to verify the performance of the model. The above steps are repeated k times, and k model validation results are returned. Here, k=3 is set.
[0043] The present invention proposes a method for predicting regional fire risk in a catering place based on an XGBoost model, which is characterized in that the fire risk level classification process specifically includes:
[0044] Based on the optimal parameters of the model, the XGBoost model is established, and the probability of the label 1 in the model prediction results is selected. The probability is divided into four fire risk levels in the manner of [0-0.25), [0.25-0.5), [0.5-0.75) and [0.75-1]. From low to high, "low risk", "general risk", "medium risk" and "high risk" are used to represent the regional fire risk prediction method for catering places based on the XGBoost model.
[0045] The present invention proposes a method for predicting regional fire risk of catering establishments based on an XGBoost model, which is characterized in that the regional fire risk level of catering establishments in cities across the country is predicted, specifically including:
[0046] Constructing the XGBoost model input data set, and performing data preprocessing on the initial data set using the standardization processing method and the principal component analysis method;
[0047] The XGBoost model is used to predict the fire risk of catering establishments in cities across the country, and the probability of the label being 1 is returned, and the probability is divided into risk levels according to the fire risk level classification process of claim 5.
[0048] The present invention proposes a restaurant area fire risk prediction system based on an XGBoost model, which is used to execute the method described in any one of claims 1 to 6, characterized in that the system comprises: an indicator system construction module, a key indicator screening module, and a risk level prediction module, and each module is connected in sequence;
[0049] The indicator system construction module is used to classify the hazardous factors involved in fires in catering places, and to clarify the hazardous factors specifically included in the personnel factors, the place factors, the environmental factors and the management factors;
[0050] The key indicator screening module is used to screen the indicators in the indicator system that have a low correlation with fires in catering places and to clarify the key indicators.
[0051] The risk level prediction module is used to train the key indicators through the XGBoost model to automatically predict the fire risk level of the catering venues in each city across the country.
[0052] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0054] Figure 1 This is a flow chart of a method for predicting fire risks in catering establishments based on an XGBoost model according to an embodiment of the present invention.
[0055] Figure 2 It is a schematic diagram of the index screening results in the method for predicting regional fire risks in catering places based on the XGBoost model in an embodiment of the present invention.
[0056] Figure 3 It is a schematic diagram of the principal component analysis results in the method for predicting regional fire risks in catering places based on the XGBoost model in an embodiment of the present invention.
[0057] Figure 4 It is a schematic diagram of the XGBoost model parameter optimization results in the method for predicting regional fire risks in catering places based on the XGBoost model in an embodiment of the present invention.
[0058] Figure 5 It is a schematic diagram of the output of the prediction results of the XGBoost model in the method for predicting regional fire risks in catering places based on the XGBoost model in an embodiment of the present invention.
[0059] Figure 6 It is a schematic diagram of the results of the classification of regional fire risk levels of catering establishments in cities across the country in the method for predicting regional fire risks of catering establishments based on the XGBoost model in an embodiment of the present invention.
[0060] Figure 7 It is a schematic diagram of the structural composition of a restaurant area fire risk prediction system based on the XGBoost model in an embodiment of the present invention. DETAILED DESCRIPTION
[0061] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0062] Example 1
[0063] The method for predicting regional fire risk in a restaurant based on the XGBoost model in this embodiment is as follows: Figure 1 As shown in the figure, firstly, a regional fire risk prediction index system for catering places is constructed; at the same time, various index data and historical fire data of catering places are collected, and these two types of data are merged to form an initial data set of the fire risk prediction model; the data set is standardized by a standardized processing method, and the fire risk prediction index is screened by the recursive feature elimination method, the indexes with low importance are eliminated, the key indexes are clarified, and the principal component analysis method is used to reduce the dimension of the key indexes to form an XGBoost model input data set; according to the XGBoost model input data set, the training set and the validation set are divided according to the ratio of 8:2, and the XGBoost model parameter space is constructed. The XGBoost model is adjusted by the random grid search and k-fold cross-validation methods to select the optimal parameters of the model; based on the optimal parameters of the model, an XGBoost model is established, and the risk probability is divided into 4 risk levels according to the equal interval division method, and represented from low to high by "low risk", "general risk", "medium risk" and "high risk", the probability labeled as 1 in the prediction result of the model is selected, and the probability labeled as 1 is matched with the risk probability, and a regional fire risk prediction method for catering places based on the XGBoost model is established.
[0064] The construction of the regional fire risk prediction method for catering places based on the XGBoost model can be divided into five steps: constructing a regional fire risk prediction index system for catering places, screening key indicators, constructing an XGBoost model input data set, training and optimizing the XGBoost model, and dividing the fire risk level.
[0065] In constructing the regional fire risk prediction index system for catering places, we investigated the research results of domestic and foreign literature on catering places, collected relevant fire laws, regulations and standards, fire management regulations and other information on catering places, and constructed the regional fire risk prediction index system for catering places from four aspects: personnel factors, venue factors, environmental factors and management factors;
[0066] Advantageously, personnel factors include the number of people in the region, population growth rate, average years of education, unemployment rate and per capita disposable income level; venue factors include the number of catering venues and electricity consumption in the region; environmental factors are divided into natural environmental factors and social environmental factors, and natural environmental factors mainly include maximum temperature, minimum temperature, average temperature, dew point temperature, relative humidity, maximum wind speed, maximum gusts, precipitation, rainfall, snowfall, precipitation hours, surface pressure, and dominant wind direction; social environmental factors mainly include GDP, the number of colleges and universities, the number of municipal fire hydrants, the average time for historical fire extinguishing, and the average time for historical alarm response; fire management factors mainly reflect the number of historical fire accidents, the number of fire agencies, the financial revenue and expenditure ratio of fire rescue teams, the reporting and investigation of fire products, the number of cases of unqualified fire products, and fire policy documents.
[0067] In screening key indicators, various indicator data and historical fire accidents in catering places are collected, and the data are integrated to form an initial data set. The data set is standardized using a standardized processing method, and the recursive feature elimination method is used to screen indicators with lower importance and identify key indicators. The specific screening process for key indicators is as follows:
[0068] First, various indicator data are collected from local government statistical yearbooks, government official websites, meteorological websites and public data websites. At the same time, historical fire accidents in catering venues are collected and counted from major search platforms and government official websites. The indicator data and historical fire data are then integrated to form the initial data set for the model.
[0069] Subsequently, the initial data set is standardized using a standard processing method to scale the data range to the [-1,1] interval. The calculation method is as follows:
[0070] z=(xu) / s
[0071] In the formula, z represents the value after standardization, x represents the initial data, u represents the average value of the initial data, and s represents the standard deviation of the initial data.
[0072] Based on the recursive feature elimination method, the random forest model was selected, the initial data set was used for model training, the ROC_AUC model evaluation index was selected, the model performance was evaluated, the importance of fire risk prediction indicators was output, the indicators with the lowest importance were eliminated, and the data set after eliminating the indicators was substituted into the model training. The above steps were repeated and the indicators with the best model performance were selected as the model input indicators. The indicator screening results are shown in Figure 2 The highest ROC AUC score of the model is 0.830368. At this time, the key indicators include: province, number of venues, permanent population, GDP, number of colleges and universities, average years of education, population growth rate, unemployment rate, per capita disposable income, average time to arrive at the scene, average time to extinguish the fire, number of municipal fire hydrants, electricity consumption, fire departments, fire brigade fiscal revenue and expenditure ratio, number of reports and investigations, number of unqualified fire products, fire policy documents, maximum temperature, minimum temperature, average temperature, precipitation, rainfall, snowfall, precipitation hours, maximum wind speed, maximum gust, dominant wind direction, relative humidity, dew point temperature, surface pressure.
[0073] In constructing the XGBoost model input data set, key indicators are extracted based on the indicator screening results, and the principal component analysis method is used to reduce the dimension of the indicators to construct the XGBoost model input data set. The specific calculation process is as follows:
[0074] First, the covariance matrix of the data is calculated using the standardized data matrix as follows:
[0075]
[0076] Where C represents the covariance matrix, X norm represents the standardized data matrix, and n represents the number of model input indicators;
[0077] Calculate the eigenvalues and eigenvectors of the covariance matrix. The specific calculation method is as follows:
[0078] Ce=λe
[0079] Where e represents the orthogonal normalized eigenvector, e = {e1, e2, ..., e n}, λ is the corresponding eigenvalue, λ={λ1,λ2,...,λ n};
[0080] Based on the principal component analysis method, the score of each principal component is calculated. The higher the score of the principal component, the more information the component explains in the data, and the more important the component is. The calculation method is as follows:
[0081] Y=X norm e
[0082] Where Y represents the score matrix of the principal component, Y = {y1, y2, ..., y n};
[0083] Based on the principal component analysis method, the cumulative contribution rate of the first m principal components is calculated. The cumulative contribution rate of the principal components indicates the ability of the first m principal components to synthesize the original variables. The higher the cumulative contribution rate, the better the ability of the principal components to synthesize the original variables. Generally, the first few features that can represent more than 90% of the information of the original data are selected as input variables; the calculation method of the cumulative contribution rate of the principal components is as follows:
[0084]
[0085] In the formula, Q m Represents the cumulative contribution rate of the first m (m≤n) principal components, λ i represents the i-th eigenvalue.
[0086] In the principal component analysis method, the specific calculation results are shown in Figure 3 When m=8, the cumulative contribution rate of the first 8 principal components exceeds 90%, so m=8 is selected.
[0087] In the training and optimization of the XGBoost model, the XGBoost model parameter space is constructed, and the grid search method and k-fold cross validation method are used in combination with the XGBoost model to optimize the model parameters. The specific training and optimization process of the XGBoost model is as follows:
[0088] Construct the XGBoost model parameter space. The parameters include the number of decision trees n_estimators, the maximum depth of the decision tree max_depth, the minimum weight of the child node min_child_weight, the minimum segmentation loss gamma, the sample sampling ratio subsample, the sampling ratio of the column when building the decision tree colsample_bytree, the L1 regularization term reg_alpha, the L2 regularization term reg_lambda, and the learning rate learning_rate.
[0089] Based on the random grid search method, the python3 language was used to call the XGBoost library native interface to call the XGBoost model, the model parameter sampling times were set to 300 times, the k-fold cross-validation method and the training set were selected to perform model parameter optimization, and the ROC_AUC evaluation indicator was selected to evaluate the model training effect.
[0090] Based on the k-fold cross-validation method, the training set is divided into k parts on average, and one of them is selected as the validation set each time, and the remaining k-1 parts are used as the training set. The model is first trained using the k-1 training sets, and then the remaining 1 data is used as the validation set to verify the effect of the model. The above steps are repeated k times, and the k-fold model validation results are returned. Here, k=3 is set. For specific results, see Figure 4 .
[0091] In the classification of fire risk levels, based on the trained and optimized XGBoost model, the indicator data of a certain month is selected and input into the model to obtain the model output results, and the model output results are classified. The specific process of fire risk level classification is as follows:
[0092] October 2024 is selected as the forecast period, and various indicator data are collected to form the initial data set. Subsequently, the data set is standardized and subjected to principal component analysis to form the XGBoost model input data set.
[0093] Input the XGBoost model input data set into the trained XGBoost model to obtain the model output result. Figure 5 Subsequently, the risk probability was divided into four fire risk levels in the manner of [0-0.25), [0.25-0.5), [0.5-0.75) and [0.75-1], and represented from low to high by "low risk", "general risk", "medium risk" and "high risk". The probability labeled as 1 in the model output result was selected and matched with the risk level division. The specific results are shown in Figure 6 .
[0094] Example 2
[0095] This embodiment provides a restaurant area fire risk prediction system based on the XGBoost model in Example 1, such as Figure 7 As shown, it is a schematic diagram of the composition of the system disclosed in this embodiment, and the system includes: an indicator system construction module, a key indicator screening module, and a risk level prediction module, and each module is connected in sequence.
[0096] The indicator system construction module is used to divide the hazard factors involved in fires in catering places, and to clarify the specific hazard factors including personnel factors, venue factors, environmental factors and management factors. The key indicator screening module is used to screen the indicators with low correlation with fires in catering places in the indicator system, and to clarify the indicators with greater importance. The risk level prediction module is used to train key indicators through the XGBoost model, and automatically predict the risk level of regional fires in catering places in cities across the country.
[0097] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for predicting regional fire risk in a restaurant based on an XGBoost model, characterized in that: Construct a regional fire risk prediction index system for catering establishments, obtain fire risk prediction index data and historical fire accidents in catering establishments, and count the number of fires in regional catering establishments each month, merge them with the fire risk prediction index data, standardize the fire risk prediction index data using a standardized processing method, use recursive feature elimination method to screen indicators, eliminate indicators with low importance, clarify key indicators, form an XGBoost model input data set, train and adjust the XGBoost model, construct an XGBoost model for regional fire risk prediction in catering establishments, and establish a regional fire risk prediction method for catering establishments, specifically including: (1) Based on the actual situation of catering venues, establish a regional fire risk prediction index system for catering venues from the four aspects of "man-machine-environment-management"; (2) obtaining the fire risk prediction index data and the historical fire accidents of the catering establishments, and counting the number of fire accidents occurring in the catering establishments in the region each month, and integrating them with the fire risk prediction index data to form an initial data set; (3) Based on the initial data set, the standardization processing method is used to standardize the initial data set, the recursive feature elimination method is used to screen the fire risk prediction indicators, the indicators with lower importance are eliminated, the key indicators are clarified, and the principal component analysis method is used to reduce the dimension of the key indicators to form the XGBoost model input data set; (4) According to the XGBoost model input data set, the training set and the validation set are divided into a ratio of 8:2, the XGBoost model parameter space is constructed, the XGBoost model is adjusted by using the random grid search and k-fold cross validation method, and the optimal parameters of the model are selected; (5) Based on the optimal parameters of the model, the XGBoost model is established, and the risk probability is divided into four risk levels in an equal interval manner, and represented from low to high as "low risk", "general risk", "medium risk" and "high risk". The probability labeled 1 in the prediction result of the model is matched with the risk level, the risk level corresponding to the probability is clarified, and the fire risk prediction method for catering places based on the XGBoost model is established. (6) Using the catering establishment regional fire risk prediction method, predict the risk of regional fires in catering establishments in cities across the country.
2. A method for predicting regional fire risk in catering places based on the XGBoost model, characterized in that: The establishment of a regional fire risk prediction index system for catering establishments specifically includes: The regional fire risk prediction index system for catering establishments includes personnel factors, establishment factors, environmental factors and fire management factors; The personnel factors mainly include the number of people in the region, population growth rate, average years of education, unemployment rate and per capita disposable income level; The venue factors mainly include the number of catering venues in the area and the electricity consumption; The environmental factors are divided into natural environmental factors and social environmental factors. Natural environmental factors include maximum temperature, minimum temperature, average temperature, dew point temperature, relative humidity, maximum wind speed, maximum gust, precipitation, rainfall, snowfall, precipitation hours, surface pressure, and dominant wind direction; social environmental factors include GDP, number of colleges and universities, number of municipal fire hydrants, average fire extinguishing time in history, average time for historical police response, province, and region; The fire management factors mentioned above mainly include the number of historical fire accidents, the number of fire agencies, the financial revenue-expenditure ratio of fire rescue teams, the investigation and handling of reports on fire products, the number of cases of unqualified fire products, and fire policy documents.
3. A method for predicting regional fire risk in catering places based on the XGBoost model, characterized in that: The key indicator determination process is used to form the XGBoost model input data set, specifically including: Obtaining the historical fire risk prediction index data of the region and the historical fire accidents of the catering establishments, and counting the number of fires occurring in the catering establishments in the region each month, and fusing them with the fire risk prediction index data to form the initial data set; The standardization processing method is used to perform the standardization processing on the initial data set, and the data range is scaled to the interval [-1,1]. The calculation method is as follows: z=(xu) / s In the formula, z represents the value after the standardization process, x represents the initial data, u represents the average value of the initial data, and s represents the standard deviation of the initial data; Based on the recursive feature elimination method, the importance of the fire risk prediction index is determined, and the indexes with lower importance are eliminated. The importance refers to the importance degree of the model input index in the model. Based on the recursive feature elimination method, a machine learning model that can determine the importance of the fire risk prediction index is selected, the initial data set is used to carry out model training, appropriate model evaluation indicators such as ROC_AUC and F1_score are selected, the model performance is evaluated, the importance of the fire risk prediction index is output, the index with the lowest importance is eliminated, and the data set after the index is eliminated is substituted into the model training, the above steps are repeated, and the index corresponding to the best model performance is selected as the model input index; the principal component analysis method is used to reduce the dimension of the model input index to form the XGBoost model input data set. Based on the principal component analysis method, the covariance matrix of the data is calculated using the standardized data matrix as follows: Where C represents the covariance matrix, X norm represents the standardized data matrix, and n represents the number of model input indicators; Based on the principal component analysis method, the eigenvalues and eigenvectors of the covariance matrix are calculated. The specific calculation method is as follows: Ce=λe Where e represents the orthogonal normalized eigenvector, e = {e1, e2, …, e n }, λ is the corresponding eigenvalue, λ={λ1,λ2,…,λ n }; Based on the principal component analysis method, the score of each principal component is calculated. The higher the score of the principal component, the more information the principal component explains in the data, and the more important the principal component is. The calculation method is as follows: Y=X norm and Where Y represents the score matrix of the principal component, Y = {y1, y2, ..., y n }; Based on the principal component analysis method, the cumulative contribution rate of the first k principal components is calculated. The cumulative contribution rate of the principal components indicates the ability of the first k principal components to integrate the original variables. The higher the cumulative contribution rate, the better the ability of the principal components to integrate the original variables. Generally, the first few features that can represent more than 90% of the information of the original data are selected as input variables. The calculation method of the cumulative contribution rate of the principal components is as follows: In the formula, Q k represents the cumulative contribution rate of the first k (k≤n) principal components, λ i represents the i-th eigenvalue.
4. A method for predicting regional fire risk in catering places based on the XGBoost model, characterized in that: The XGBoost model parameter optimization is used to establish the restaurant area fire risk prediction method, specifically including: The XGBoost model input data set is divided proportionally, wherein 80% of the data set is used as a training set and 20% is used as a validation set; Construct the XGBoost model parameter space, the parameters specifically include the number of decision trees n_estimators, the maximum depth of the decision tree max_depth, the minimum weight of the child node min_child_weight, the minimum segmentation loss gamma, the sample sampling ratio subsample, the sampling ratio of the column when constructing the decision tree colsample_bytree, the L1 regularization term reg_alpha, the L2 regularization term reg_lambda, and the learning rate learning_rate; Based on the random grid search method, determine the specific values of the parameters in the XGBoost model parameter space; Based on the random grid search method, the XGBoost library native interface is called using Python 3 to call the XGBoost model, the number of model parameter sampling is set to 300 times, the k-fold cross-validation method and the training set are selected to perform model parameter optimization, and the ROC_AUC, F1_score and other evaluation indicators are selected to evaluate the model training effect, and the optimal parameters of the model are determined; Based on the k-fold cross-validation method, the training set is divided into k parts on average, where one part is selected as the validation set each time, and the remaining k-1 parts are selected as the training set. The model is first trained using the k-1 training sets, and then the remaining 1 part of the data is used as the validation set to verify the performance of the model. The above steps are repeated k times, and k model validation results are returned. Here, k=3 is set.
5. A method for predicting regional fire risk in catering places based on the XGBoost model, characterized in that: The fire risk level classification process specifically includes: Based on the optimal parameters of the model, the XGBoost model is established, and the probability of the label 1 in the model prediction results is selected. The probability is divided into four fire risk levels in the manner of [0-0.25), [0.25-0.5), [0.5-0.75) and [0.75-1]. From low to high, "low risk", "general risk", "medium risk" and "high risk" are used to represent the regional fire risk prediction method for catering places based on the XGBoost model.
6. A method for predicting regional fire risk in a restaurant based on an XGBoost model, characterized in that: The predicted fire risk levels of catering establishments in various cities across the country include: Constructing the XGBoost model input data set, and performing data preprocessing on the initial data set using the standardization processing method and the principal component analysis method; The XGBoost model is used to predict the fire risk of catering establishments in cities across the country, and the probability of the label being 1 is returned, and the probability is divided into risk levels according to the fire risk level classification process of claim 5.
7. A restaurant area fire risk prediction system based on an XGBoost model, used to execute the method described in any one of claims 1 to 6, characterized in that: The system includes: an indicator system construction module, a key indicator screening module, and a risk level prediction module, and each module is connected in sequence; The indicator system construction module is used to classify the hazardous factors involved in fires in catering places, and to clarify the hazardous factors specifically included in the personnel factors, the place factors, the environmental factors and the management factors; The key indicator screening module is used to screen the indicators in the indicator system that have a low correlation with fires in catering places and to clarify the key indicators. The risk level prediction module is used to train the key indicators through the XGBoost model to automatically predict the fire risk level of the catering venues in each city across the country.
Citation Information
Patent Citations
Forest fire risk prediction method based on graph convolutional neural network
CN117575320A
Fire correlation chain risk assessment method based on fault tree and Bayesian network
CN118153938A
Fire-fighting risk assessment method, device and terminal device
CN109242361A
Method for drawing fire risk level distribution diagram
CN112308292A
Fire risk prediction method for wooden ancient building
CN116629605A
Cited By
Building fire risk dynamic assessment method and system
CN120471457A