Flow pipe approximate generation method and device based on neural network, medium and equipment

Through the approximate generation method of flow tubes based on neural networks, through period division and deep neural network training, the problem of insufficient flow tube approximation accuracy in the existing technology is solved, and high-precision approximate generation of flow tubes is achieved, which is suitable for any two-dimensional continuous system, and effectively control the decline in accuracy.

CN118734708AActive Publication Date: 2024-10-01NANJING UNIV
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410919136.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-08
Publication Date
2024-10-01
Estimated Expiration
2044-07-08

AI Technical Summary

Technical Problem

It is difficult to generate high-precision flow tube approximation with existing technology, and its accuracy deteriorates as system time increases, affecting the safety verification of continuous systems.

Method used

An approximate flow tube generation method based on neural networks is adopted. By dividing the running time of the continuous system into multiple periods, a deep neural network is constructed, positive and negative examples are trained, and a mixed integer programming constraint solver is used to optimize the network parameters. Until the extreme value is less than or equal to zero, a high-precision flow tube over-approximation is generated.

Benefits of technology

Compared with the traditional method, the accuracy of the flow tube approximation is improved, especially the high accuracy is maintained within the upper limit of system time, and the performance is similar in a short time, and the accuracy decreases with the system time operation is less than that of the Taylor model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734708A_ABST
    Figure CN118734708A_ABST
Patent Text Reader

Abstract

The invention discloses a flow tube approximate generation method and device based on a neural network, a medium and equipment. The method comprises the following steps: segmenting according to the running time of a continuous system, constructing a deep neural network corresponding to each time period, constructing a positive example sample set and a counter example sample set corresponding to each time period through simulation of the continuous system, and constructing a deep neural network corresponding to each time period; and then training the deep neural network of the time periods by taking the positive example sample set and the counter example sample set as training samples, then constructing mixed integer programming constraint codes corresponding to the time periods based on trained deep neural network model parameters, and converting a reachable problem into a constraint solving problem for solving. And determining whether to further train the deep neural network based on a solving result. Compared with a traditional polyhedron approximation or Taylor model approximation method, the method based on deep neural network approximation is high in precision, and the problem that the precision of the flow pipe is reduced along with time increase in a long time is effectively avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to simulation approximation and safety verification technology of continuous system. Background Art

[0002] The continuous system flow pipe over-approximation generation is to generate a set for a given continuous system, which includes the set of reachable states of system variables within the specified time. This set contains all possible states of the system within the specified time, which is very important for verifying the properties of the continuous system, such as determining whether the system may reach certain specific unsafe states, thereby ensuring the safety of the continuous system. Obviously, a full set containing all states can be a flow pipe over-approximation, but it is of no help for verification and may even produce wrong results. Therefore, how to generate a high-precision flow pipe over-approximation is a key issue. Summary of the invention

[0003] The problem to be solved by the present invention is: how to generate a flow tube over-approximation with higher accuracy in a continuous system and try not to let the accuracy deteriorate as the system time increases.

[0004] To solve the above problems, the solution adopted by the present invention is as follows:

[0005] According to the flow tube approximation generation method based on neural network of the present invention, the method comprises the following steps:

[0006] Step S1: obtaining information of a continuous system to be processed; the information of the continuous system at least includes system quantities, differential equations of the system quantities with respect to time, initial value ranges of the system quantities, and the running time of the continuous system;

[0007] Step S2: dividing the running time of the continuous system into N time periods of equal length according to the running time, and constructing a simulation deep neural network of the continuous system for each of the N time periods;

[0008] Step S3: simulate the continuous system by sampling the system quantity within and outside the initial value range, and construct a positive sample set and a negative sample set for N time periods respectively; the positive sample set and the negative sample set are both sample sets; the samples are sampled values ​​of the system quantity; in the positive sample set, the sampled values ​​of the system quantity are obtained based on the simulated operation of the continuous system after the system quantity is sampled within the initial value range; in the negative sample set, the sampled values ​​of the system quantity are obtained based on the simulated operation of the continuous system after the system quantity is sampled outside the initial value range;

[0009] Step S4: using samples in the positive sample set and the negative sample set of N time periods as training samples of the simulated deep neural network of N time periods, respectively, and inputting them into the corresponding simulated deep neural network for training;

[0010] Step S5: extracting model parameter data of N trained simulated deep neural networks, and constructing mixed integer constraint codes corresponding to N time periods describing the maximum output problem of the simulated deep neural network according to the extracted model parameter data, and then using a mixed integer programming constraint solver to perform constraint solving of the maximum output problem of the simulated deep neural network on the mixed integer constraint codes to obtain corresponding extreme values ​​and extreme value points; if the extreme value is greater than zero, then adding the corresponding extreme value point to the corresponding counterexample sample set, and continuing to further train the simulated deep neural network until the corresponding extreme value is less than or equal to zero;

[0011] The simulated deep neural network includes an input layer, n hidden layers, and an output layer, which is expressed as:

[0012] A out =w out z n +b out ;

[0013] z k =δ(w k z k-1 +b k ),k=1,2,…,n;

