CN109242223B - Quantum support vector machine evaluation and prediction method for urban public building fire risk - Google Patents
Quantum support vector machine evaluation and prediction method for urban public building fire risk Download PDFInfo
- Publication number
- CN109242223B CN109242223B CN201811418146.2A CN201811418146A CN109242223B CN 109242223 B CN109242223 B CN 109242223B CN 201811418146 A CN201811418146 A CN 201811418146A CN 109242223 B CN109242223 B CN 109242223B
- Authority
- CN
- China
- Prior art keywords
- fire
- fire risk
- training
- prediction
- qsvm
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/063—Operations research, analysis or management
- G06Q10/0635—Risk analysis of enterprise or organisation activities
Landscapes
- Business, Economics & Management (AREA)
- Human Resources & Organizations (AREA)
- Engineering & Computer Science (AREA)
- Strategic Management (AREA)
- Economics (AREA)
- Entrepreneurship & Innovation (AREA)
- Operations Research (AREA)
- Game Theory and Decision Science (AREA)
- Development Economics (AREA)
- Marketing (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Educational Administration (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a quantum support vector machine evaluation method for urban public building fire risk evaluation, which comprises the following steps: determining a fire risk index training sample and a fire risk index testing sample of a fire risk evaluation model; calculating inner product operation among fire risk index training samples by a swap test method; after solving the inner product, introducing a relaxation variable, and solving a linear equation set by using a HHL algorithm to obtain a fire risk standard line; simulating a matrix F, carrying out a QSVM training process, continuously adjusting a fire risk standard line, and then obtaining a QSVM fire prediction training model; testing the test sample set by using the trained QSVM fire prediction training model, then evaluating the QSVM fire prediction training model, and adjusting parameters to continue training if the test fails; and carrying out fire risk assessment and prediction on the urban public building by using the QSVM fire prediction training model passing the test, and updating and correcting the prediction model according to the actual feedback result.
Description
Technical Field
The invention relates to the field of fire prediction, in particular to a method and a system for evaluating and testing fire of a quantum support vector machine for urban public buildings.
Background
With the rapid development of Chinese economy and society, the urbanization process is accelerated, the urban scale is continuously enlarged, the population density is continuously increased, and the building types become diversified. The number of public buildings with complex structure, special functions and high personnel density is also increasing. In the event of a fire, these high risk units present significant casualties and property damage. Fire risk assessment is an effective way to improve the fire protection capability of buildings and reduce the possibility of fire, and fire risk assessment of large public buildings has become a research hotspot at present.
Rapid detection and prediction is a key measure to control this phenomenon. The common fire prediction methods comprise multiple regression, decision tree, random forest, neural network and support vector machine methods, and academic data shows that each method is modeled by using four different input characteristics respectively, the areas burnt by the fire are compared, and the Gaussian kernel support vector machine has the best prediction result.
The support vector machine is a machine learning method based on a statistical learning theory, and improves the generalization capability of a learning machine by seeking for the minimization of structured risk. The method has great advantages in theory, can solve the problem of small sample learning, and has been successfully applied to the fields of pattern recognition, function fitting and the like. The support vector machine converts the inner product operation in the high-dimensional feature space after nonlinear transformation into the calculation of the kernel function in the original input space by introducing the kernel function, and even the form of the nonlinear function is unknown after the kernel function is adopted.
The least square support vector machine (LS-SVM) is used as an improved algorithm of the support vector machine, the solving process is changed into the solution of a group of equation equations, so that the solving speed is relatively accelerated, the problem of dimension disaster solved by a quadratic programming method for the support vector machine is solved, the method is suitable for the problem of large samples, and the generalization capability is good.
Although the LS-SVM uses only a very small number of support vectors, all samples and all characteristics are computationally traversed, and thus the time complexity is a polynomial level of the number of features N and the number of samples M. When the number of samples is large, such as reaching TB (2^40) and PB (2^50) levels, the amount of computation is considerable.
The traditional qualitative analysis method is low in accuracy, the semi-quantitative analysis method is influenced by subjective factors, and the event tree, the accident tree, the fire simulation method and the neural network method have high requirements on fire statistical data and are easy to fall into the problem that the convergence time of the local minimum value is too long; the time complexity of the traditional SVM method is a polynomial level of the feature quantity N and M, and the time complexity is high.
Disclosure of Invention
The invention aims to apply the quantum acceleration technology to fire prediction and risk assessment and solve the problem that the traditional SVM algorithm consumes a large amount of computing resources and computing time.
In order to achieve the above purpose, the present invention provides a fire prediction and risk assessment method for an urban public building based on Quantum-SVM (i.e. QSVM, Quantum acceleration-based support vector machine), comprising the following steps:
the quantum support vector machine evaluation and prediction method for the fire risk of the urban public building is provided, and comprises the following steps:
s1, determining a fire risk index training sample and a fire risk index testing sample of the fire risk assessment model;
s2, calculating inner product operation among fire risk index training samples by a swap test method;
s3, after solving the inner product, introducing a relaxation variable, and solving a linear equation set by using a HHL algorithm to obtain a fire risk standard line;
s4, simulating a matrix F, carrying out a QSVM training process, continuously adjusting a fire risk standard line, and then obtaining a QSVM fire prediction training model;
s5, testing the test sample set by using the trained QSVM fire prediction training model, then evaluating the QSVM fire prediction training model, and adjusting parameters of the QSVM fire prediction training model to continue training if the test fails;
and S6, carrying out fire risk assessment and prediction on the urban public building by using the QSVM fire prediction training model passing the test, and updating and correcting the prediction model according to the actual feedback result.
In step S2, the inner product between samples is calculated by the exchange test method:
the formula is expressed by a Dirac symbol, |0> refers to quantum state 0, | ψ > | φ > refers to the quantum state corresponding to the fire risk assessment sample, and the lower subscript refers to a quantum bit;
H1finger-to-first quantum state Hadamard gate conversion, Swap2,3Meaning that the second and third quantum states are swapped using a Swap gate.
In connection with the above technical solution, the method of introducing a relaxation variable in step S3 and solving a linear equation set using HHL algorithm is as follows:
3.1 phase estimation from initial inputs, after phase estimation algorithm, intermediate register input | b>Will be decomposed in the eigenspace of the Hermitian matrix, denoted as | b>=β|μj>Beta is input | b>The eigenvalue lambda of the Hermitian matrix is compared with the eigenvector after the eigen space decomposition of the Hermitian matrixjAbbreviated as j;
3.2 designing a function f (j) about the ground state | j >
3.3 adding an additional quantum bit, setting the initial value as |0>, designing a mapping R: mapping the additional qubits from the ground state |0> to the superposition of |0> and |1>, while extracting the function f (j) to the probabilistic magnitude of the ground state |1>, as follows:
3.4 additional qubits are measured, resulting in |1 when measured>The original register is composed of a series of | j>Becomes f (j) | j>When the measurement result is |0>, recalculating; after the above steps, the value in the ground state | j > is extracted to the probability amplitude corresponding to the ground state | j > according to the ratio of f (j), and the inversion is performedPhase estimation will be lambdaj>→|0>And further solving a linear equation set according to the following formula:
wherein C is a constant factor, λjThe eigenvalues of the Hermitian matrix, and beta is the decomposed eigenvector in 3.1 after decomposition.
In connection with the above technical solution, the construction method of the simulation matrix F in step S4 is mainly divided into three levels:
4.1 simulationIn the formulaWhere T is the number of time steps, T0Is run time, simulation for input to the second step of the algorithmIs at the heart of simulation
4.2 simulationThis step of kernel operation is implemented by reducing the density operator, that is, by performing a bias operation on the density operator, wherein the generalized density operator functions as follows:
4.3 simulationIf it is notIs sparse and performs effective simulation; in thatAnd when the matrix is a non-sparse matrix, performing effective simulation on the non-sparse matrix or the Hermite matrix.
In step S1, a fire risk assessment is performed by using an SVM method, which includes obtaining a learning sample including two parts, a training sample and a testing sample, establishing an SVM evaluation model through learning and training of the training sample, and verifying the correctness of the model by using the testing sample.
The invention also provides a quantum support vector machine evaluation and prediction system for urban public building fire risk, which comprises the following steps:
the system comprises a sample module, a fire risk index training module and a fire risk index testing module, wherein the sample module is used for determining a fire risk index training sample and a fire risk index testing sample of a fire risk evaluation model;
the inner product calculation module is used for calculating the inner product among the fire risk index training samples by a swap test method;
the fire risk standard line solving module is used for introducing a relaxation variable after solving the inner product, and solving a linear equation set by using a HHL algorithm to obtain a fire risk standard line;
the QSVM fire prediction training model module is used for simulating a matrix F, carrying out a QSVM training process, continuously adjusting a fire risk standard line and then obtaining a QSVM fire prediction training model;
the model training module is used for testing the test sample set by using the trained QSVM fire prediction training model, then evaluating the QSVM fire prediction training model, and adjusting parameters of the QSVM fire prediction training model to continue training if the QSVM fire prediction training model fails in the test;
and the fire risk assessment and prediction module is used for performing fire risk assessment and prediction on the urban public building by using the QSVM fire prediction training model passing the test, and updating and correcting the prediction model according to the actual feedback result.
In the above technical solution, the inner product calculation module specifically calculates the inner product between samples by an exchange test method:
the formula is expressed by a Dirac symbol, |0> refers to quantum state 0, | ψ > | φ > refers to the quantum state corresponding to the fire risk assessment sample, and the lower subscript refers to a quantum bit;
H1finger-to-first quantum state Hadamard gate conversion, Swap2,3Meaning that the second and third quantum states are swapped using a Swap gate.
According to the technical scheme, when a relaxation variable is introduced into the fire risk standard line solving module, the method for solving the linear equation set by using the HHL algorithm is as follows:
3.1 phase estimation from initial input, after phase estimation algorithm, the input | b > of the middle register is decomposed in the eigenspace of Hermitian matrix, which is expressed as | b ═ β | μ |jBeta is the eigenvector of Hermitian matrix after decomposition of input | b > in the eigenspace of Hermitian matrix, and the eigenvalue lambda of Hermitian matrix is converted intojIs abbreviated asj;
3.2 designing a function f (j) about the ground state | j >
3.3 add an additional qubit, set the initial value to |0>, design a mapping R: mapping the additional qubits from the ground state |0> to the superposition of |0> and |1>, and extracting the function f (j) to the probabilistic amplitude of the ground state |1>, as follows:
3.4 additional qubits are measured, resulting in |1 when measured>The original register is composed of a series of | j>Becomes f (j) | j>When the measurement result is |0>When the calculation is carried out again; through the above steps, the ground state | j>Is extracted to the corresponding ground state | j in proportion to f (j)>On the probability amplitude of (c), the inverse phase estimation is performed to obtain | λj>→|0>And further solving a linear equation set according to the following formula:
wherein C is a constant factor, λjThe eigenvalues of the Hermitian matrix, and beta is the decomposed eigenvector in 3.1 after decomposition.
According to the technical scheme, the QSVM fire prediction training model module is mainly divided into three levels in the construction method of the simulation matrix F:
4.1 simulationIn the formulaWhere T is the number of time steps, T0Is run time, pairInput in the second step of the algorithm, simulationIs at the heart of simulation
4.2 simulationThis step of kernel operation is implemented by reducing the density operator, that is, by performing a bias operation on the density operator, wherein the generalized density operator functions as follows:
4.3 simulationIf it is notIs sparse and performs effective simulation; in thatAnd when the matrix is a non-sparse matrix, performing effective simulation on the non-sparse matrix or the Hermite matrix.
According to the technical scheme, the learning sample obtained by the sample module comprises a training sample and a testing sample, an SVM evaluation model is established through the learning training of the training sample, and the correctness of the model is verified by using the testing sample.
The invention has the beneficial effects that: the fire risk evaluation and prediction algorithm based on the quantum acceleration of the least square support vector machine can provide exponential acceleration, time complexity of the traditional vector support machine is reduced, and due to the fact that quantum mechanics can generate atypical data patterns, the method can identify statistical patterns which are difficult to identify through the traditional classical algorithm.
Drawings
The invention will be further described with reference to the accompanying drawings, in which:
FIG. 1 is a flow chart of a Quantum-LSSVM model evaluation method for urban public building fire prediction and risk evaluation according to the present invention;
FIG. 2 is a circuit diagram of inner products between samples based on Standardswaptest according to an embodiment of the present invention;
fig. 3 is a detailed process diagram of the HHL algorithm of an embodiment of the invention;
FIG. 4 is an illustration of the parameters used by the present invention for the simulation matrix F;
FIG. 5 is an illustration of the simulation matrix F simulation process (partial derivation of density operators) according to the present invention;
FIG. 6 is a schematic diagram of an efficient simulation method of a non-sparse matrix or Hermite matrix in accordance with an embodiment of the present invention;
FIG. 7 is a schematic diagram of a fire risk assessment model training process of the Quantum-LSSVM fire risk assessment method.
Detailed description of the invention
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Determining training and testing samples for a fire risk assessment model (step S1)
Firstly, establishing a fire risk assessment model of a Quantum-LSSVM, which specifically comprises the following steps: and determining index sample data, performing normalization processing on all sample data to serve as an input vector of the Quantum-LSSVM, then determining the optimal learning parameter, and determining the optimal decision function through training to obtain a fire prediction training model of the Quantum-LSSVM.
Taking a certain market as an example, each index factor of the market is evaluated to obtain an evaluation result. In order to simplify the training complexity, 32 three-level index factors are selected as input, and the fire risk assessment result is output. And selecting 12 groups of data for risk assessment, wherein the first ten groups are training samples for training a Quantum-LSSVM fire evaluation model, and the last two groups are test samples for testing the trained evaluation model. The index system is shown in table 1 below:
TABLE 1 three-stage evaluation index for fire of buildings
The index sample data comprises both absolute indexes and relative indexes, the dimension and magnitude of each index are different, if the indexes are directly input into a Quantum-LSSVM model for learning, the learning precision is probably influenced, and the learning capability of the SVM is reduced, so that when the Quantum-LSSVM is used for carrying out fire risk assessment of public buildings, the learning sample data needs to be subjected to normalization processing. For example, a [0,1] normalization process is adopted, that is, all sample data are linearly stretched to a [0,1] interval, and the normalization formula is as follows:
in the formula: a. thejIs XjNormalized value of (A), XjminIs the minimum value of the j index, XjmaxIs the maximum value of the j-th index. At this time, the classical data set also needs to be stored into the quantum associative memory through conversion. For M classical data, using quantum superposition characteristics, storing on N qubits, using statesShowing, the detailed process is not described in the expansion.
Step S2 is to solve Lagrangian operator by swap test, and calculate inner product operation between samples, namely kernel function, by swap test method (step S2)
When the lagrangian operator alpha is solved, kernel functions, namely inner product operation among samples, are involved, and the swaptest method is adopted.
Is provided withIs a set of fire observation or training samples from the population (X, Y), where XjIs an n-dimensional input vector corresponding to the fire prediction level three indicator data, y, abovejIs 1-dimensional output data corresponding to fire prediction index data of a high-dimensional space. The mapping is to solve the problem that fire prediction index data is inseparable in low dimension. In the feature space, the SVM takes the form:
wherein the non-linear mappingThe input data is mapped into a higher dimensional feature space. And ω and b are solutions to the following optimization problem:
For KjkThe solution of (2) is realized by adopting a circuit based on Standardwaptest and an inner product between samples as shown in FIG. 2 through two Hadamard transformations and one Swap operation, and the specific realization process is as follows:
the inner product K between samples can be obtained according to the measurement result of the ground statejk.. The above formula is expressed by Dirac symbols, |0>Indicating the quantum state 0, | ψ > | phi>The quantum state corresponding to the fire risk assessment sample is indicated, and the lower subscript refers to a quantum bit (namely, the fourth quantum state); h1Finger-to-first quantum state Hadamard gate conversion, Swap2,3Meaning that the second and third quantum states are swapped using a Swap gate. And the fire prediction index is mapped to a high-dimensional space, so that the problem that the fire prediction index is inseparable in a low-dimensional space is avoided.
And (III) after the inner product is solved, introducing a relaxation variable, and solving a linear equation system by using a HHL algorithm, wherein the solution of the linear equation system is actually used for determining a fire risk standard line. (step S3)
The fire risk standard line is used for assisting in understanding the training process of the quantum-lssvm fire risk model, namely the process of training the model is the process of determining and adjusting the fire risk standard line.
And determining whether the fire risk exists according to the direction of the fire risk index point deviating from the fire risk standard line, and determining the risk grade according to the degree of deviation. Detailed procedure of HHL algorithm referring to fig. 3, the HHL algorithm is divided into three sub-procedures: phase estimation, controlled rotation and inverse phase estimation, wherein the core of the controlled rotation is that the inverse of the ground state value is proportionally extracted to the probability amplitude of the corresponding ground state.
Step S3 is specifically as follows:
3.1 phase estimation from initial inputs, after phase estimation algorithm, intermediate register input | b>The decomposition is performed in the eigenspace of the Hermitian matrix, denoted as b ═ β |. mujThe eigenvalues λ of the Hermitian matrixjAbbreviated as j;
3.2 designing a function f (j) about the ground state | j >
3.3 adding an additional quantum bit, setting the initial value as |0>, designing a mapping R: mapping the additional qubits from the ground state |0> to the superposition of |0> and |1>, while extracting the function f (j) to the probabilistic magnitude of the ground state |1>, as follows:
3.4 additional qubits are measured, resulting in |1 when measured>The original register is composed of a series of | j>Becomes f (j) | j>When the measurement result is |0>When the calculation is carried out again; through the above steps, the ground state | j>Is extracted to the corresponding ground state | j in proportion to f (j)>On the probability amplitude of (c), the inverse phase estimation is performed to obtain | λj>→|0>Further, a linear equation system is obtained according to the following formulaThe solution of (a):
the other parameters can be determined through the solution of the linear equation system, specifically, the kernel matrix, namely the precursor of the kernel function, and the kernel matrix meeting the semi-positive condition can be used as the kernel function.
(IV) simulating the matrix F to perform a QSVM training process, namely continuously adjusting the fire risk standard line and then obtaining a QSVM fire prediction training model (step S4)
The construction method of the simulation matrix F in the step S4 is mainly divided into three layers:
4.1 simulationIn the formulaWhere T is the number of time steps in phaseestimate, T0Is the run time of phaseestimate. For the input of the second step of the algorithm, the simulation is performed, as shown in FIG. 4Is at the heart of simulation
4.2 simulation, as shown in FIG. 5This step of kernel operation is implemented by reducing the density operator, that is, by performing a bias operation on the density operator, wherein the generalized density operator functions as follows:
4.3 simulation, as shown in FIG. 6If it is notIs sparse and can be effectively simulated. In thatAnd when the matrix is a non-sparse matrix, effective simulation is carried out through the non-sparse matrix or the Hermite matrix. FIG. 6 illustrates a simulation method where K is a non-sparse matrix.
After the matrix F is simulated, the model can be trained smoothly, the process of model training is divided into five steps, the quantum state is prepared, the phase estimation, the controlled rotation, the amplitude amplification (amplitude amplification) and the quantum state measurement are performed, the objective is to solve the linear equation, and the specific process is shown in fig. 7.
And (V) testing the test set by using the trained model, then evaluating the trained model, and if the test fails, adjusting the parameters to continue training (step S5).
And carrying out fire risk assessment and prediction on the test set by using the trained model to obtain a fire risk assessment value, namely a predicted value, which is used as an output vector of the Quantum-LSSVM fire prediction model. The quantum realization of the acceleration gain of the LS-SVM can be realized in the retraining period, and the matrix inversion algorithm, the quantum realization of the non-coefficient density matrix and the existence of the analog sparse Hamiltonian quantity can also realize the acceleration gain. At this time, the eigenvector and the eigenvalue are obtained by quantum phase estimation, and the complexity of the overall runtime training is o (logmn).
The test set not only contains fire risk factors, but also contains risk evaluation results, and the accuracy of the model is evaluated by comparing the risk index result given by the model with the risk index of the test set (the more accurate the model is, the better the overfitting condition is considered).
And (VI) carrying out fire risk assessment and prediction on the urban public buildings by using the model passing the test, and updating and correcting the prediction model according to the actual feedback result (step S6).
The actual feedback result refers to that after the model carries out risk assessment on the real building, the risk assessment result given by an expert group or an intra-worker is compared to obtain feedback, and the method for correcting the risk assessment model is that the actual feedback data is used as new test set data, and the fire risk assessment model is retrained.
It should be noted that the acquisition of the prediction result needs to be obtained from the quantum associative memory by using a Grover algorithm search according to the mode, and is not described here.
The fire risk assessment and prediction algorithm based on the quantum acceleration least square support vector machine can provide exponential acceleration, the number of 1TB is processed in classical calculation, and only 40 quanta bits in quanta are in the order of magnitude. Specifically, for the inner product operation between samples, the quantum swap test method can achieve the complexity of o (logn) (the algorithm complexity of the traditional support vector machine SVM is o (n)), and similarly, for the problem of the linear equation set in the least squares support vector machine LSSVM, the quantum HHL algorithm can still achieve exponential level acceleration. The time complexity of the traditional vector support machine is reduced, and due to the fact that the quantum mechanics can generate atypical data patterns, the statistical patterns which are difficult to recognize by the traditional classical algorithm can be recognized by the method.
The invention also provides a quantum support vector machine evaluation and prediction system for urban public building fire risk, which is used for realizing the technical scheme, and the system specifically comprises:
the system comprises a sample module, a fire risk index training module and a fire risk index testing module, wherein the sample module is used for determining a fire risk index training sample and a fire risk index testing sample of a fire risk evaluation model;
the inner product calculation module is used for calculating the inner product among the fire risk index training samples by a swap test method;
the fire risk standard line solving module is used for introducing a relaxation variable after solving the inner product, and solving a linear equation set by using a HHL algorithm to obtain a fire risk standard line;
the QSVM fire prediction training model module is used for simulating a matrix F, carrying out a QSVM training process, continuously adjusting a fire risk standard line and then obtaining a QSVM fire prediction training model;
the model training module is used for testing the test sample set by using the trained QSVM fire prediction training model, then evaluating the QSVM fire prediction training model, and adjusting parameters of the QSVM fire prediction training model to continue training if the QSVM fire prediction training model fails in the test;
and the fire risk assessment and prediction module is used for performing fire risk assessment and prediction on the urban public building by using the QSVM fire prediction training model passing the test, and updating and correcting the prediction model according to the actual feedback result.
Each module may also implement the evaluation and prediction method in other embodiments, which are not described herein.
The computer readable storage medium of the embodiment of the invention stores a computer program executable by a processor, and the computer program executes the quantum support vector machine evaluation and prediction method for urban public building fire risk in the above embodiments.
In conclusion, the quantum acceleration technology is applied to the LSSVM, so that the accuracy of fire prediction and risk assessment is guaranteed, the algorithm complexity is greatly reduced, the calculation resources are effectively saved, and the calculation efficiency is improved.
It will be understood that modifications and variations can be made by persons skilled in the art in light of the above teachings and all such modifications and variations are intended to be included within the scope of the invention as defined in the appended claims.
Claims (8)
1. A quantum support vector machine evaluation and prediction method for urban public building fire risk is characterized by comprising the following steps:
s1, determining a fire risk index training sample and a fire risk index testing sample of the fire risk assessment model;
s2, calculating the inner product among the fire risk index training samples by a swap test method;
s3, after solving the inner product, introducing a relaxation variable, and solving a linear equation set by using a HHL algorithm to obtain a fire risk standard line;
s4, simulating a matrix F, carrying out a QSVM training process, continuously adjusting a fire risk standard line, and then obtaining a QSVM fire prediction training model;
s5, testing the test sample set by using the trained QSVM fire prediction training model, then evaluating the QSVM fire prediction training model, and adjusting parameters of the QSVM fire prediction training model to continue training if the test fails;
s6, carrying out fire risk assessment and prediction on the urban public building by using the QSVM fire prediction training model passing the test, and updating and correcting the prediction model according to the actual feedback result;
the construction method of the simulation matrix F in the step S4 mainly comprises three layers:
4.1 simulationIn the formulaWhere T is the number of time steps, T0Is run time, simulation for input to the second step of the algorithmIs at the heart of simulation
4.2 simulationThis step of kernel operation is implemented by reducing the density operator, that is, by performing a bias operation on the density operator, wherein the generalized density operator functions as follows:
2. The method for assessing and predicting fire risk of urban public buildings according to claim 1, wherein the inner product between samples is calculated in step S2 by the exchange test method:
the formula is expressed by a Dirac symbol, |0> refers to quantum state 0, | ψ > | phi > refers to the quantum state corresponding to the fire risk assessment sample, and the lower subscript refers to a quantum bit;
H1finger-to-first quantum state Hadamard gate conversion, Swap2,3Meaning that the second and third quantum states are swapped using a Swap gate.
3. The method for evaluating and predicting the fire risk of urban public buildings according to claim 1, wherein relaxation variables are introduced in step S3, and the method for solving the linear equation system by using the HHL algorithm is as follows:
3.1 phase estimation from initial inputs, after phase estimation algorithm, intermediate register input | b>The decomposition is performed in the eigenspace of the Hermitian matrix, denoted lb>=β|μj>Beta is input | b>The eigenvalue lambda of the Hermitian matrix is compared with the eigenvector after the eigen space decomposition of the Hermitian matrixjAbbreviated as j;
3.2 designing a function f (j) about the ground state | j >
3.3 adding an additional quantum bit, setting the initial value as |0>, designing a mapping R: mapping the additional qubits from the ground state |0> to the superposition of |0> and |1>, while extracting the function f (j) to the probabilistic magnitude of the ground state |1>, as follows:
3.4 additional qubits are measured, resulting in |1 when measured>The original register is composed of a series of | j>Becomes f (j) | j>When the measurement result is |0>When the calculation is carried out again; through the above steps, the ground state | j>Is extracted to the corresponding ground state | j in proportion to f (j)>On the probability amplitude of (c), the inverse phase estimation is performed to obtain | λj>→|0>And further solving a linear equation set according to the following formula:
wherein C is a constant factor, λjThe eigenvalues of the Hermitian matrix, and beta is the decomposed eigenvector in 3.1 after decomposition.
4. The method according to claim 1, wherein in step S1, the method for evaluating and predicting fire risk of urban public buildings is implemented by using an SVM method, and comprises the steps of firstly obtaining learning samples including training samples and testing samples, establishing an SVM evaluation model through the learning training of the training samples, and then verifying the correctness of the model by using the testing samples.
5. A quantum support vector machine evaluation and prediction system for urban public building fire risk, comprising:
the system comprises a sample module, a fire risk index training module and a fire risk index testing module, wherein the sample module is used for determining a fire risk index training sample and a fire risk index testing sample of a fire risk evaluation model;
the inner product calculation module is used for calculating the inner product among the fire risk index training samples by a swap test method;
the fire risk standard line solving module is used for introducing a relaxation variable after solving the inner product, and solving a linear equation set by using a HHL algorithm to obtain a fire risk standard line;
the QSVM fire prediction training model module is used for simulating a matrix F, carrying out a QSVM training process, continuously adjusting a fire risk standard line and then obtaining a QSVM fire prediction training model;
the model training module is used for testing the test sample set by using the trained QSVM fire prediction training model, then evaluating the QSVM fire prediction training model, and adjusting parameters of the QSVM fire prediction training model to continue training if the QSVM fire prediction training model fails in the test;
the fire risk assessment and prediction module is used for performing fire risk assessment and prediction on the urban public building by using the QSVM fire prediction training model passing the test, and updating and correcting the prediction model according to the actual feedback result;
the QSVM fire prediction training model module is mainly divided into three levels in a construction method of a simulation matrix F:
4.1 simulationIn the formulaWhere T is the number of time steps, T0Is run time, simulation for input to the second step of the algorithmIs at the heart of simulation
4.2 simulationThis step of kernel operation is implemented by reducing the density operator, that is, by performing a bias operation on the density operator, wherein the generalized density operator functions as follows:
6. The system of claim 5, wherein the inner product calculation module calculates inner products between samples by a crossover test method:
the above formula is expressed by Dirac symbols, |0>Refers to the quantum state 0, | ψ>lφ>The method is characterized in that the method refers to a quantum state corresponding to a fire risk assessment sample, and a lower corner mark refers to a quantum bit; h1Finger-to-first quantum state Hadamard gate conversion, Swap2,3Meaning that the second and third quantum states are swapped using a Swap gate.
7. The system for evaluating and predicting the fire risk of urban public buildings according to claim 5, wherein the fire risk standard line solving module is used for solving a linear equation system by using a HHL algorithm after introducing a relaxation variable as follows:
3.1 phase estimation from initial inputs, after phase estimation algorithm, intermediate register input | b>Will be decomposed in the eigenspace of the Hermitian matrix, denoted as | b>=β|μj>Beta is input | b>The eigenvalue lambda of the Hermitian matrix is compared with the eigenvector after the eigen space decomposition of the Hermitian matrixjAbbreviated as j;
3.2 designing a function f (j) about the ground state lj >
3.3 adding an additional quantum bit, setting the initial value as |0>, designing a mapping R: mapping the additional qubits from the ground state |0> to the superposition of |0> and |1>, while extracting the function f (j) to the probabilistic magnitude of the ground state |1>, as follows:
3.4 additional qubits are measured, resulting in |1 when measured>The original register is composed of a series of | j>Becomes f (j) | j>When the measurement result is |0>When the calculation is carried out again; through the above steps, the ground state lj>Is extracted to the corresponding ground state lj in proportion to f (j)>On the probability amplitude of (c), performing inverse phase estimation on l lambdaj>→|0>And further solving a linear equation set according to the following formula:
wherein C is a constant factor, λjThe eigenvalues of the Hermitian matrix, and beta is the decomposed eigenvector in 3.1 after decomposition.
8. The system for evaluating and predicting the fire risk of the urban public building according to claim 5, wherein the learning samples acquired by the sample module comprise training samples and testing samples, an SVM evaluation model is established through the learning training of the training samples, and the correctness of the model is verified by using the testing samples.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811418146.2A CN109242223B (en) | 2018-11-26 | 2018-11-26 | Quantum support vector machine evaluation and prediction method for urban public building fire risk |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811418146.2A CN109242223B (en) | 2018-11-26 | 2018-11-26 | Quantum support vector machine evaluation and prediction method for urban public building fire risk |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN109242223A CN109242223A (en) | 2019-01-18 |
| CN109242223B true CN109242223B (en) | 2021-09-21 |
Family
ID=65074129
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201811418146.2A Active CN109242223B (en) | 2018-11-26 | 2018-11-26 | Quantum support vector machine evaluation and prediction method for urban public building fire risk |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN109242223B (en) |
Families Citing this family (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111081020B (en) * | 2019-12-26 | 2020-11-10 | 安徽揣菲克科技有限公司 | Vehicle-mounted traffic accident early warning device based on cloud edge combination |
| CN111311000B (en) * | 2020-02-14 | 2021-09-28 | 北京百度网讯科技有限公司 | User consumption behavior prediction model training method, device, equipment and storage medium |
| CN113553754A (en) * | 2020-04-23 | 2021-10-26 | 中国石油化工股份有限公司 | Memory, fire risk prediction model construction method, system and device |
| CN112651418B (en) * | 2020-05-25 | 2022-03-08 | 腾讯科技(深圳)有限公司 | Data classification method, classifier training method and system |
| CN112232512B (en) * | 2020-09-08 | 2023-09-29 | 中国人民解放军战略支援部队信息工程大学 | Quantum calculation simulation platform and linear equation set quantum solution simulation method and system |
| CN114418104B (en) * | 2020-10-28 | 2023-08-08 | 本源量子计算科技(合肥)股份有限公司 | Quantum application problem processing method and device |
| CN113487223B (en) * | 2021-07-23 | 2024-04-30 | 深圳市城市公共安全技术研究院有限公司 | Risk assessment method and system based on information fusion |
| CN113657275B (en) * | 2021-08-16 | 2022-09-27 | 中国科学院空天信息创新研究院 | A kind of automatic detection method of forest and grass fire point |
| CN114066269A (en) * | 2021-11-19 | 2022-02-18 | 国网福建省电力有限公司 | Running risk assessment technology for old assets |
| CN113902963B (en) * | 2021-12-10 | 2022-06-17 | 交通运输部公路科学研究所 | Method and device for evaluating fire detection capability of tunnel |
| CN116432760A (en) * | 2021-12-30 | 2023-07-14 | 本源量子计算科技(合肥)股份有限公司 | Quantum data classification method, device, electronic equipment and storage medium |
| CN115099263A (en) * | 2022-05-23 | 2022-09-23 | 上海工程技术大学 | A fault diagnosis method and system based on quantum support vector machine |
| CN115099673A (en) * | 2022-07-13 | 2022-09-23 | 北京石油化工学院 | Method for dynamically and intelligently evaluating dangerous chemical storehouse fire hazard risk |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104008278B (en) * | 2014-05-14 | 2017-02-15 | 昆明理工大学 | PM2.5 concentration prediction method based on feature vectors and least square support vector machine |
| CA2968221A1 (en) * | 2014-11-17 | 2016-05-26 | Boston Heart Diagnostic Corporation | Cardiovascular disease risk assessment |
| CN108345996B (en) * | 2018-02-06 | 2021-07-20 | 北京天润新能投资有限公司 | A system and method for reducing wind power power assessment power |
| CN108846547A (en) * | 2018-05-06 | 2018-11-20 | 成都信息工程大学 | A kind of Enterprise Credit Risk Evaluation method of dynamic adjustment |
-
2018
- 2018-11-26 CN CN201811418146.2A patent/CN109242223B/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| CN109242223A (en) | 2019-01-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109242223B (en) | Quantum support vector machine evaluation and prediction method for urban public building fire risk | |
| Kong et al. | Deep PLS: A lightweight deep learning model for interpretable and efficient data analytics | |
| Zhang et al. | Seismic response prediction of a damped structure based on data-driven machine learning methods | |
| Zeng et al. | A GA-based feature selection and parameter optimization for support tucker machine | |
| CN111416797B (en) | Intrusion detection method for optimizing regularization extreme learning machine by improving longicorn herd algorithm | |
| CN114154557B (en) | Cancer tissue classification method, device, electronic device and storage medium | |
| Czajkowski et al. | Steering the interpretability of decision trees using lasso regression-an evolutionary perspective | |
| CN106778846A (en) | A kind of method for forecasting based on SVMs | |
| CN115561005B (en) | Chemical process fault diagnosis method based on EEMD decomposition and lightweight neural network | |
| CN114004346A (en) | Soft sensing modeling method and storage medium based on gated stacked isomorphic autoencoder | |
| CN111192158A (en) | Transformer substation daily load curve similarity matching method based on deep learning | |
| CN117114184A (en) | A method and device for feature extraction and medium- and long-term prediction of factors affecting urban carbon emissions | |
| CN116169670A (en) | A short-term non-resident load forecasting method and system based on improved neural network | |
| Tian et al. | Software trustworthiness evaluation model based on a behaviour trajectory matrix | |
| dos Santos Coelho et al. | Nonlinear identification using a B-spline neural network and chaotic immune approaches | |
| Wang et al. | Design of progressive fuzzy polynomial neural networks through gated recurrent unit structure and correlation/probabilistic selection strategies | |
| CN111222689A (en) | LSTM load prediction method, medium, and electronic device based on multi-scale temporal features | |
| Chen et al. | Relevance vector machines-based time series prediction for incomplete training dataset: Two comparative approaches | |
| CN119541706A (en) | Chemical raw material detection method, system, medium and equipment based on adversarial network | |
| CN119480107A (en) | A method, device, medium and equipment for constructing a vital sign data monitoring model | |
| Dan et al. | Application of machine learning in forecasting energy usage of building design | |
| CN115761654B (en) | Vehicle re-identification method | |
| Liu et al. | Deep amortized relational model with group-wise hierarchical generative process | |
| Madayag et al. | Multi-Kernel Canonical Variate Analysis with Bayesian Optimized Kernel Designs for Nonlinear System Identification | |
| Singh et al. | Genetic Algorithm based Feature Selection to Enhance Breast Cancer Classification |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |