Fire risk spatial distribution prediction method and device based on Gaussian process
Through the Gaussian process-based fire risk spatial distribution prediction method, the problems of large amount of data and frequent model adjustments in the prior art are solved, and efficient and accurate fire risk prediction is achieved, which is suitable for small data sets.
Patent Information
- Application Number
- CN202510041140.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art requires a large amount of data and frequent model adjustments in the spatial distribution prediction of fire risk, resulting in large errors and no guarantee of accuracy, and overfitting problems are prone to occur on small data sets.
The Gaussian process-based spatial distribution prediction method is adopted to obtain the spatial alarm distribution data of fire equipment, learn the Gaussian distribution, and build a Gaussian process prediction model, including the mean function and a variety of kernel functions, and optimize the model parameters to achieve prediction.
No large amount of data and frequent model adjustment is required, the parameter adjustment process is simplified, the accuracy and stability of prediction is improved, and the overfitting problem is avoided, and it is suitable for small data sets.
Smart Images

Figure CN119442929A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of fire safety management technology, and in particular to a method and device for predicting the spatial distribution of fire risk based on a Gaussian process. Background Art
[0002] With the acceleration of urbanization, building density, population density and diversification of regional functions have led to significant differences in fire risks in different regions. Through spatial distribution prediction, high-risk areas can be identified, the allocation and deployment of fire resources can be optimized, preventive measures can be taken in advance, and the frequency and losses of fires can be effectively reduced. In addition, fires are sudden and unpredictable. Accurate spatial distribution prediction can provide decision-making basis for fire departments and improve the scientific nature and efficiency of fire prevention and control.
[0003] At present, the widely used technologies in the field of spatial distribution prediction include random forest and genetic algorithm technology. Random forest is an integrated learning technology that improves the accuracy and robustness of the overall prediction by constructing multiple decision trees and combining their prediction results. This method is particularly suitable for processing complex data sets based on random spatial distribution because it can capture the complex structure and relationship in the data. In spatial distribution prediction, genetic algorithms optimize the prediction model by encoding spatial features and using operations such as selection, crossover, and mutation. Its fitness function evaluates the prediction error and gradually improves the accuracy through iteration. Genetic algorithms are good at global search and are suitable for fire risk distribution prediction and optimal resource allocation. They have the advantage of processing complex data and nonlinear problems.
[0004] However, these technologies require the superposition of several methods to achieve better prediction results, and need to train and build models based on actual conditions. They require a lot of experiments, known data, and time and energy to continuously calibrate to approach the target model situation for better prediction. Since the more methods are coupled, the greater the error, the accuracy of the prediction cannot be guaranteed, and even more manpower and material resources are required. Therefore, there is an urgent need for a method that does not require a large amount of data and frequent adjustments to the model to achieve spatial distribution prediction of fire risk. Summary of the invention
[0005] In view of this, the present application provides a method and device for predicting the spatial distribution of fire risk based on Gaussian process, which does not require a large amount of data and frequent adjustments to the model, and can achieve the prediction of the spatial distribution of fire risk.
[0006] Specifically, the present application is implemented through the following technical solutions: In a first aspect, the present application provides a method for predicting the spatial distribution of fire risk based on a Gaussian process, the method comprising: Acquire spatial alarm distribution data of fire-fighting equipment; the spatial alarm distribution data includes a plurality of sub-data, each sub-data representing the number of alarms at different longitudes and latitudes; Gaussian distribution is learned based on the spatial alarm distribution data, and a Gaussian process prediction model is constructed; wherein the Gaussian process prediction model includes a mean function and multiple types of kernel functions, the form of the mean function is matched based on the change trend of the spatial alarm distribution data and the parameters of the mean function are determined, and the kernel function is determined based on the covariance between two coordinate points in the spatial alarm distribution data, and each type of the kernel function corresponds to a type of local correlation feature of the spatial alarm distribution data; Solving the optimal parameters of the Gaussian process prediction model; Determine a first preset number of longitudes and latitudes to be predicted; the first preset number is less than the length of the spatial alarm distribution data; The optimal parameters, the longitude and latitude to be predicted and the spatial alarm distribution data are input into the Gaussian process prediction model to predict the number of alarms at the longitude and latitude to be predicted.
[0007] The second aspect of the present application provides a fire risk spatial distribution prediction device based on Gaussian process, the device comprising: an acquisition module, a construction module, a determination module and a prediction module; wherein: The acquisition module is used to acquire spatial alarm distribution data of fire-fighting equipment; the spatial alarm distribution data includes multiple sub-data, each sub-data represents the number of alarms at different longitudes and latitudes; The construction module is used to learn Gaussian distribution based on the spatial alarm distribution data and construct a Gaussian process prediction model; wherein the Gaussian process prediction model includes a mean function and multiple types of kernel functions, the form of the mean function is matched based on the change trend of the spatial alarm distribution data and the parameters of the mean function are determined, and the kernel function is determined based on the covariance between two coordinate points in the spatial alarm distribution data, and each type of the kernel function corresponds to a type of local correlation feature of the spatial alarm distribution data; The determination module is used to solve the optimal parameters of the Gaussian process prediction model; The determination module is further used to determine a first preset number of longitudes and latitudes to be predicted; the first preset number is less than the length of the spatial alarm distribution data; The prediction module is used to input the optimal parameters, the longitude and latitude to be predicted and the spatial alarm distribution data into the Gaussian process prediction model to predict the number of alarms at the longitude and latitude to be predicted.
[0008] The present application provides a method and device for predicting the spatial distribution of fire risk based on Gaussian process. In the first aspect, a Gaussian process prediction model is constructed based on spatial alarm distribution data, and the number of alarms at the longitude and latitude to be predicted is predicted based on the optimized Gaussian process prediction model. The spatial distribution prediction of fire risk is realized by applying the Gaussian process prediction model to the field of fire safety. Compared with the traditional spatial distribution prediction method, the present application does not need to repeatedly and tediously adjust the hyperparameters of the Gaussian process prediction model. It only needs to adjust the covariance function and mean function in the Gaussian process prediction model to achieve a better fitting effect, which greatly simplifies the process of model parameter adjustment and does not require a large number of data sets. This makes the present invention easier to implement, reduces the impact of human factors on model performance, and improves the accuracy and stability of prediction. In the second aspect, when constructing a Gaussian process prediction model based on spatial alarm distribution data, a variety of kernel functions are constructed based on the local correlation characteristics of the spatial alarm distribution data, which effectively grasps the direction of the prediction of the spatial distribution of fire risk and makes the training of data more reasonable. In this way, even with a relatively small data set, effective training can be achieved, avoiding the overfitting problem that traditional spatial distribution prediction methods are prone to on small data sets. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 A flowchart of Embodiment 1 of a method for predicting the spatial distribution of fire risk based on a Gaussian process provided in this application; Figure 2 This is a structural diagram of Example 1 of the fire risk spatial distribution prediction device based on Gaussian process provided in this application. DETAILED DESCRIPTION
[0010] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.
[0011] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more associated listed items.
[0012] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0013] Specific embodiments are given below to introduce the technical solution of the present application in detail.
[0014] Figure 1 This is a flowchart of the first embodiment of the fire risk spatial distribution prediction method based on Gaussian process provided by this application. Figure 1 , the method provided in this embodiment may include: S101. Acquire spatial alarm distribution data of fire-fighting equipment; the spatial alarm distribution data includes a plurality of sub-data, each sub-data representing the number of alarms at different longitudes and latitudes.
[0015] Specifically, the spatial alarm distribution data of fire-fighting equipment represents the status data of fire-fighting equipment changing with space within a specified time. The spatial alarm distribution data of fire-fighting equipment is vector data generated after the number of alarms is arranged in spatial order, which includes multiple sub-data, each sub-data represents the number of alarms at different longitudes and latitudes.
[0016] In the specific implementation, the relevant data files are read, which record the number of alarms of different devices at different times and in different spaces. Furthermore, the data files are filtered based on the equipment number of the fire-fighting equipment and the specified time to obtain the number of alarms of the fire-fighting equipment at different longitudes and latitudes within the specified time, that is, the spatial alarm distribution data of the fire-fighting equipment.
[0017] Optionally, after acquiring the spatial alarm distribution data of the fire-fighting equipment, the method further includes: Each sub-data in the spatial alarm distribution data is added to a second preset value to obtain updated spatial alarm distribution data; the second preset value is a positive number, and the number of alarms corresponding to the longitude and latitude of each sub-data of the updated spatial alarm distribution data is a positive number.
[0018] Specifically, the second preset value is set according to actual needs, and is not limited in this embodiment. It should be noted that the second preset value is a positive number, for example, in one embodiment, the second preset value is 0.5.
[0019] It should be noted that, combined with the above description, each sub-data in the spatial alarm distribution data represents the number of alarms at different longitudes and latitudes. Since the number of alarms may be 0, each sub-data needs to be added to a positive number to ensure that the value of each sub-data is a positive number, and perform logarithmic operations on the updated spatial alarm distribution data to facilitate subsequent data processing and analysis.
[0020] In specific implementation, the spatial alarm distribution data can be updated according to the following formula: ; Among them, the is the updated spatial alarm distribution data; is the spatial alarm distribution data before updating, is the longitude and latitude; is the second preset value.
[0021] The method provided in this embodiment, on the one hand, converts all sub-data into positive numbers by adding each sub-data in the spatial alarm distribution data to a positive number, thereby avoiding the computational problem of logarithmic operations when the sub-data is 0 during subsequent logarithmic operations. On the second hand, logarithmic transformation of the updated spatial alarm distribution data can compress the data range and reduce the impact of extreme values. For the maximum or minimum values that may exist in the spatial alarm data, this helps to mitigate the impact of outliers and enhance the stability of the model. Many real data have multiplication characteristics or present an exponential distribution. After taking the logarithm, they can be converted into a linear relationship, which is convenient for processing using linear models or other analytical methods. After logarithmic transformation, changes in the data are easier to explain.
[0022] S102: Learning Gaussian distribution based on the spatial alarm distribution data, and constructing a Gaussian process prediction model.
[0023] Among them, the Gaussian process prediction model includes a mean function and multiple types of kernel functions. The form of the mean function is matched and the parameters of the mean function are determined based on the changing trend of the spatial alarm distribution data. The kernel function is determined based on the covariance between two coordinate points in the spatial alarm distribution data. Each type of the kernel function corresponds to a type of local correlation feature of the spatial alarm distribution data.
[0024] Specifically, the Gaussian process prediction model is used to predict the number of alarms at the longitude and latitude to be predicted based on the spatial alarm distribution data. The Gaussian process prediction model includes a mean function and multiple types of kernel functions, wherein the mean function represents the overall change trend of the spatial alarm distribution data, and the kernel function represents the correlation between adjacent sub-data in the spatial alarm distribution data. Each type of kernel function represents a type of local correlation feature of the spatial alarm distribution data.
[0025] Furthermore, when determining the mean function, the form of the mean function is matched based on the change trend of the spatial alarm distribution data, and the parameters of the mean function are determined based on the form of the mean function.
[0026] In a specific implementation, the method matches the form of the mean function based on the changing trend of the spatial alarm distribution data and determines the parameters of the mean function, including: analyzing the spatial alarm distribution data to determine the changing trend of the number of alarms with longitude and latitude; determining the form of the corresponding mean function based on the changing trend; fitting the spatial alarm distribution data based on the form of the mean function to determine the parameters of the mean function.
[0027] Specifically, the spatial alarm distribution data is traversed to determine the longitude and latitude corresponding to each sub-data in the spatial alarm distribution data and the number of alarms. Further, the longitude and latitude corresponding to each sub-data and the number of alarms are analyzed, and the relationship between the number of alarms and the longitude and latitude is fitted based on linear regression, polynomial regression or other nonlinear regression methods to determine the changing trend of the number of alarms with the longitude and latitude (linear, nonlinear or periodic trend). Based on the changing trend of the number of alarms with the longitude and latitude, the corresponding mean function form is selected. For example, when the changing trend is a linear trend, the corresponding linear form of the mean function is used; when the changing trend is a nonlinear trend, the corresponding quadratic polynomial form of the mean function is used; when the changing trend is a periodic trend, the corresponding exponential or periodic function is used. Further, the corresponding form of the mean function is substituted into the spatial alarm distribution data, and the least squares method is used to fit the mean function. The error function is minimized to obtain the parameters of the mean function and the mean function is determined.
[0028] Furthermore, when determining the kernel function, it is determined based on the covariance between different coordinate points corresponding to different sub-data in the spatial alarm distribution data.
[0029] In a specific implementation, the kernel function is determined based on the covariance between two coordinate points in the spatial alarm distribution data, including: determining the local correlation characteristics of the spatial alarm distribution data based on the distances between different coordinate points corresponding to different sub-data in the spatial alarm distribution data; the local correlation characteristics characterize the correlation between different sub-data in the spatial alarm distribution data; determining the form of the corresponding kernel function based on the local correlation characteristics of the spatial alarm distribution data; fitting the spatial alarm distribution data based on the form of the kernel function to determine the parameters of the kernel function, and constructing the kernel function based on the parameters and the distances between different coordinate points corresponding to different sub-data in the spatial alarm distribution data.
[0030] Specifically, the local correlation feature characterizes the correlation between different sub-data in the spatial alarm distribution data, that is, the relationship between the number of alarms between different coordinate points. Different local correlation features correspond to different forms of kernel functions. For example, in one embodiment, the local correlation feature includes at least the overall change trend, periodicity and observation data error. Correspondingly, the kernel function corresponding to the overall change trend is an exponential kernel function, the kernel function corresponding to the periodicity is a periodic kernel function, and the kernel function corresponding to the observation data error is a rational quadratic kernel function.
[0031] In the specific implementation, each sub-data in the spatial alarm distribution data is traversed, and for two different sub-data, based on the different coordinate points and different alarm numbers corresponding to the two sub-data, the covariance of the change of the alarm number of the two sub-data with the change of the coordinate point is calculated, and the correlation between the alarm numbers of different coordinate points is quantified based on methods such as Pearson correlation coefficient and Spearman rank correlation coefficient to obtain local correlation characteristics. Further, the local correlation characteristics are analyzed to determine the corresponding form of the kernel function. For example, when the local correlation characteristics are the overall change trend, the corresponding form of the kernel function is determined to be an exponential kernel function. When the local correlation characteristics are periodic, the corresponding form of the kernel function is determined to be a periodic kernel function. When the local correlation characteristics are observation data errors, the corresponding form of the kernel function is determined to be a rational quadratic kernel function. Further, the corresponding form of the kernel function is substituted into the spatial alarm distribution data, the kernel function is fitted using the least squares method, and the parameters of the kernel function are obtained by minimizing the error function. The mean function is determined based on the determined parameters of the kernel function and the distance between the different coordinate points corresponding to different sub-data in the spatial alarm distribution data.
[0032] It should be noted that when calculating the distance between different coordinate points, it can be based on a variety of methods such as Euclidean space distance, earth geographic distance, and weighted information distance. Among them, when calculating based on weighted information distance, relevant information such as population and temperature of the coordinate points must also be considered.
[0033] Among them, the Euclidean space distance can be expressed as: ; Among them, the , are different coordinate points corresponding to different sub-data; , are the components of different coordinate points on the X-axis corresponding to different sub-data; , is the component of different coordinate points on the Y axis corresponding to different sub-data; , It is the component of different coordinate points on the Z axis corresponding to different sub-data.
[0034] Furthermore, the geographical distance of the earth can be expressed as: ; Among them, the , are different coordinate points corresponding to different sub-data; , It is the component of different coordinate points on the X-axis corresponding to different sub-data.
[0035] Furthermore, the weighted information distance can be expressed as: ; Among them, the , are different coordinate points corresponding to different sub-data; , are the components of different coordinate points on the X-axis corresponding to different sub-data; , is the component of different coordinate points on the Y axis corresponding to different sub-data; , are the components of different coordinate points on the Z axis corresponding to different sub-data; , is the population of different coordinate points corresponding to different sub-data; , is the temperature of different coordinate points corresponding to different sub-data; , , , , are the weights corresponding to different components.
[0036] Specifically, when constructing the Gaussian process prediction model, the spatial alarm distribution data is regarded as satisfying the Gaussian random process, that is: ; Among them, the is the spatial alarm distribution data; is a Gaussian process prediction model; is the mean function; is the kernel function; is the longitude and latitude.
[0037] ; Among them, the is the kernel function; is an exponential kernel function; is a periodic kernel function; is a rational quadratic kernel function; is the weight of the kernel function; is the internal parameter of the kernel function; , Different coordinate points corresponding to different sub-data.
[0038] Furthermore, assuming ; ; ; Among them, the are polynomial coefficients, is the spatial alarm distribution data, then .
[0039] S103, solving the optimal parameters of the Gaussian process prediction model.
[0040] Specifically, the optimal parameters of the Gaussian process prediction model include the weight of the kernel function , the internal parameters of the kernel function And the polynomial coefficients .
[0041] In the specific implementation, it is assumed that the optimal parameters of the Gaussian process prediction model are independent of each other, and the parameter optimization problem is converted into a multidimensional optimization problem. The optimal model parameters can be effectively determined by maximizing the marginal likelihood function (in the Gaussian process model, the marginal likelihood function evaluates the probability of data generation given the model parameters and data points). In order to determine the optimal model parameters, the model parameters are adjusted to maximize the marginal likelihood function, that is, to minimize the negative log-likelihood function. The Powell method (a conjugate gradient algorithm suitable for multivariable optimization problems) is used for optimization. After setting the appropriate iteration parameters, the parameter space will be exhaustively searched and iterated until the optimal parameter combination that maximizes the marginal likelihood is determined.
[0042] Specifically, the marginal likelihood function can be expressed as: ; Among them, the is the marginal likelihood function; is the spatial alarm distribution data; is the longitude and latitude; are polynomial coefficients; is the weight of the covariance function; is the internal parameter of the covariance function; is a polynomial matrix, ; is the covariance matrix, Listed as ; The length of the spatial alarm distribution data.
[0043] Furthermore, maximizing the marginal likelihood function is to minimize the negative log-likelihood: ; Among them, the are polynomial coefficients; is the weight of the covariance function; is the internal parameter of the covariance function; is the spatial alarm distribution data; is the longitude and latitude; is the marginal likelihood function.
[0044] S104, determining a first preset number of longitudes and latitudes to be predicted; the first preset number is smaller than the length of the spatial alarm distribution data.
[0045] Specifically, the first preset number is determined according to the spatial alarm distribution data, and the first preset number is smaller than the length of the spatial alarm distribution data.
[0046] In specific implementation, the determination of a first preset number of longitudes and latitudes to be predicted includes: analyzing the changing trend of the spatial alarm distribution data to determine the dividing points in the changing trend; based on the dividing points, calculating the prediction accuracy of the Gaussian process prediction model under each dividing point; determining the dividing point whose prediction accuracy is greater than the first preset value as the target dividing point; calculating the distance between every two target dividing points, and determining the number of sub-data contained between the first dividing point and the second dividing point corresponding to the maximum distance as the first preset number.
[0047] Specifically, the demarcation point refers to a prominent point (maximum value or minimum value) in the change trend. The first preset value is set according to actual needs and is not limited in this embodiment.
[0048] In specific implementation, in combination with the above description, the spatial alarm distribution data is traversed to determine the longitude and latitude and the number of alarms corresponding to each sub-data in the spatial alarm distribution data. Further, the longitude and latitude and the number of alarms corresponding to each sub-data are analyzed, and the relationship between the number of alarms and the longitude and latitude is fitted based on linear regression, polynomial regression or other nonlinear regression methods to determine the changing trend of the number of alarms with the longitude and latitude (linear, nonlinear or periodic trend). Visual analysis is performed on the changing trend to determine the demarcation point. Further, by comparing the predicted number of alarms of the Gaussian process prediction model at each demarcation point with the actual number of alarms, the prediction accuracy of the Gaussian process prediction model (the difference between the predicted number of alarms and the actual number of alarms) is determined. All demarcation points with a prediction accuracy greater than the first preset value are determined as target demarcation points. For all target demarcation points, the distance between the longitude and latitude of each two target demarcation points is calculated based on the distance calculation formula, and the maximum distance among all distances is determined. The number of all sub-data contained between the two target demarcation points (the first demarcation point and the second demarcation point) corresponding to the maximum distance is determined as the first preset number.
[0049] The method provided in this embodiment, when determining the longitude and latitude to be predicted, first determines the demarcation point based on the changing trend of the spatial alarm distribution data, determines the target demarcation point based on the prediction accuracy of the Gaussian process prediction model under each demarcation point, and determines the longitude and latitude corresponding to the sub-data between the two demarcation points with the largest distance between the target demarcation points as the longitude and latitude to be predicted. In this way, the periodicity and long-term trends in the spatial alarm distribution data can be identified, which helps to ensure that the longitude and latitude to be predicted can adapt to the natural periodic changes of the data and reduce the prediction errors caused by the mismatch of periodic changes. Furthermore, the longitude and latitude corresponding to the sub-data between the two demarcation points with the largest distance are determined as the longitude and latitude to be predicted, which can ensure that the selected longitude and latitude to be predicted can cover the main changing trends in the spatial alarm distribution data, and can avoid potential problems caused by too short or too long time periods, and can also ensure that the prediction accuracy of the Gaussian process prediction model can meet the prediction needs.
[0050] S105, inputting the optimal parameters, the longitude and latitude to be predicted, and the spatial alarm distribution data into the Gaussian process prediction model to predict the number of alarms at the longitude and latitude to be predicted.
[0051] In a specific implementation, the optimal parameters, the longitude and latitude to be predicted, and the spatial alarm distribution data are input into the Gaussian process prediction model to predict the alarm quantity of the longitude and latitude to be predicted, including: determining the mean function and covariance function of the Gaussian process prediction model according to the optimal parameters; predicting the first alarm quantity of the longitude and latitude to be predicted according to the determined mean function and covariance function; generating a covariance matrix according to the spatial alarm distribution data, evaluating and correcting the first alarm quantity, and obtaining the final alarm quantity of the longitude and latitude to be predicted.
[0052] Specifically, based on the optimal parameters of the Gaussian process prediction model obtained by solving, the Gaussian process prediction model is optimized, and the mean function and covariance function of the Gaussian process prediction model are determined, that is, the Gaussian process prediction model is determined. Furthermore, the longitude and latitude to be predicted and the spatial alarm distribution data are input into the Gaussian process prediction model to obtain the first alarm number of the longitude and latitude to be predicted. Furthermore, a covariance matrix is constructed based on the updated spatial alarm distribution data, and the first alarm number is evaluated and corrected based on the covariance matrix (the difference between the first alarm number and the actual alarm number is compared, and adjusted in combination with the prediction error and covariance information) to obtain the final alarm number of the longitude and latitude to be predicted.
[0053] The method provided in this embodiment, on the one hand, optimizes and solves the Gaussian process prediction model, determines the mean function and kernel function based on the optimal parameters of the Gaussian process prediction model, and solves the longitude and latitude to be predicted, which helps to reduce prediction errors, improve the accuracy and reliability of predictions, and ensure that the prediction and analysis results are consistent with the actual situation. On the other hand, after the first alarm number is obtained based on the Gaussian process prediction model, a covariance matrix is generated based on the updated spatial alarm distribution data, and the first alarm number is further evaluated and corrected to obtain the final alarm number of the longitude and latitude to be predicted. Since the environment and data patterns may change over time, the fixed spatial alarm distribution data may not be able to adapt to these changes. By dynamically adjusting the spatial alarm distribution data and correcting the prediction results based on the adjusted spatial alarm distribution data, it is possible to better adapt to changes in the environment and data patterns, thereby improving the adaptability of the Gaussian process prediction model to new data.
[0054] Optionally, before inputting the optimal parameters, the longitude and latitude to be predicted and the spatial alarm distribution data into the Gaussian process prediction model, the method also includes: traversing the spatial alarm distribution data, determining the spatial alarm distribution data whose number of sub-data in the spatial alarm distribution data is the first preset number and which is closest to the longitude and latitude to be predicted.
[0055] The method provided in this embodiment adjusts the spatial alarm distribution data according to the longitude and latitude to be predicted before inputting the spatial alarm distribution data into the Gaussian process prediction model for prediction, so that the adjusted spatial alarm distribution data is as close as possible to the longitude and latitude to be predicted in terms of longitude and latitude. This can ensure that the spatial alarm distribution data used when predicting the number of alarms with predicted longitude and latitude can more accurately reflect the latest trends and current patterns, provide more relevant information, help reduce prediction errors, improve the accuracy and reliability of predictions, and ensure that the prediction and analysis results are consistent with the actual situation.
[0056] Optionally, before inputting the optimal parameters, the longitude and latitude to be predicted and the spatial alarm distribution data into the Gaussian process prediction model, the method further includes: traversing the spatial alarm distribution data to determine abnormal data in the spatial alarm distribution data; the difference between the number of alarms corresponding to the abnormal data and the number of alarms corresponding to other sub-data is greater than a preset threshold; for each abnormal data, selecting sub-data at the same longitude and latitude as the abnormal data from the spatial alarm distribution data of the target device, and replacing the abnormal data based on the sub-data.
[0057] Specifically, the difference between the number of alarms corresponding to the abnormal data and the number of alarms corresponding to other sub-data of the spatial alarm distribution data is greater than a preset threshold, wherein the preset threshold is set according to actual needs and is not limited in this embodiment.
[0058] In specific implementation, each sub-data of the spatial alarm distribution data is traversed, and the abnormal data in the spatial alarm distribution data is determined based on the difference between the alarm quantities of different sub-data. Further, for each abnormal data, the abnormal data is replaced with normal data of other devices at the same longitude and latitude as the abnormal data.
[0059] The method provided in this embodiment can ensure that the spatial alarm distribution data used for prediction does not contain abnormal data by performing outlier processing on the spatial alarm distribution data, and ensure that the spatial alarm distribution data can more accurately reflect the latest trends and current patterns, provide more relevant information, help reduce prediction errors, improve the accuracy and reliability of the spatial distribution prediction of fire risks, and ensure that the prediction and analysis results are consistent with the actual situation.
[0060] The method provided in this embodiment, firstly, constructs a Gaussian process prediction model based on spatial alarm distribution data, and predicts the number of alarms at the longitude and latitude to be predicted based on the optimized Gaussian process prediction model. By applying the Gaussian process prediction model to the field of fire safety, the spatial distribution prediction of fire risk is realized. Compared with the traditional spatial distribution prediction method, the present application does not need to repeatedly and tediously adjust the hyperparameters of the Gaussian process prediction model. It only needs to adjust the covariance function and mean function in the Gaussian process prediction model to achieve a better fitting effect, which greatly simplifies the process of model parameter adjustment and does not require a large number of data sets. This makes the present invention easier to implement, reduces the impact of human factors on model performance, and improves the accuracy and stability of prediction. Secondly, when constructing a Gaussian process prediction model based on spatial alarm distribution data, a variety of kernel functions are constructed based on the local correlation characteristics of the spatial alarm distribution data, which effectively grasps the direction of the prediction of the spatial distribution of fire risk, making the training of data more reasonable. In this way, even with a relatively small data set, effective training can be achieved, avoiding the overfitting problem that traditional spatial distribution prediction methods are prone to on small data sets. On the third aspect, when determining the longitude and latitude to be predicted, first determine the demarcation point based on the changing trend of the spatial alarm distribution data, determine the target demarcation point based on the prediction accuracy of the Gaussian process prediction model at each demarcation point, and determine the longitude and latitude corresponding to the sub-data between the two demarcation points with the largest distance between the target demarcation points as the longitude and latitude to be predicted. In this way, the periodicity and long-term trends in the spatial alarm distribution data can be identified, which helps to ensure that the longitude and latitude to be predicted can adapt to the natural periodic changes of the data and reduce the prediction errors caused by the mismatch of periodic changes. Furthermore, the longitude and latitude corresponding to the sub-data between the two demarcation points with the largest distance are determined as the longitude and latitude to be predicted, which can ensure that the selected longitude and latitude to be predicted can cover the main changing trends in the spatial alarm distribution data, and avoid potential problems caused by too short or too long time periods, and can also ensure that the prediction accuracy of the Gaussian process prediction model can meet the prediction needs. Fourthly, by optimizing and solving the Gaussian process prediction model, determining the mean function and kernel function based on the optimal parameters of the Gaussian process prediction model, and solving the longitude and latitude to be predicted, it helps to reduce prediction errors, improve the accuracy and reliability of the prediction, and ensure that the prediction and analysis results are consistent with the actual situation.Furthermore, after the first alarm number is obtained based on the Gaussian process prediction model, a covariance matrix is generated based on the updated spatial alarm distribution data, and the first alarm number is further evaluated and corrected to obtain the final alarm number of the longitude and latitude to be predicted. Since the environment and data patterns may change over time, fixed spatial alarm distribution data may not be able to adapt to these changes. By dynamically adjusting the spatial alarm distribution data and correcting the prediction results based on the adjusted spatial alarm distribution data, it is possible to better adapt to changes in the environment and data patterns, thereby improving the adaptability of the Gaussian process prediction model to new data.
[0061] Corresponding to the aforementioned embodiment of a method for predicting the spatial distribution of fire risk based on a Gaussian process, the present application also provides an embodiment of a device for predicting the spatial distribution of fire risk based on a Gaussian process.
[0062] Figure 2 This is a structural diagram of the first embodiment of the fire risk spatial distribution prediction device based on Gaussian process provided by this application. Figure 2 The device provided in this embodiment includes: an acquisition module 210, a construction module 220, a determination module 230 and a prediction module 240, wherein: The acquisition module 210 is used to acquire spatial alarm distribution data of fire-fighting equipment; the spatial alarm distribution data includes multiple sub-data, each sub-data represents the number of alarms at different longitudes and latitudes; The construction module 220 is used to learn Gaussian distribution based on the spatial alarm distribution data and construct a Gaussian process prediction model; wherein the Gaussian process prediction model includes a mean function and multiple types of kernel functions, the form of the mean function is matched based on the change trend of the spatial alarm distribution data and the parameters of the mean function are determined, and the kernel function is determined based on the covariance between two coordinate points in the spatial alarm distribution data, and each type of the kernel function corresponds to a type of local correlation feature of the spatial alarm distribution data; The determination module 230 is used to solve the optimal parameters of the Gaussian process prediction model; The determination module 230 is further used to determine a first preset number of longitudes and latitudes to be predicted; the first preset number is less than the length of the spatial alarm distribution data; The prediction module 240 is used to input the optimal parameters, the longitude and latitude to be predicted and the spatial alarm distribution data into the Gaussian process prediction model to predict the number of alarms at the longitude and latitude to be predicted.
[0063] The device of this embodiment can be used to perform Figure 1 The steps, specific implementation principles and implementation processes of the method embodiment shown are similar and will not be repeated here.
[0064] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0065] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0066] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for predicting the spatial distribution of fire risk based on Gaussian process, characterized in that: The method comprises: Acquire spatial alarm distribution data of fire-fighting equipment; the spatial alarm distribution data includes a plurality of sub-data, each sub-data representing the number of alarms at different longitudes and latitudes; Learning Gaussian distribution based on the spatial alarm distribution data and constructing a Gaussian process prediction model; The Gaussian process prediction model includes a mean function and multiple types of kernel functions. The form of the mean function is matched based on the change trend of the spatial alarm distribution data and the parameters of the mean function are determined. The kernel function is determined based on the covariance between two coordinate points in the spatial alarm distribution data. Each type of the kernel function corresponds to a type of local correlation feature of the spatial alarm distribution data. Solving the optimal parameters of the Gaussian process prediction model; Determine a first preset number of longitudes and latitudes to be predicted; the first preset number is less than the length of the spatial alarm distribution data; The optimal parameters, the longitude and latitude to be predicted and the spatial alarm distribution data are input into the Gaussian process prediction model to predict the number of alarms at the longitude and latitude to be predicted.
2. The method according to claim 1, characterized in that The step of inputting the optimal parameters, the longitude and latitude to be predicted, and the spatial alarm distribution data into the Gaussian process prediction model to predict the number of alarms at the longitude and latitude to be predicted includes: Determine the mean function and covariance function of the Gaussian process prediction model according to the optimal parameters; Predicting the first alarm quantity of the longitude and latitude to be predicted according to the determined mean function and covariance function; A covariance matrix is generated according to the spatial alarm distribution data, and the first alarm quantity is evaluated and corrected to obtain the final alarm quantity of the longitude and latitude to be predicted.
3. The method according to claim 1, characterized in that The step of determining a first preset number of longitudes and latitudes to be predicted includes: Analyzing the change trend of the spatial alarm distribution data to determine the demarcation point in the change trend; Based on the cutoff points, calculating the prediction accuracy of the Gaussian process prediction model at each cutoff point; Determine the cutoff point at which the prediction accuracy is greater than a first preset value as a target cutoff point; The distance between every two target dividing points is calculated, and the number of sub-data included between the first dividing point and the second dividing point corresponding to the maximum distance is determined as a first preset number.
4. The method according to claim 1, characterized in that: Before inputting the optimal parameters, the longitude and latitude to be predicted, and the spatial alarm distribution data into the Gaussian process prediction model, the method further includes: The spatial alarm distribution data is traversed to determine the spatial alarm distribution data which contains sub-data of the first preset number and is closest to the longitude and latitude to be predicted.
5. The method according to claim 1, characterized in that Before inputting the optimal parameters, the longitude and latitude to be predicted, and the spatial alarm distribution data into the Gaussian process prediction model, the method further includes: Traversing the spatial alarm distribution data, determining abnormal data in the spatial alarm distribution data; the difference between the number of alarms corresponding to the abnormal data and the number of alarms corresponding to other sub-data is greater than a preset threshold; For each abnormal data, sub-data at the same longitude and latitude as the abnormal data are selected from the spatial alarm distribution data of the target device, and the abnormal data is replaced based on the sub-data.
6. The method according to claim 1, characterized in that The matching of the form of the mean function based on the change trend of the spatial alarm distribution data and determining the parameters of the mean function include: Analyze the spatial alarm distribution data to determine the changing trend of the alarm quantity with longitude and latitude; Determine the form of the corresponding mean function based on the change trend; The spatial alarm distribution data is fitted based on the form of the mean function to determine the parameters of the mean function.
7. The method according to claim 1, characterized in that The step of determining a kernel function based on the covariance between two coordinate points in the spatial alarm distribution data comprises: Determining local correlation features of the spatial alarm distribution data based on distances between different coordinate points corresponding to different sub-data in the spatial alarm distribution data; the local correlation features characterize the correlation between different sub-data in the spatial alarm distribution data; Determine the form of the corresponding kernel function based on the local correlation characteristics of the spatial alarm distribution data; The spatial alarm distribution data is fitted based on the form of the kernel function, the parameters of the kernel function are determined, and the kernel function is constructed based on the parameters and the distances between different coordinate points corresponding to different sub-data in the spatial alarm distribution data.
8. The method according to claim 7, characterized in that The local correlation features at least include overall change trend, periodicity and observation data error; the form of the corresponding kernel function determined based on the local correlation features of the spatial alarm distribution data includes: Based on the overall change trend of the spatial alarm distribution data, determining that the kernel function is an exponential kernel function; Based on the periodicity of the spatial alarm distribution data, determining that the kernel function is a periodic kernel function; Based on the observation data error between adjacent sub-data in the spatial alarm distribution data, it is determined that the kernel function is a rational quadratic kernel function.
9. The method according to claim 1, characterized in that: After obtaining the spatial alarm distribution data of the fire-fighting equipment, the method further includes: Each sub-data in the spatial alarm distribution data is added to a second preset value to obtain updated spatial alarm distribution data; the second preset value is a positive number, and the number of alarms corresponding to the longitude and latitude of each sub-data of the updated spatial alarm distribution data is a positive number.
10. A fire risk spatial distribution prediction device based on Gaussian process, characterized in that: The device comprises: an acquisition module, a construction module, a determination module and a prediction module; wherein, The acquisition module is used to acquire spatial alarm distribution data of fire-fighting equipment; the spatial alarm distribution data includes multiple sub-data, each sub-data represents the number of alarms at different longitudes and latitudes; The construction module is used to learn Gaussian distribution based on the spatial alarm distribution data and construct a Gaussian process prediction model; wherein the Gaussian process prediction model includes a mean function and multiple types of kernel functions, the form of the mean function is matched based on the change trend of the spatial alarm distribution data and the parameters of the mean function are determined, and the kernel function is determined based on the covariance between two coordinate points in the spatial alarm distribution data, and each type of the kernel function corresponds to a type of local correlation feature of the spatial alarm distribution data; The determination module is used to solve the optimal parameters of the Gaussian process prediction model; The determination module is further used to determine a first preset number of longitudes and latitudes to be predicted; the first preset number is less than the length of the spatial alarm distribution data; The prediction module is used to input the optimal parameters, the longitude and latitude to be predicted and the spatial alarm distribution data into the Gaussian process prediction model to predict the number of alarms at the longitude and latitude to be predicted.