[0014] z0=x;

[0015] Among them, A out To simulate the output of a deep neural network;

[0016] w out and b out is the output layer parameter of the simulated deep neural network, w out is a vector, b out is a numerical value;

[0017] w k and b k is the kth hidden layer parameter of the simulated deep neural network, all of which are vectors, where k = 1, 2, …, n;

[0018] z k is the output vector of the kth hidden layer of the simulated deep neural network, where k = 1, 2, ..., n;

[0019] z0 is the output vector of the simulated deep neural network input layer;

[0020] x is a vector composed of system quantities;

[0021] n represents the number of hidden layers contained in the simulated deep neural network;

[0022] δ is the activation function.

[0023] Further, according to the flow tube approximation generation method of the present invention, in step S3, the positive sample sets of N time periods are constructed by the following steps:

[0024] Step S3A1: Obtain an initial vector consisting of the initial values ​​of the system quantity by sampling within the initial value domain

[0025] Step S3A2: According to the formula Calculate the instantaneous value of the system quantity value domain at each time point during the operation time of the continuous system Then, the instantaneous values ​​in the system quantity domain at each time point are added as samples to the positive sample set of the corresponding time period;

[0026] The set of counterexample samples for N time periods is constructed through the following steps:

[0027] Step S3B1: The initial vector consisting of the initial values ​​of the system quantity is obtained by sampling outside the initial value range

[0028] Step S3B2: According to the formula Calculate the instantaneous value of the system quantity outside the domain at each time point during the operation time of the continuous system Then, the instantaneous values ​​in the system quantity domain at each time point are added as samples to the counterexample sample set of the corresponding time period;

[0029] in,

[0030] The time points corresponding to the jth period are (j*MM)*dT, (j*M-M+1)*dT, (j*M-M+2)*dT, …, (j*M)*dT, j=1, 2, 3, …, N;

[0031] and They represent the instantaneous value within the value range and the instantaneous value outside the value range of the system quantity at the time point i*dT respectively;

[0032] Where i = 1, 2, 3, ..., N*M, T is the operating time of the continuous system;

[0033] F is the differential equation of the system quantity with respect to time;

[0034] M is the number of fine divisions of time points within the time period.

[0035] Further, according to the flow tube approximation generation method of the present invention, in step S4, training the simulated deep neural network with samples in the positive sample set and the negative sample set includes the following steps:

[0036] Step S41: input the samples in the positive sample set and the negative sample set into the simulated deep neural network one by one to obtain the output corresponding to each sample;

[0037] Step S42: Calculate the positive example loss function value and the negative example loss function value;

[0038] Step S43: Optimizing the parameters of the simulated deep neural network by taking the sum of the positive example loss function value and the negative example loss function value as the loss function value of the optimizer;

[0039] Step S44: Repeat steps S41 to S44 until the sum of the positive example loss function value and the negative example loss function value is 0;

[0040] The positive example loss function value and the negative example loss function value are calculated using the following formula:

[0041]

[0042] in,

[0043] represents the positive example loss function value of the tth round of training,

[0044] represents the counterexample loss function value of the tth round of training,

[0045] It is represented as the output obtained by inputting the kth sample in the positive sample set into the simulated deep neural network;

[0046] It is represented as the output obtained by inputting the kth sample in the counterexample sample set into the simulated deep neural network;

[0047] NP is the number of samples in the positive sample set;

[0048] NN is the number of samples in the counterexample sample set;

[0049] max and min represent the maximum and minimum values ​​respectively.

[0050] Further, according to the flow tube approximation generation method of the present invention, the steps S3A1 and S3B1 generate the initial vector and , it is refined around the initial value range boundary.

[0051] According to the flow tube approximation generation device based on neural network of the present invention, the device includes the following modules:

[0052] Module M1 is used to: obtain information of the continuous system to be processed; the information of the continuous system at least includes system quantities, differential equations of the system quantities with respect to time, initial value ranges of the system quantities, and the running time of the continuous system;

[0053] Module M2 is used to: divide the running time of the continuous system into N time periods of equal length according to the running time, and construct a simulation deep neural network of the continuous system for each of the N time periods;

[0054] Module M3 is used to: simulate the operation of the continuous system by sampling the system quantity within and outside the initial value range, and construct a positive sample set and a negative sample set for N time periods respectively; the positive sample set and the negative sample set are both sample sets; the samples are sampled values ​​of the system quantity; in the positive sample set, the sampled values ​​of the system quantity are obtained based on the simulated operation of the continuous system after the system quantity is sampled within the initial value range; in the negative sample set, the sampled values ​​of the system quantity are obtained based on the simulated operation of the continuous system after the system quantity is sampled outside the initial value range;

[0055] Module M4 is used to: use the samples in the positive sample set and the negative sample set of N time periods as training samples of the simulated deep neural network of N time periods, respectively, and input them into the corresponding simulated deep neural network for training;

