A two-stage training deep convex neural network optimization method and system
Through the two-stage training method and security filtering algorithm, the interpretability and security problems of deep convex neural network in model prediction control are solved, the generalization ability and adaptability of the model are improved, and the model performance is significantly improved.
Patent Information
- Application Number
- CN202410710223.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-06-03
AI Technical Summary
The existing deep convex neural network lacks interpretability in model prediction control, the data distribution is unbalanced during the data set collection process, the training effect is poor, the output security guarantee is insufficient, and it is difficult to evaluate data quality and enhance it.
A two-stage training method is adopted, including expanded data collection, mobile data augmentation and F_shap theory-assisted screening, combined with a security filtering algorithm for output correction, and the deep convex neural network is updated through online data fine-tuning.
The interpretability, generalization ability and output security of the model are improved, the stability and adaptability of the model in practical applications are ensured, and the continuous improvement of model performance is achieved.
Smart Images

Figure CN118485129B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of neural network optimization, and in particular to a two-stage training deep convex neural network optimization method and system. Background Art
[0002] With the development of modern control field, the rapid solution of optimization control problems has become one of the focuses of algorithm research. Neural networks have the advantage of fast output. The present invention refers to the model predictive control algorithm widely used in the modern control field through deep convex neural networks. It is hoped that the trained neural network can better learn the control strategy of model predictive control and achieve the purpose of replacing it. Deep convex neural networks have good interpretability and expression ability by fitting the control object into a convex model and embedding the gradient optimization algorithm into the neural network training. The present invention proposes a solution framework of a fast optimization algorithm through two-stage training and F_shap assisted data screening through deep convex neural networks. The framework mainly includes two major training stages of an expanded offline data collection method and a swimming offline data enhancement method, as well as an online safety adjustment of the output of the offline trained neural network and a F_shap assisted data screening data set fusion process. In the offline stage, samples with certain generalization performance are better collected through data collection and data enhancement technology; and in the online stage, the real-time deep convex network controller output is predicted, and the safety evaluation and correction are performed through the safety filtering algorithm to ensure the real-time safety of the algorithm output. Finally, F_shap theoretical calculation is used to better assist the data selection in the offline and online processes.
[0003] A similar solution: High-gain DC converter based on neural network fitting explicit MPC from CNKI:
[0004] Firstly, the explicit MPC algorithm is used to optimize the control effect of the high-gain DC converter, generate the regional distribution of the MPC control law, and then perform neural network training and sample collection. The neural network stage includes two processes: neural network design and training.
[0005] Neural network principle:
[0006] The neural network algorithm uses the gradient descent method to adjust the connection weights and biases of the hidden layer and the output layer to obtain the minimum error E. During training, the error will be back-propagated after the forward calculation of the neural network and used as the input of the modified weight. The modified weight can be expressed as:
[0007]
[0008] θ is the connection weight between the hidden layer and the output layer; λ is the learning rate of the neural network.
[0009] The entire learning process is to correct the weights of each layer while the error is back-propagated, and the modification of weights follows the chain rule.
[0010] Neural Network Design:
[0011] This paper designs a single hidden layer network to fit the nonlinear input-output relationship of training data. The signal transmission process of the neural network is described as follows.
[0012] Input layer: The input is [i Lm (j),V0(j),i0(j),V ref j)], so the input layer has 4 neurons. In order to avoid the scale difference of different inputs, the input needs to be normalized to x before being transmitted to the hidden layer. m(j) (m=1,2,3,4), its interval range is (-1,1), expressed as
[0013]
[0014] Where: x is the actual value in the one-dimensional input; X max , X min are the maximum and minimum values in the one-dimensional input respectively.
[0015] Hidden layer: The neurons in the hidden layer first perform a weighted sum operation on the input and then use the activation function. The nonlinear function h of the hidden layer is obtained. n (n=1, 2, ..., N).
[0016]
[0017] Where: w mn represents the weight between the mth neuron in the input layer and the nth neuron in the hidden layer; b n Represents the bias of the nth neuron in the hidden layer: N represents the number of neurons in the hidden layer, and its value is related to the fitting accuracy of the neurons.
[0018] This paper selects the hidden layer activation function σ as the ReLU function.
[0019]
[0020] Offline training of neural networks;
[0021] When training a neural network, the 4-dimensional input of the training data [i Lm (j),V o (j),i o (j),V ref (j)] is normalized and sent to the neural network to calculate the duty cycle in the forward direction, and then compared with the label to obtain the error function. This paper defines the error function as E off=[D opt (j+1|j)-D NN (j+1|j)] 2 Where D NN (j+1|j) is the output value of the neural network.
[0022] When calculating the error function, the weights and biases of the neural network are automatically adjusted through the gradient descent method. This process is the offline training of the neural network. When the calculated value of the error function is less than the set value, the neural network has well fitted the input-output relationship of the training data.
[0023] Through the above analysis, the problems and defects of the prior art are as follows:
[0024] (1) Most deep convex neural network approximations of MPC are basically performed through general network architectures and are not interpretable.
[0025] (2) During the control task data set collection process, different data have different probabilities of occurrence. The probability of data sets around the convergence area is high, while the probability of data sets in other areas is low. A suitable control task requires an appropriate proportion of high-probability data and low-probability data. Most of the existing data collection methods directly collect data without corresponding design for control tasks, which results in poor results of trained neural networks and poor generalization.
[0026] (3) The neural network does not have any output security guarantees during use, which can easily lead to the output of the neural network being difficult to solve under certain working conditions and its output leading to unsafe conditions.
[0027] (4) The contribution of the dataset to the neural network is unclear, making it difficult to evaluate the quality of the dataset and collect corresponding data to enhance the neural network in specific situations. Summary of the invention
[0028] In view of the problems existing in the prior art, the present invention provides a deep convex neural network optimization method with two-stage training.
[0029] The present invention is implemented as follows: a two-stage training deep convex neural network optimization method comprises:
[0030] Step 1: Collect sample data with a certain quality within a certain period of time through an expansion data collection method;
[0031] Step 2: Enhance offline data through the swimming data enhancement method, and then filter offline data with the help of F_shap theory;
[0032] Step 3: Use offline data to optimize the deep convex neural network;
[0033] Step 4: Perform security correction on the output of the trained neural network through a security filtering algorithm, and collect the security-corrected data set through online data collection;
[0034] Step 5: Use the F_shap theory to assist in filtering online data, and mix the filtered data with the offline data set to fine-tune and update the deep convex neural network.
[0035] Another object of the present invention is to provide a two-stage training deep convex neural network optimization system comprising:
[0036] A data collection module is used to collect sample data with a certain quality within a certain period of time through an expansion data collection method;
[0037] The enhancement module is used to enhance offline data through the mobile data enhancement method, and then filter offline data with the assistance of F_shap theory;
[0038] An optimization module for optimizing deep convex neural networks using offline data;
[0039] A correction module is used to perform security correction on the output of the trained neural network through a security filtering algorithm, and collect the security-corrected data set through online data collection;
[0040] The screening module is used to screen online data with the assistance of F_shap theory, and mix the screened data with the offline data set to fine-tune and update the deep convex neural network.
[0041] Another object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the two-stage training deep convex neural network optimization method.
[0042] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to perform the steps of the two-stage training deep convex neural network optimization method.
[0043] Another object of the present invention is to provide an information data processing terminal, which is used to implement the deep convex neural network optimization system with two-stage training.
[0044] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:
[0045] First, the present invention adopts a deep convex neural network to approximate MPC. Compared with other neural networks, its input has a certain convexity relative to the fitting function, thereby ensuring the rapidity and interpretability of the solution process. The present invention proposes a two-stage training and F_shap auxiliary data screening process to train the neural network. In the offline stage, the system proposes an expanded data set collection method and a swimming data set enhancement method, which can effectively collect data with different probabilities in different control tasks. Adding a safety filtering component during the use of the online stage can greatly ensure the output security of the trained neural network, and at the same time collect data in the online stage and fine-tune the neural network to make it have better self-evolution. At the same time, a calculation method of FF_shap is proposed, so that the data set can be correspondingly assisted and screened according to the algorithm performance and F_shap value analysis.
[0046] Second, the embodiment of the present invention provides a two-stage training deep convex neural network optimization method, which first uses an expansion data collection method to ensure that high-quality sample data is collected in a short time. This step lays a solid data foundation for subsequent neural network training.
[0047] In the data preparation stage, the present invention adopts the mobile data enhancement technology to effectively enhance the offline data, thereby improving the diversity and complexity of the data set. At the same time, with the help of F_shap theory, the offline data is accurately screened to remove redundant and noisy data, further improving the data quality.
[0048] Next, the present invention uses the enhanced and screened offline data to optimize the training of the deep convex neural network. By adjusting the network parameters and structure, it can better fit the data characteristics and improve the prediction performance and generalization ability of the model.
[0049] Finally, in the model application stage, the present invention uses a security filtering algorithm to perform security correction on the output of the trained neural network to ensure the stability and reliability of the model in practical applications. At the same time, through online data collection technology, new security correction data sets are continuously collected, and F_shap theory is used to assist in screening. After mixing with offline data sets, the deep convex neural network is fine-tuned and updated, so that the model can continue to learn and optimize to adapt to the ever-changing data environment.
[0050] The present invention not only solves the deficiencies of the prior art in data collection, screening and neural network optimization, but also achieves significant improvement and continuous progress in model performance through the combination of two-stage training and online learning, bringing new breakthroughs to the development of the field of deep learning.
[0051] Third, the expected benefits and commercial value of the technical solution of the present invention after transformation are as follows: for the control processes in existing practical applications, such as sewage treatment and decision-making control in autonomous driving, the present invention can improve the solution time of the control decision-making process based on the accumulation of data in the control process through deep learning technology, so as to achieve a fast and safe control decision-making process.
[0052] The technical solution of the present invention fills the technical gap in the industry at home and abroad: the technical solution of the present invention provides a systematic solution for accelerating the solution of model predictive control using deep learning technology, including the architecture of neural network, the collection of offline data sets, the deployment of neural network and security constraint guarantee, and the process of continuous learning based on the data in the deployment process. Among them, the subsequent expansion data collection method, the swimming data enhancement method, and the data screening based on F_shap theory through F_shap calculation are all proposed for the first time in the present invention.
[0053] Fourth, the technical problems of the prior art and the significant technical progress achieved by the present invention are mainly reflected in the following four aspects:
[0054] First, the present invention solves the problem of data collection and processing in deep learning. In the prior art, data collection often lacks systematicity and pertinence, resulting in uneven data quality and affecting the training effect of the model. The present invention adopts an expansive data collection method, which can ensure that sufficient and high-quality sample data is collected within a specific time frame, providing a solid foundation for subsequent model training.
[0055] Secondly, the present invention effectively improves the generalization ability of the model through the swimming data enhancement method and F_shap theory screening. Data enhancement technology can generate more diverse training samples, while F_shap theory can accurately evaluate the importance of each sample to model training, thereby screening out the samples that have the greatest impact on model performance. This combined method enables the model to better learn the inherent laws of the data during the training process, thereby improving the generalization ability of the model.
[0056] Third, the present invention introduces a security filtering algorithm to perform security correction on the output of the model. After the model is deployed, due to the complexity of the actual environment, the output of the model may have security risks. The present invention uses a security filtering algorithm to monitor and correct the output of the model in real time, ensuring that the output of the model meets specific security standards, reducing the risk of the model in practical applications.
[0057] Finally, the present invention fine-tunes and updates the model by mixing online data and offline data, which significantly improves the adaptability and robustness of the model. Online data can reflect the performance of the model in real time, while offline data has stability and reliability. The present invention combines these two types of data to fine-tune and update the model, so that the model can continuously adapt to new environments and data changes, improving the adaptability and robustness of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is a flow chart of a deep convex neural network optimization method for two-stage training provided in an embodiment of the present invention.
[0059] Figure 2 It is a structural block diagram of a deep convex neural network optimization system for two-stage training provided in an embodiment of the present invention.
[0060] Figure 3 It is a detailed flow chart of the deep convex neural network optimization method for two-stage training provided in an embodiment of the present invention.
[0061] Figure 4 It is a diagram of online data collection provided by an embodiment of the present invention.
[0062] Figure 5 It is an experimental effect diagram of the MPC algorithm provided by an embodiment of the present invention when the initial angle is 0.5, the final trained ICNN (F-ICNN), and the ICNN (ICNN-PSF) with an added prediction filter component under the same situation.
[0063] Figure 6 This is a diagram of the ICNN network architecture provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0065] like Figure 1 , 3 As shown, a two-stage training deep convex neural network optimization method provided by an embodiment of the present invention includes the following steps:
[0066] S101, collect sample data with a certain quality within a certain period of time through an expansion data collection method;
[0067] S102, enhancing the offline data by a mobile data enhancement method, and then screening the offline data with the assistance of F_shap theory; F_shap is proposed by the present invention, and is a value calculated based on the F_shap theory that can reflect the contribution of the sample to the model.
[0068] S103, optimizing the deep convex neural network using offline data;
[0069] S104, performing security correction on the output of the trained neural network through a security filtering algorithm, and collecting a security-corrected data set through online data collection;
[0070] S105, the online data is screened with the assistance of F_shap theory, and the screened data is mixed with the offline data set to fine-tune and update the deep convex neural network.
[0071] This two-stage training approach to deep convex neural network optimization works as follows:
[0072] First, in step S101, sample data with a certain quality is collected within a certain period of time through an expansion data collection method. This means that within a certain period of time, the system collects data through an expansion data collection method. For detailed steps, see the data collection method to collect data to ensure that the quality and quantity of the data meet the needs of subsequent training.
[0073] Secondly, in step S102, the offline data is enhanced by the floating data enhancement method, and the enhanced data is then screened with the assistance of F_shap theory to ensure the diversity and representativeness of the data. Floating data enhancement refers to expanding the data set through data selection and data transformation to improve the generalization ability of the model. F_shap theory can help identify the features in the data set that have the greatest impact on the model output and further optimize the selection of the data set. F_shap can help identify the sample individuals in the data set that contribute more to the model, so that it is convenient for a data set to screen those data that may help improve the model's capabilities and those that may damage the performance of the model. It is conducive to training.
[0074] Next, in step S103, the deep convex neural network is trained and optimized using the optimized offline data. This step is based on the collected offline data and uses deep learning technology to train the neural network to improve its performance and accuracy.
[0075] Then, in step S104, the trained neural network is outputted for security correction by means of a security filtering algorithm. This is to ensure the security of the neural network in practical applications, and the output of the neural network is corrected by means of a security filtering algorithm to reduce possible errors and risks. The corrected data set is updated through online data collection to further improve the performance and stability of the neural network.
[0076] Finally, in step S105, the online data is screened with the help of F_shap theory, and the screened data is mixed with the offline data set for fine-tuning to further update the deep convex neural network. This step aims to continuously improve and optimize the neural network model using online data to adapt to the ever-changing environment and needs.
[0077] like Figure 2 As shown, a two-stage training deep convex neural network optimization system provided by an embodiment of the present invention includes:
[0078] A data collection module is used to collect sample data with a certain quality within a certain period of time through an expansion data collection method;
[0079] The enhancement module is used to enhance offline data through the mobile data enhancement method, and then filter offline data with the assistance of F_shap theory;
[0080] An optimization module is used to optimize the deep convex neural network using offline data obtained by the dilated data collection method and the swimming data augmentation method;
[0081] A correction module is used to perform security correction on the output of the trained neural network through a security filtering algorithm, and collect the security-corrected data set through online data collection;
[0082] The screening module is used to screen online data with the assistance of F_shap theory, and mix the screened data with the offline data set to fine-tune and update the deep convex neural network.
[0083] Another object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the two-stage training deep convex neural network optimization method.
[0084] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to perform the steps of the two-stage training deep convex neural network optimization method.
[0085] Another object of the present invention is to provide an information data processing terminal, which is used to implement the deep convex neural network optimization system with two-stage training.
[0086] The present invention is specifically implemented:
[0087] The technical solution adopted by the present invention is as follows: The present invention mainly includes two processes, an offline stage and an online stage. First, in the offline stage: sample data with a certain quality is collected within a certain period of time through an expansion data collection method, and then the offline data is enhanced through a swimming data enhancement method, and then the offline data is screened with the assistance of F_shap theory, and then the deep convex neural network is optimized using the offline data. In the online stage: the trained neural network is output with security correction through a security filtering algorithm, and then the security-corrected data set is collected through online data, and the online data is screened with the assistance of F_shap theory, and the screened data is mixed with the offline data set to fine-tune and update the deep convex neural network, which includes the following steps:
[0088] Select the optimization scenario required by the deep convex neural network. This case takes the inverted pendulum as an example.
[0089] The deep convex neural network is trained in the offline stage, which is mainly divided into three parts: dilated data collection, swimming data enhancement, and F_shap-assisted data screening.
[0090] In the present invention, the deep convex neural network is represented by ICNN and the model predictive control is represented by MPC.
[0091] Expansive data collection method: preliminary data collection, by using the model predictive control method to optimize the control of the inverted pendulum model, starting from a certain initial state, using model predictive control to control the entire process from the initial state to stability, and collect data.
[0092] Definition of data set constraints: The data collected by the model predictive control is used for preliminary training of the deep convex neural network, and the maximum and minimum values of the data in the data set are found, and the upper and lower bounds of the data set are used as constraint bounds.
[0093] Default data definition: The deep convex neural network trained with offline data and the model prediction control are used in the same initial state to observe the state of the inverted pendulum. If the state of the inverted pendulum exceeds the upper and lower bounds of the previously collected data set, it is defined as a default state.
[0094] Default status data is collected again: within a certain period of time, the deep convex neural network model is called to collect the corresponding default status, and the default status is controlled by model prediction to collect new data accordingly, and the collected data is stored in the offline data pool.
[0095] like Figure 4 As shown, the data collection method flow is as follows, where x_initial represents the initial state, which is randomly selected from the state variables, u represents the control output, and x represents the state variable;
[0096] Model predictive control controls from the initial state x_initial to stability;
[0097] Use model predictive control (MPC) to control the inverted pendulum from the state variable x_initial to stability;
[0098] The control force u is calculated using MPC;
[0099] Collect all state variables x and control forces u as the data set Dataset;
[0100] Calculate the maximum value x_max in the dataset Dataset;
[0101] Calculate the minimum value x_min in the dataset Dataset;
[0102] A deep convex neural network (ICNN) controls the inverted pendulum from the initial state x_initial;
[0103] Use ICNN to control the inverted pendulum from the state variable x_initial to stability;
[0104] If the state variable x is between x_min and x_max;
[0105] Use ICNN to calculate the control force u;
[0106] If it’s not in the middle of this;
[0107] Define this state as a default state;
[0108] The control force u is calculated using MPC;
[0109] and collect the corresponding data;
[0110] Combine the data collected from the two processes and train the ICNN neural network;
[0111] Data enhancement in offline data pool: First, define two processes of data enhancement, namely the first data selection process and the second "large-medium-small" data movement process. The first data selection process is mainly to determine the proportion of a certain enhanced data to avoid the imbalance of data distribution caused by excessive enhanced data.
[0112] The second data movement process mainly achieves the purpose of randomly moving the data samples in a large range in the sample space at the beginning, and then densely growing at the corresponding position after moving to a certain stage, by changing the values in three stages.
[0113] The specific process is as follows, where Dataset is the dataset collected offline, a represents different step sizes, and N is the number of selected data.
[0114] Randomly select N data from the Dataset, called X_N;
[0115] If in the first stage;
[0116] Assign a a larger value;
[0117] X_N = a*X_N;
[0118] If in the second stage;
[0119] Assign a a medium-sized value;
[0120] X_N = a*X_N;
[0121] Assign a smaller value to a;
[0122] X_N = a*X_N;
[0123] Use MPC to solve X_N to get the corresponding u;
[0124] Merge the new X_N and u with Dataset;
[0125] Security assurance and data collection during the online phase
[0126] Safety assurance in the online stage: The main task of the safety filter is to predict and correct the output of the controller to ensure that the output of the controller is safe for the controlled object. The main steps of the safety filter algorithm: At time k, given the state variables and the input variables of the controller as input, predict and calculate its state in the time domain N. If the input of the controller meets the safety constraints in this time domain (usually defined as the feasibility space, which can be adjusted according to the specific application scenario in different situations), the input obtained by the controller strategy will be used as the control force at the kth moment. Otherwise, the backup safety control strategy π is selected to calculate the safety control at the current moment.
[0127] At the same time, the current state and control force are recorded as sample pairs and saved in the online sample pool.
[0128] Auxiliary screening of F_shap:
[0129] The F_shap method is used to analyze samples of deep convex neural networks trained at different stages, and corresponding data enhancement and screening are performed in combination with online performance.
[0130] The F_shap value of the data set is calculated as follows:
[0131]
[0132] Among them, E represents the data features in the data set, S represents all features in the feature set E except the jth data feature, φ ij Represents the value of the i-th sample on the j-th feature
[0133]
[0134] M represents the feature dimension, that is, the number of features, N represents the number of data samples, ω j Represents the weight of the jth feature in the total features
[0135]
[0136] F shap_n is the calculated F of sample n shap value
[0137] The dataset obtained by the offline expansion data collection method is called Dataset_col, the dataset obtained by the swimming data enhancement method is Dataset_aug, and the dataset obtained by the online security assessment method is Dataset_on.
[0138] The process of selecting samples according to F_shap is as follows:
[0139] If you are in the offline stage:
[0140] Train ICNN based on Dataset_col;
[0141] If ICNN performs better;
[0142] Use the F_shap calculation method to calculate the F_shap value of the samples in Dataset_aug;
[0143] According to the F_shap value, select a certain proportion of data from Dataset_aug and merge it with Dataset_col to get Dataset_fm;
[0144] If ICNN performs poorly;
[0145] Use the F_shap calculation method to calculate the F_shap value of the samples in Dataset_col;
[0146] According to the F_shap value, a certain proportion of data is selected from Dataset_col and enhanced using the data enhancement method designed in this paper;
[0147] If you are online:
[0148] Use Dataset_fm for ICNN training;
[0149] Use the F_shap method to calculate the F_shap value of the samples in Dataset_on;
[0150] According to the F_shap value, select a certain proportion of data from Dataset_on and merge it with Dataset_fm, and train ICNN with the merged data;
[0151] The specific implementation method and content are consistent. The inverted pendulum model is used for simulation, which can obtain a control effect similar to that of MPC.
[0152] Figure 5 The experimental effect diagram of the MPC algorithm under the condition of initial angle of 0.5, the final trained ICNN (F-ICNN), and the ICNN with added prediction filter component (ICNN-PSF) under the same condition, where figure a represents the angle change, figure b represents the energy change during the optimization process, figure c represents the time bar chart during the solution process, figure d represents the single solution time of the solution process, and the subscripts 1, 2, and 3 represent three different noises: Gaussian white noise, red noise, and brown noise, respectively.
[0153] like Figure 6 As shown, the ICNN network architecture:
[0154] Among them, x, u represent the data input channels, and p and z represent the output of each layer of the network.
[0155] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.
[0156] Here is a detailed explanation of how the two-stage training deep convex neural network optimization method works:
[0157] Step 1: Collect sample data of a certain quality within a certain period of time through an expansion data collection method
[0158] Extensive data collection: This is a broad data collection strategy that may include multiple data sources and collection methods. This approach ensures that enough samples are collected within a specific time frame and that the samples are representative enough to reflect the complexity of the actual problem.
[0159] Data quality: During the collection process, a series of quality control measures may be implemented to ensure that the data collected are accurate, reliable and representative.
[0160] Step 2: Enhance offline data through the swimming data enhancement method, and then filter offline data with the help of F_shap theory
[0161] Swimming data augmentation: This is a dynamic data augmentation method that may include multiple augmentation techniques (such as translation, rotation, scaling, etc.) to generate more diverse training samples and improve the generalization ability of the model.
[0162] F_shap theory screening: F_shap (F_shapley Additive exPlanations) is a game theory-based method for explaining the predictions of machine learning models. Here, F_shap may be used to evaluate the importance of each data sample to model training, thereby screening out the samples that have the greatest impact on model performance.
[0163] Step 3: Optimize the deep convex neural network using offline data
[0164] The deep convex neural network is trained and optimized using the filtered high-quality offline data. This usually involves an iterative process of forward propagation (calculating predictions) and backward propagation (calculating gradients and updating model parameters).
[0165] Step 4: Use the security filtering algorithm to perform security correction on the trained neural network output, and collect the security correction data set through online data collection
[0166] Safety filtering algorithms: This is a post-processing step designed to ensure that the model's output meets certain safety criteria or constraints. This may involve identifying and correcting potentially unsafe predictions.
[0167] Online data collection: After the model is deployed, the performance of the model is evaluated by collecting online data in real time or periodically, and a securely corrected dataset is collected for subsequent model updates.
[0168] Step 5: Use F_shap theory to assist in screening online data, and mix the screened data with the offline data set to fine-tune and update the deep convex neural network. Use F_shap theory to screen online data to identify online data samples that have the greatest impact on model performance.
[0169] The filtered online data is mixed with the offline data set to fine-tune and update the deep convex neural network. This mixed data set method can make full use of the stability of offline data and the real-time nature of online data to improve the adaptability and robustness of the model.
[0170] In summary, this two-stage training deep convex neural network optimization method continuously optimizes and improves the performance of the model through multiple steps such as data collection, data enhancement, F_shap screening, model training, security filtering and online data fusion.
[0171] The technical solution of the patent of the present invention has been verified by using model predictive control (MPC) to control the inverted pendulum of a trolley. Through the technical solution of the present invention, the F-ICNN obtained by finally training the ICNN has a control effect similar to that of the MPC, but has a faster solution time.
[0172] This paper controls the inverted pendulum of the trolley to start swinging at an initial angle of 0.5rad, and compares the control effects of three algorithms, F-ICNN and MPC, trained by the technical solution of the present invention, and ICNN-PSF, in which a safety filter component (PSF) is added to the trained F-ICNN, under Gaussian noise, red noise, brown noise and the like.
[0173] Among them, a1-a3 represents the inverted pendulum angle change diagram during the control process, b1-b3 represents the change diagram of its cost function, c1-c3 is the bar chart of the controller calculation time of its three algorithms, and d1-d3 is the calculation time of the three algorithms. Table 1 shows the average calculation time of the three algorithms, and Table 2 shows the adjustment time of the three algorithms.
[0174] The relevant definitions are as follows
[0175] Adjustment time: The time required for the control process to converge to a steady-state error.
[0176] Computation Time: The time required for a controller to calculate a control input.
[0177] Table 1 Computation time (average and maximum) of three algorithms under different interferences
[0178]
[0179] Table 2 Adjustment time (average and maximum) of three algorithms under different interferences
[0180]
[0181] From the control effect, the advantages of the solution proposed by the present invention are as follows:
[0182] As can be seen from Table 2, the adjustment time of F-ICNN is better than that of MPC in all three cases. This means that from the perspective of adjustment time, the effect of F-ICNN is better or not worse than that of MPC. Considering that both F-ICNN and MPC are based on optimization algorithms, we plot the changes in their cost functions during the optimization process. Figure 5 As shown in the series of graphs in the middle b, the cost function curve of F-ICNN is lower than that of MPC at each peak, and the decline rate is very fast, approaching the steady state faster than MPC. From these figures, it can be seen that when the control performance of the two algorithms is equivalent from the perspective of stabilization time, the change trend of their cost functions also shows a high degree of consistency. In the scenario where the stabilization time of F-ICNN is shorter than that of MPC, F-ICNN also tends to approach zero faster during the cost function optimization process. According to the analysis of the settling time and cost function graph, it can be seen that the control effect of the fully trained F-ICNN is generally close to MPC, but even better than MPC in some aspects.
[0183] The advantages of the solution proposed by the present invention are as follows:
[0184] Figure 5The d series in is the algorithm calculation time of the algorithm without interference. As can be seen from the figure, most of the F-ICNN calculation time (red scatter points) are distributed at the bottom of the figure, while the MPC calculation time (green scatter points) are mostly distributed above the red scatter points, which means that F-ICNN has excellent calculation time compared with MPC. It can be seen from the maximum running time in Table 1 that the maximum calculation time of MPC is much larger than the calculation time of F-ICNN under various conditions. This is because the difficulty of solving the optimal control problem varies with the changes of the dynamic system, and the calculation time of MPC will increase significantly in some complex cases. The trained F-ICNN algorithm can effectively ignore the difficulty of solving the optimal control problem and provide stable and superior calculation time. In order to further explore the distribution of calculation time, we eliminated abnormal differences (too long or too short running time due to the difficulty in solving the optimal control problem) and drew a box plot of the algorithm calculation time, as shown in Figure 5 In the c-series, in most cases, the maximum value of F-ICNN (upper edge of the box) is smaller than the minimum value of MPC (lower edge of the box). In addition, from the middle line (red line in the box), F-ICNN shows a superior computing time advantage.
[0185] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.
Claims
1. A two-stage training deep convex neural network optimization method, characterized in that: There are two stages: offline stage and online stage; The offline phase is mainly divided into three parts: expansive data collection, roving data enhancement, and F_shap-assisted data screening; The online phase mainly involves two parts: online security filtering and online data collection; The specific steps include: S101, collect sample data within a specified time by using an expansion data collection method; Specifically, in the scenario of controlling the inverted pendulum of the trolley from the state variable to stability, x represents the state variable, x_initial represents the initial state, x_initial is randomly selected from the state variable, and u represents the control force of the control output; Use the model predictive control algorithm MPC to control the inverted pendulum from the initial state x_initial to stability; and use the model predictive control algorithm MPC to calculate the control force u; collect all state variables and control forces as the offline collected data set Dataset; and calculate the maximum value x_max and the minimum value x_min in the offline collected data set Dataset, and use the upper and lower bounds of the offline collected data set Dataset as constraint bounds; Use the deep convex neural network ICNN model to control the inverted pendulum from the initial state x_initial to stability; if the state variable x is between x_min and x_max, use the deep convex neural network ICNN model to calculate the control force u'; if the state variable x is not between x_min and x_max, this state is defined as a default state, and the model predictive control MPC algorithm is used to calculate the control force u" corresponding to the default state and collect the corresponding data; The data collected by the above two processes in step S101 are combined as a data set Dataset_col obtained by an offline expansion data collection method; S102, performing swimming data enhancement on the collected offline data, and then using the F_shap theory to evaluate the importance of each offline data sample to the deep convex neural network ICCN model training, and screening out the offline data samples that have the greatest impact on the performance of the deep convex neural network ICNN model; The swimming data enhancement method specifically includes: first determining the proportion of enhanced data, then initially randomly selecting N data from Dataset_col, recorded as X_N, and then selecting X_N = a*X_N, where a represents different step sizes, the value of a is gradually reduced, and N is the number of selected data; all X_N obtained in the process of gradually adjusting the step size are solved using MPC to obtain the corresponding control force u"", and all X_N and u"" obtained in this step are merged with Dataset_col, that is, the data set obtained by the swimming data enhancement method is defined as Dataset_aug; The process of screening offline samples according to F_shap is as follows: if the performance of the ICNN model obtained by training the ICNN model according to Dataset_col meets expectations, the F_shap calculation method is used to calculate the F_shap value of the samples in Dataset_aug, and a preset proportion of data is selected from Dataset_aug according to the size of the F_shap value and merged with Dataset_col to obtain Dataset_fm; if the performance of the ICNN model obtained by training the ICNN model according to Dataset_col does not meet expectations, the F_shap calculation method is used to calculate the F_shap value of the samples in Dataset_col, and a preset proportion of data is selected from Dataset_col according to the size of the F_shap value and enhanced by the swimming data enhancement method; S103, using the screened high-quality offline data to train and optimize the deep convex neural network ICNN model; S104, perform output security correction on the trained deep convex neural network ICNN model through a security filtering algorithm to ensure that the output of the ICNN model meets the security standards; after the ICNN model is deployed, collect online data in real time or regularly to evaluate the ICNN model, and collect the security-corrected data set, that is, define the data set obtained by the online security evaluation method as Dataset_on, which is used for subsequent ICNN model updates; S105, update model with mixed data: use F_shap theory to screen online data to identify online data samples that have the greatest impact on model performance; and mix the screened online data with offline data sets. Specifically, first use Dataset_fm to train the ICNN model, then use the F_shap method to calculate the F_shap value of the samples in Dataset_on, select a preset proportion of data from Dataset_on and merge it with Dataset_fm according to the F_shap value; fine-tune and update the deep convex neural network ICNN model based on the mixed data; finally, the deep convex neural network ICNN model that completes the two-stage training through all the above steps is the F-ICNN model.
2. A two-stage trained deep convex neural network optimization system implementing the two-stage trained deep convex neural network optimization method as claimed in claim 1, characterized in that: include: A data collection module, used to collect sample data within a specified time by using an expanded data collection method; The enhancement module is used to enhance offline data through the mobile data enhancement method, and then filter offline data with the assistance of F_shap theory; An optimization module for optimizing deep convex neural networks using offline data; A correction module is used to perform security correction on the output of the trained neural network through a security filtering algorithm, and collect the security-corrected data set through online data collection; The screening module is used to screen online data with the assistance of F_shap theory, and mix the screened data with the offline data set to fine-tune and update the deep convex neural network.
3. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the two-stage training deep convex neural network optimization method as claimed in claim 1.
4. A computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to perform the steps of the two-stage training deep convex neural network optimization method as described in claim 1.
5. An information data processing terminal, characterized in that: The information data processing terminal is used to implement the deep convex neural network optimization system with two-stage training as described in claim 2.