[0056] Module M5 is used to extract model parameter data of N trained simulated deep neural networks, and construct mixed integer constraint codes corresponding to N time periods that describe the maximum output problem of the simulated deep neural network based on the extracted model parameter data, and then use a mixed integer programming constraint solver to perform constraint solving of the maximum output problem of the simulated deep neural network on the mixed integer constraint codes to obtain corresponding extreme values ​​and extreme value points; if the extreme value is greater than zero, then the corresponding extreme value point is added to the corresponding counterexample sample set, and the simulated deep neural network is further trained until the corresponding extreme value is less than or equal to zero;

[0057] The simulated deep neural network includes an input layer, n hidden layers, and an output layer, which is expressed as:

[0058] A out =w out z n +b out ;

[0059] z k =δ(w k z k-1 +b k ),k=1,2,…,n;

[0060] z0=x;

[0061] Among them, A out To simulate the output of the deep neural network, it is greater than 0;

[0062] w out and b out is the output layer parameter of the simulated deep neural network, w out is a vector, b out is a numerical value;

[0063] w k and b k is the kth hidden layer parameter of the simulated deep neural network, all of which are vectors, where k = 1, 2, …, n;

[0064] z k is the output vector of the kth hidden layer of the simulated deep neural network, where k = 1, 2, ..., n;

[0065] z0 is the output vector of the simulated deep neural network input layer;

[0066] x is a vector composed of system quantities;

[0067] n represents the number of hidden layers contained in the simulated deep neural network;

[0068] δ is the activation function.

[0069] Further, according to the flow tube approximation generation device of the present invention, in the module M3, the positive sample sets of N time periods are constructed by the following modules:

[0070] Module M3A1 is used to obtain an initial vector consisting of the initial values ​​of the system quantity by sampling within the initial value range.

[0071] Module M3A2, for: According to the formula Calculate the instantaneous value of the system quantity value domain at each time point during the operation time of the continuous system Then, the instantaneous values ​​in the system quantity domain at each time point are added as samples to the positive sample set of the corresponding time period;

[0072] The set of counterexample samples for N time periods is constructed through the following modules:

[0073] Module M3B1, used to: obtain the initial vector consisting of the initial value of the system quantity by sampling outside the initial value range

[0074] Module M3B2, for: According to the formula Calculate the instantaneous value of the system quantity outside the domain at each time point during the operation time of the continuous system Then, the instantaneous values ​​in the system quantity domain at each time point are added as samples to the counterexample sample set of the corresponding time period;

[0075] in,

[0076] The time points corresponding to the jth period are (j*MM)*dT, (j*M-M+1)*dT, (j*M-M+2)*dT, …, (j*M)*dT, j=1, 2, 3, …, N;

[0077] and They represent the instantaneous value within the value range and the instantaneous value outside the value range of the system quantity at the time point i*dT respectively;

[0078] Where i = 1, 2, 3, ..., N*M, T is the operating time of the continuous system;

[0079] F is the differential equation of the system quantity with respect to time;

[0080] M is the number of fine divisions of time points within the time period.

[0081] Further, according to the flow tube approximation generation device of the present invention, in the module M4, training the simulated deep neural network with samples in the positive sample set and the negative sample set includes the following modules:

[0082] Module M41 is used to: input samples in the positive sample set and the negative sample set into the simulated deep neural network one by one to obtain outputs corresponding to each sample;

[0083] Module M42, used to calculate the positive example loss function value and the negative example loss function value;

[0084] Module M43, used to optimize the parameters of the simulated deep neural network by taking the sum of the positive example loss function value and the negative example loss function value as the loss function value of the optimizer;

[0085] Module M44 is used to: repeatedly execute the functions of module M41 to module M44 until the sum of the positive example loss function value and the negative example loss function value is 0;

[0086] The positive example loss function value and the negative example loss function value are calculated using the following formula:

[0087]

[0088] in,

[0089] represents the positive example loss function value of the tth round of training,

[0090] represents the counterexample loss function value of the tth round of training,

[0091] It is represented as the output obtained by inputting the kth sample in the positive sample set into the simulated deep neural network;

[0092] It is represented as the output obtained by inputting the kth sample in the counterexample sample set into the simulated deep neural network;

[0093] NP is the number of samples in the positive sample set;

[0094] NN is the number of samples in the counterexample sample set;

[0095] max and min represent the maximum and minimum values ​​respectively.

[0096] Further, according to the flow tube approximation generation device of the present invention, the modules M3A1 and M3B1 generate the initial vector and , it is refined around the initial value range boundary.

[0097] According to a medium of the present invention, a program instruction set that can be read by a machine is stored in the medium. When the program instruction set stored in the medium is read and executed by a machine, the machine can implement the above-mentioned flow pipe approximation generation method.

[0098] According to a device of the present invention, the device includes a connected processor and a memory; the memory stores a program instruction set; when the program instruction set stored in the memory is read and executed by the processor, the device can implement the above-mentioned flow pipe approximation generation method.

[0099] The technical effects of the present invention are as follows:

[0100] 1. Compared with the traditional polyhedron approximation method, the accuracy is higher within the entire system time limit.

[0101] 2. Compared with the traditional Taylor model approximation method, the accuracy is similar in a short period of time, but as the system runs over time, the degree of decrease in the accuracy of the flow tube approximation is much less than that of the Taylor model.

[0102] 3. The present invention can generate flow tube over-approximation for any two-dimensional continuous system as universally as possible, and can effectively control the accuracy of flow tube over-approximation by adjusting the interval between data sets. BRIEF DESCRIPTION OF THE DRAWINGS

[0103] Figure 1 It is a flow chart of a method for approximating generation of flow tubes of a continuous flow system according to an embodiment of the present invention.

[0104] Figure 2 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0105] The present invention is further described in detail below with reference to the accompanying drawings.

[0106] Figure 2 An electronic device is exemplified, which is a general-purpose computer device of the von Neumann structure, and at least includes a connected processor 201 and a memory 202. The memory 201 is used to store a computer program instruction set and data. The memory 201 is the machine-readable medium referred to in the present invention, which is usually a sustainable storage device, including but not limited to disks, tapes, solid-state hard disks, etc. The processor 202 implements its corresponding functions by loading and executing the computer program instruction set stored in the memory 201. Specifically in this embodiment, the electronic device implements the flow pipe approximation generation method referred to in the present invention by executing the computer program instruction set stored in the memory 201 by the processor 202.

[0107] Reference Figure 1 , the flow tube approximation generation method of the present invention includes a time-divided neural network construction step, a training sample simulation generation step, a time-divided neural network training step, a constraint encoding and constraint solving step. The aforementioned step S1 obtains the information of the continuous system to be processed, indicating that the input of the present invention is the information of the continuous system. The output of the present invention is a deep neural network that approximates the flow tube of the input continuous system. The information of the continuous system includes system quantities, differential equations of the system quantities with respect to time, the initial value range of the system quantities, and the running time of the continuous system. Among them, there are usually multiple system quantities of the continuous system, and multiple system quantities constitute a system quantity set. The deep neural network output by the present invention is a series of time-divided deep neural networks, and each deep neural network represents the flow tube approximation within a certain time period of the continuous system.

[0108] For example, in a continuous system, the system quantities are a and b, and the differential equations of the system quantities with respect to time are ta=b and tb=0.2*(1-a*a)*ba; the initial value range is {0.8≤a≤1,0.4≤b≤0.6}, and the running time is 10s. Among them, ta represents the differential of the system quantity a with respect to time, and tb represents the differential of the system quantity b with respect to time.

[0109] The step of constructing a neural network by time period is the aforementioned step S2, which divides the running time of the continuous system into N time periods of equal duration according to the running time, and constructs a simulated deep neural network of the continuous system for each of the N time periods. For example, the running time of the continuous system in the aforementioned example is 10s, and it can be divided into 20 time periods with a duration of 0.5 seconds per time period, and then 20 corresponding simulated deep neural networks are constructed, each of which corresponds to a time period. In this embodiment, N is determined according to the duration of each time period and the running time of the continuous system. Specifically, N=T / ST, where T is the running time of the continuous system, and ST is the duration of each time period set in the preview, and ST is usually set to 0.5s, 1s, 2s, etc. The simulated deep neural network consists of an input layer, several hidden layers, and an output layer, which can be specifically expressed as:

[0110] A out =w out z n +b out ;

[0111] z k =δ(w k z k-1 +b k ),k=1,2,…,n;

[0112] z0=x;

[0113] Among them, A out To simulate the output of a deep neural network;

[0114] w out and b out is the output layer parameter of the simulated deep neural network, w out is a vector, b out is a numerical value;

[0115] w k and b k is the kth hidden layer parameter of the simulated deep neural network, all of which are vectors, where k = 1, 2, …, n;

[0116] z k is the output vector of the kth hidden layer of the simulated deep neural network, where k = 1, 2, ..., n;

[0117] n represents the number of hidden layers contained in the simulated deep neural network;

[0118] z0 is the output vector of the simulated deep neural network input layer;

[0119] x is a vector composed of system quantities;

[0120] δ is the activation function.

[0121] The activation function δ usually uses the ReLU activation function.

[0122] In the initially constructed deep neural network, the hidden layer parameter w k and b k and the output layer parameters w out and b out Usually determined randomly.

[0123] The training sample simulation generation step is the aforementioned step S3, which simulates the operation of the continuous system by sampling the system quantity inside and outside the initial value range, and constructs a positive sample set and a negative sample set for N time periods. N time periods correspond to N simulated deep neural networks, that is, each simulated deep neural network corresponds to a positive sample set and a negative sample set. Both the positive sample set and the negative sample set are sample sets. The sample is the sampled value of the system quantity. In the positive sample set, the sampling value of the system quantity is based on the simulated operation of the continuous system after the system quantity is sampled within the initial value range. In the negative sample set, the sampling value of the system quantity is based on the simulated operation of the continuous system after the system quantity is sampled outside the initial value range. Specifically, in this step, the positive sample set of N time periods is constructed by the following steps:

[0124] Step S3A1: Obtain an initial vector consisting of the initial values ​​of the system quantity by sampling within the initial value domain

[0125] Step S3A2: According to the formula Calculate the instantaneous value of the system quantity value domain at each time point during the operation time of the continuous system Then, the instantaneous values ​​within the system quantity value domain at each time point are added as samples to the positive sample set of the corresponding time period.

[0126] The set of counterexample samples for N time periods is constructed through the following steps:

[0127] Step S3B1: The initial vector consisting of the initial values ​​of the system quantity is obtained by sampling outside the initial value range

[0128] Step S3B2: According to the formula Calculate the instantaneous value of the system quantity outside the domain at each time point during the operation time of the continuous system Then, the instantaneous values ​​within the system quantity value domain at each time point are added as samples to the counterexample sample set of the corresponding time period.

[0129] In the above steps, and Respectively represent the instantaneous value within the value range and the instantaneous value outside the value range of the system quantity at the time point i*dT; i=1,2,3,…,N*M, T is the running time of the continuous system; F is the differential equation of the system quantity with respect to time; M is the number of fine divisions of time points within the time period. are all vectors composed of the values ​​of system quantities. The time points corresponding to the jth period are (j*MM)*dT, (j*M-M+1)*dT, (j*M-M+2)*dT, …, (j*M)*dT, j=1, 2, 3, …, N, that is, the positive sample set and the negative sample set of each period include the system quantity values ​​at M+1 time points. In step S3A1 and step S3B1, the vector and vector There are multiple, multiple vectors and vector Composition vector Collections and vectors of The set of vectors and Therefore, the number of samples in the positive sample set and the negative sample set is (M+1)*K + The sum of (M+1)*K - Among them, K + is the initial vector generated in step S3A1 The number of K - is the initial vector generated in step S3B1 The number of .

[0130] The number of fine divisions M of time points in a time period is usually determined by the fine division duration of the time point, that is, M=ST / MT. Among them, ST is the duration of the time period, and MT is the fine division duration. For example, ST=0.5s, MT=25ms, then M=20.

[0131] Steps S3A1 and S3B1 generate the initial vector by sampling and When , random sampling or grid point sampling can be used. This embodiment preferably adopts the grid point sampling method. For example, in the continuous system of the above example, the initial value range of the system quantities a and b is defined as {0.8≤a≤1,0.4≤b≤0.6}. The system quantities a and b are divided into grids with equal intervals of 0.1, thereby obtaining grid lines 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2 for the system quantity a, and grid lines 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8 for the system quantity b. After the grid lines of the system quantities a and b are combined in pairs, the following initial vectors in the value range can be sampled

[0132] {0.8,0.4},{0.8,0.5},{0.8,0.6},{0.9,0.4},{0.9,0.5},{0.9,0.6},{1.0,0.4},{1.0,0.5},{1.0,0.6};

[0133] Out-of-range initial vector

[0134] {0.6,0.2},{0.6,0.3},{0.6,0.4},{0.6,0.5},{0.6,0.6},{0.6,0.7},{0.6,0.8},

[0135] {0.7,0.2},{0.7,0.3},{0.7,0.4},{0.7,0.5},{0.7,0.6},{0.7,0.7},{0.7,0.8},

[0136] {1.1,0.2},{1.1,0.3},{1.1,0.4},{1.1,0.5},{1.1,0.6},{1.1,0.7},{1.1,0.8},

[0137] {1.2,0.2},{1.2,0.3},{1.2,0.4},{1.2,0.5},{1.2,0.6},{1.2,0.7},{1.2,0.8},

[0138] {0.8,0.2},{0.9,0.2},{1.0,0.2},{0.8,0.3},{0.9,0.3},{1.0,0.3},

[0139] {0.8,0.7},{0.9,0.7},{1.0,0.7},{0.8,0.3},{0.9,0.3},{1.0,0.3}.

[0140] Furthermore, in order to enable the deep neural network to more accurately approximate the continuous system, steps S3A1 and S3B1 generate the initial vector by sampling and When the grid points are used in this embodiment, the closer to the boundary of the initial value range, the denser the grid points are. For example, in the continuous system of the above example, the grid lines of system quantity a are divided into: 0.6, 0.7, 0.76, 0.79, 0.8, 0.81, 0.83, 0.9, 0.97, 0.99, 1.0, 1.01, 1.04, 1.1, 1.2; the grid lines of system quantity b are divided into: 0.2, 0.3, 0.36, 0.39, 0.4, 0.41, 0.43, 0.5, 0.57, 0.59, 0.6, 0.61, 0.64, 0.7, 0.8. The grid points formed by the combination of the grid lines of system quantities a and b are denser and more precisely divided near the boundary of the initial value range.

[0141] The time-divided neural network training step is the aforementioned step S4, where the samples in the positive sample set and the negative sample set of N time periods are respectively used as training samples of the simulated deep neural network of N time periods and input into the corresponding simulated deep neural network for training. Training the simulated deep neural network with the samples in the positive sample set and the negative sample set specifically includes the following steps:

[0142] Step S41: input the samples in the positive sample set and the negative sample set into the simulated deep neural network one by one to obtain the output corresponding to each sample;

[0143] Step S42: Calculate the positive example loss function value and the negative example loss function value;

[0144] Step S43: Optimizing the parameters of the simulated deep neural network by taking the sum of the positive example loss function value and the negative example loss function value as the loss function value of the optimizer;

[0145] Step S44: Repeat steps S41 to S44 until the sum of the positive example loss function value and the negative example loss function value is 0.

[0146] The positive example loss function value and the negative example loss function value are calculated using the following formula:

[0147]

[0148] in,

[0149] represents the positive example loss function value of the tth round of training,

[0150] represents the counterexample loss function value of the tth round of training,

[0151] It is represented as the output obtained by inputting the kth sample in the positive sample set into the simulated deep neural network;

[0152] It is represented as the output obtained by inputting the kth sample in the counterexample sample set into the simulated deep neural network;

[0153] NP is the number of samples in the positive sample set;

[0154] NN is the number of samples in the counterexample sample set;

[0155] max and min represent the maximum and minimum values ​​respectively.

[0156] The constraint coding and constraint solving step is the aforementioned step S5, which extracts the model parameter data of N trained simulated deep neural networks, and constructs the mixed integer constraint coding corresponding to N time periods that describes the maximum output problem of the simulated deep neural network based on the extracted model parameter data, and then uses the mixed integer programming constraint solver to perform constraint solving of the maximum output problem of the simulated deep neural network on the mixed integer constraint coding to obtain the corresponding extreme value and extreme value point; if the extreme value is greater than zero, the corresponding extreme value point is added to the corresponding counterexample sample set, and the simulated deep neural network is further trained until the corresponding extreme value is less than or equal to zero.

[0157] In the above steps, the mixed integer constraint encoding is specifically as follows:

[0158]

[0159] In the above mixed integer constraint encoding,

[0160] I represents the initial value range; x out represents the output of the simulated deep neural network;

[0161] j represents the simulated deep neural network corresponding to the jth period, and j takes values ​​from 1 to N;

[0162] w out and b out To simulate the output layer parameters of the deep neural network;

[0163] w k and b k To simulate the kth hidden layer parameters of the deep neural network;

[0164] n represents the number of hidden layers contained in the simulated deep neural network;

[0165] z k Output vector of the kth hidden layer of the simulated deep neural network;

[0166] x0 is the input of the simulated deep neural network, which is a vector composed of system quantities;

[0167] δ is the activation function, which uses the ReLU activation function;

[0168] M is the number of fine divisions of time points within the time period;

[0169] F is the differential equation of the system quantity with respect to time;

[0170] maximize represents the mixed integer constraint encoding describing the maximum output problem of simulating deep neural networks.

[0171] In the above steps, the extreme value is the extreme value of the simulated deep neural network output, that is, in the above mixed integer constraint encoding, x out The extreme value of the system quantity; the extreme value point is the value of the system quantity, which is a vector composed of the system quantity.

[0172] It should be pointed out that in the above steps, step S4 trains the simulated deep neural network of N time periods respectively, and step S5 performs constraint coding solution on the simulated deep neural network of N time periods respectively. Those skilled in the art understand that in a preferred embodiment, the training and constraint coding solution of the simulated deep neural network can also be performed one by one, that is, the simulated deep neural network of N time periods is traversed, the traversed simulated deep neural network is trained, and then the constraint coding solution is performed. If the extreme value obtained by the solution is greater than zero, the corresponding extreme value point is added to the corresponding counter-example sample set, and the simulated deep neural network is further trained until the corresponding extreme value is less than or equal to zero, and then the next simulated deep neural network is traversed to repeat the above training and constraint coding solution process.

[0173] In addition, the aforementioned device for approximating generation of flow tubes based on neural networks is a virtual device corresponding to the aforementioned method for approximating generation of flow tubes based on neural networks, and the modules it contains correspond one-to-one to the steps in the method, which will not be described in detail.

Claims

1. A flow tube approximation generation method based on a neural network, characterized in that: The method comprises the following steps: Step S1: obtaining information of a continuous system to be processed; the information of the continuous system at least includes system quantities, differential equations of the system quantities with respect to time, initial value ranges of the system quantities, and the running time of the continuous system; Step S2: dividing the running time of the continuous system into N time periods of equal length according to the running time, and constructing a simulation deep neural network of the continuous system for each of the N time periods; Step S3: simulate the continuous system by sampling the system quantity within and outside the initial value range, and construct a positive sample set and a negative sample set for N time periods respectively; the positive sample set and the negative sample set are both sample sets; the samples are sampled values ​​of the system quantity; in the positive sample set, the sampled values ​​of the system quantity are obtained based on the simulated operation of the continuous system after the system quantity is sampled within the initial value range; in the negative sample set, the sampled values ​​of the system quantity are obtained based on the simulated operation of the continuous system after the system quantity is sampled outside the initial value range; Step S4: using samples in the positive sample set and the negative sample set of N time periods as training samples of the simulated deep neural network of N time periods, respectively, and inputting them into the corresponding simulated deep neural network for training; Step S5: extracting N trained model parameter data of simulated deep neural networks, and constructing mixed integer constraint codes corresponding to N time periods describing the maximum output problem of the simulated deep neural network according to the extracted model parameter data, and then using a mixed integer programming constraint solver to perform constraint solving of the maximum output problem of the simulated deep neural network on the mixed integer constraint codes to obtain corresponding extreme values ​​and extreme value points; If the extreme value is greater than zero, the corresponding extreme value point is added to the corresponding counterexample sample set, and the simulated deep neural network is further trained until the corresponding extreme value is less than or equal to zero; The simulated deep neural network includes an input layer, n hidden layers, and an output layer, which is expressed as: A out =w out z n +b out ; With k =δ(in k With k-1 +b k ),k=1,2,…,n; z0=x; Among them, A out To simulate the output of a deep neural network; w out and b out is the output layer parameter of the simulated deep neural network, w out is a vector, b out is a numerical value; w k and b k is the kth hidden layer parameter of the simulated deep neural network, all of which are vectors, where k = 1, 2, …, n; z k is the output vector of the kth hidden layer of the simulated deep neural network, where k = 1, 2, ..., n; z0 is the output vector of the simulated deep neural network input layer; x is a vector composed of system quantities; n represents the number of hidden layers contained in the simulated deep neural network; δ is the activation function.

2. The flow tube approximation generation method according to claim 1, characterized in that: In step S3, the positive sample sets of N time periods are constructed by the following steps: Step S3A1: Obtain an initial vector consisting of the initial values ​​of the system quantity by sampling within the initial value domain Step S3A2: According to the formula Calculate the instantaneous value of the system quantity value domain at each time point during the operation time of the continuous system Then, the instantaneous values ​​in the system quantity domain at each time point are added as samples to the positive sample set of the corresponding time period; The set of counterexample samples for N time periods is constructed by the following steps: Step S3B1: The initial vector consisting of the initial values ​​of the system quantity is obtained by sampling outside the initial value range Step S3B2: According to the formula Calculate the instantaneous value of the system quantity outside the domain at each time point during the operation time of the continuous system Then, the instantaneous values ​​in the system quantity domain at each time point are added as samples to the counterexample sample set of the corresponding time period; in, The time points corresponding to the jth period are (j*MM)*dT, (j*M-M+1)*dT, (j*M-M+2)*dT, …, (k*M)*dT, j=1, 2, 3, …, N; and They represent the instantaneous value within the value range and the instantaneous value outside the value range of the system quantity at the time point i*dT respectively; Where i = 1, 2, 3, ..., N*M, T is the operating time of the continuous system; F is the differential equation of the system quantity with respect to time; M is the number of fine divisions of time points within the time period.

3. The flow tube approximation generation method according to claim 1, characterized in that: In step S4, training the simulated deep neural network with samples in the positive sample set and the negative sample set includes the following steps: Step S41: input the samples in the positive sample set and the negative sample set into the simulated deep neural network one by one to obtain the output corresponding to each sample; Step S42: Calculate the positive example loss function value and the negative example loss function value; Step S43: Optimizing the parameters of the simulated deep neural network by taking the sum of the positive example loss function value and the negative example loss function value as the loss function value of the optimizer; Step S44: Repeat steps S41 to S44 until the sum of the positive example loss function value and the negative example loss function value is 0; The positive example loss function value and the negative example loss function value are calculated using the following formula: in, represents the positive example loss function value of the tth round of training, represents the counterexample loss function value of the tth round of training, It is represented as the output obtained by inputting the kth sample in the positive sample set into the simulated deep neural network; It is represented as the output obtained by inputting the kth sample in the counterexample sample set into the simulated deep neural network; NP is the number of samples in the positive sample set; NN is the number of samples in the counterexample sample set; max and min represent the maximum and minimum values ​​respectively.

4. The flow tube approximation generation method according to claim 2, characterized in that: The steps S3A1 and S3B1 generate an initial vector and , it is refined around the initial value range boundary.

5. A flow tube approximation generation device based on a neural network, characterized in that: The device includes the following modules: Module M1 is used to: obtain information of the continuous system to be processed; the information of the continuous system at least includes system quantities, differential equations of the system quantities with respect to time, initial value ranges of the system quantities, and the running time of the continuous system; Module M2 is used to: divide the running time of the continuous system into N time periods of equal length according to the running time, and construct a simulation deep neural network of the continuous system for each of the N time periods; Module M3 is used to simulate the operation of the continuous system by sampling the system quantity within and outside the initial value range, and construct a positive sample set and a negative sample set for N time periods respectively; the positive sample set and the negative sample set are both sample sets; the samples are sampling values ​​of the system quantity; in the positive sample set, the sampling values ​​of the system quantity are obtained based on the simulated operation of the continuous system after the system quantity is sampled within the initial value range; in the negative sample set, the sampling values ​​of the system quantity are obtained based on the simulated operation of the continuous system after the system quantity is sampled outside the initial value range; module M4 is used to use the samples in the positive sample set and the negative sample set of N time periods as training samples of the simulated deep neural network of N time periods, respectively, and input them into the corresponding simulated deep neural network for training; Module M5 is used to extract model parameter data of N trained simulated deep neural networks, and construct mixed integer constraint codes corresponding to N time periods describing the maximum output problem of the simulated deep neural network according to the extracted model parameter data, and then perform constraint solving of the maximum output problem of the simulated deep neural network on the mixed integer constraint codes through a mixed integer programming constraint solver to obtain corresponding extreme values ​​and extreme value points; If the extreme value is greater than zero, the corresponding extreme value point is added to the corresponding counterexample sample set, and the simulated deep neural network is further trained until the corresponding extreme value is less than or equal to zero; The simulated deep neural network includes an input layer, n hidden layers, and an output layer, which is expressed as: A out =w out z n +b out ; With k =δ(in k With k-1 +b k ),k=1,2,…,n; z0=x; Among them, A out To simulate the output of a deep neural network; w out and b out is the output layer parameter of the simulated deep neural network, w out is a vector, b out is a numerical value; w k and b k is the kth hidden layer parameter of the simulated deep neural network, all of which are vectors, where k = 1, 2, …, n; z k is the output vector of the kth hidden layer of the simulated deep neural network, where k = 1, 2, ..., n; z0 is the output vector of the simulated deep neural network input layer; x is a vector composed of system quantities; n represents the number of hidden layers contained in the simulated deep neural network; δ is the activation function.

6. The flow tube approximation generation device according to claim 5, characterized in that: In the module M3, the positive sample sets of N time periods are constructed by the following modules: Module M3A1 is used to obtain an initial vector consisting of the initial values ​​of the system quantity by sampling within the initial value range. Module M3A2, for: According to the formula Calculate the instantaneous value of the system quantity value domain at each time point during the operation time of the continuous system Then, the instantaneous values ​​in the system quantity domain at each time point are added as samples to the positive sample set of the corresponding time period; The set of counterexample samples for N time periods is constructed through the following modules: Module M3B1, used to: obtain the initial vector consisting of the initial value of the system quantity by sampling outside the initial value range Module M3B2, for: According to the formula Calculate the instantaneous value of the system quantity outside the domain at each time point during the operation time of the continuous system Then, the instantaneous values ​​in the system quantity domain at each time point are added as samples to the counterexample sample set of the corresponding time period; in, The time points corresponding to the jth period are (j*MM)*dT, (j*M-M+1)*dT, (j*M-M+2)*dT, …, (j*M)*dT, j=1, 2, 3, …, N; and They represent the instantaneous value within the value range and the instantaneous value outside the value range of the system quantity at the time point i*dT respectively; Where i = 1, 2, 3, ..., N*M, T is the operating time of the continuous system; F is the differential equation of the system quantity with respect to time; M is the number of fine divisions of time points within the time period.

7. The flow tube approximation generation device according to claim 5, characterized in that: In the module M4, training the simulated deep neural network with samples in the positive sample set and the negative sample set includes the following modules: Module M41 is used to: input samples in the positive sample set and the negative sample set into the simulated deep neural network one by one to obtain outputs corresponding to each sample; Module M42, used to calculate the positive example loss function value and the negative example loss function value; Module M43, used to optimize the parameters of the simulated deep neural network by taking the sum of the positive example loss function value and the negative example loss function value as the loss function value of the optimizer; Module M44 is used to: repeatedly execute the functions of module M41 to module M44 until the sum of the positive example loss function value and the negative example loss function value is 0; the positive example loss function value and the negative example loss function value are calculated using the following formula: in, represents the positive example loss function value of the tth round of training, represents the counterexample loss function value of the tth round of training, It is represented as the output obtained by inputting the kth sample in the positive sample set into the simulated deep neural network; It is represented as the output obtained by inputting the kth sample in the counterexample sample set into the simulated deep neural network; NP is the number of samples in the positive sample set; NN is the number of samples in the counterexample sample set; max and min represent the maximum and minimum values ​​respectively.

8. The flow tube approximation generation device according to claim 6, characterized in that: The modules M3A1 and M3B1 generate the initial vector and , it is refined around the initial value range boundary.

9. A medium storing a program instruction set that can be read by a machine, characterized in that: When the program instruction set stored in the medium is read and executed by a machine, the machine can implement the flow tube approximation generation method according to any one of claims 1 to 4.

10. A device, characterized in that: The device comprises a connected processor and a memory; the memory stores a program instruction set; when the program instruction set stored in the memory is read and executed by the processor, the device can implement the flow tube approximation generation method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Train operation overspeed protection hybrid monitor method

    CN107963093A

  • Flow field representation method and system based on high-order network, and medium

    CN114547956A

  • Unmanned ship optimal path planning method based on reachable set

    CN114839966A

  • Flow field time history deep learning prediction method considering flow control equation constraint

    CN116127844A

  • Computer-Assisted Design Method for Mechatronic Systems

    US20220391563A1