Application scenario construction method for digital twin mechanism optimization based on random forest analysis
Through random forest analysis and PCA dimensionality reduction algorithm screening important features, the problem of large amount of data and high dimensions in the production process of plant protection products is solved, and efficient monitoring and model interpretation is achieved.
Patent Information
- Application Number
- CN202310554220.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-17
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-05-17
AI Technical Summary
In the production process of plant protection products, the process parameters and environmental data are large in volume and high in dimensions, and the lack of effective monitoring and feature screening methods leads to insufficient interpretation of the mechanism of the digital twin model.
Using a method based on random forest analysis and combining PCA dimensionality reduction algorithm, important features are selected from high-dimensional features and input them into the digital twin model to realize automatic monitoring and intelligent feature selection.
It improves the monitoring accuracy of the production process of plant protection products and the interpretability of the model, ensuring data adequacy and model accuracy.
Smart Images

Figure CN116451064B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of big data, the Internet of Things, and digital twins, and specifically to an application scenario construction method based on random forest analysis and digital twin mechanism optimization. Background Art
[0002] With the application of the Internet of Things and digital twin models in the production of plant protection products, the demand for mechanistic explanations for the entire model set is becoming increasingly stringent. A strong mechanistic explanation can provide valuable guidance and monitoring for the production process. However, the total amount of process parameters and environmental data in the production of plant protection products is extremely large and multi-dimensional. Therefore, a method that can monitor the on-site environment and screen for features is urgently needed to achieve strong mechanistic explanations throughout the entire process, from real-world production to virtual drive models. Summary of the Invention
[0003] To solve the above technical problems, the present invention proposes an application scenario construction method based on random forest analysis and digital twin mechanism optimization, which can realize automatic monitoring of on-site production processes and intelligently screen out important features from high-dimensional features and input them into the digital twin model.
[0004] To achieve the above object, the technical solution adopted by the present invention is:
[0005] The application scenario construction method based on random forest analysis and digital twin mechanism optimization includes the following steps:
[0006] 1) Production data extraction;
[0007] Depending on the required application scenario, before performing random forest algorithm model classification and detection, it is necessary to apply IoT technology to extract all physical parameters and environmental data information of the production process;
[0008] 2) Random forest model training monitoring;
[0009] Random forest is used to complete the function mapping between feature values and label values. Missing data is filled with the average value and the mode value. Dimensional imbalance is processed by normalization. A single decision tree uses the Gini coefficient as the division standard. Model evaluation uses the proportion of correctly classified samples in the total samples.
[0010] 3) PCA feature selection;
[0011] Using the PCA dimensionality reduction algorithm, the covariance matrix is calculated and important features exceeding the threshold are extracted from the high-dimensional feature information of the Internet of Things;
[0012] 4) Extraction of important features;
[0013] PCA principal component analysis is used to screen features, and the feature importance is double-verified in combination with the random forest Gini coefficient, so as to achieve the minimum number of eigenvalues and strong interpretability of the digital twin model mechanism.
[0014] 5) Explanation of the digital twin model mechanism;
[0015] Model, deduce, and simulate the information sources of the minimum number of important feature items of the digital twin system calculated according to the above steps.
[0016] As a further improvement of the present invention, the dimension imbalance normalization process in step 2) is expressed as:
[0017] The preprocessing selected this time is mainly to fill the missing data values with the average value and the classification value with the mode value. After the filling is completed, the feature values need to be normalized;
[0018]
[0019] Where i is the feature dimension of the data set, j is the amount of data in the data set, and x' ij is the new eigenvalue after normalization, x ij is the original eigenvalue, x ij _min is the average value of the i-th dimension feature, is the maximum value of the i-th dimension feature;
[0020] The Gini index in step 2) is expressed as:
[0021] The division of the splitting points of a single subtree and the selection of the best segmentation features are divided according to the Gini index:
[0022]
[0023] Where Gi is the Gini index, c is the number of target label categories. In this application, there are only two categories, namely safe production and non-safe production. The proportion of samples in category c in P(c);
[0024] The model evaluation in step 2) is expressed as:
[0025] This random forest model is used to deal with a classification problem, so the model evaluation criteria are expressed as:
[0026]
[0027] Where U is the accuracy, M is the number of samples successfully judged, and N is the total number of samples. The model is complete when U for the training set and test set exceeds 0.92 and 0.95 respectively.
[0028] As a further improvement of the present invention, the covariance matrix in step 3) is expressed as:
[0029] In addition, covariance calculation is required, that is, calculating the covariance matrix of the data set to measure the correlation between features:
[0030]
[0031] Where CM is the calculated covariance matrix, n is the number of samples in the data set, and X is the matrix after the data set is centered. T Indicates that the centered matrix is transposed.
[0032] As a further improvement of the present invention, the double verification of the important features of random forest and the important features of PCA in step 4) is expressed as:
[0033] After selecting both, you need to perform a combined analysis according to the following formula:
[0034]
[0035] where X last is the number of features finally input into the digital twin model, x l is an important feature in random forest, x k is the preferred feature in the PCA dimensionality reduction algorithm, n is the number of important features in the random forest, and m is the number of features in the PCA dimensionality reduction algorithm;
[0036] In step 4), when the number of important features of the random forest and the number of important features extracted by the PCA dimensionality reduction algorithm are n and m respectively, the important features output to the digital twin are expressed as:
[0037] When the number of important features in the random forest is greater than or equal to the PCA dimensionality reduction algorithm, x is directly output. l The important features in the random forest are added to the digital twin model. However, when the number of important features in the random forest is less than the number of features in the PCA dimensionality reduction algorithm, feature screening is required to calculate the optimal feature x. k :
[0038] D=V(x l )+V(x k ), k=1, 2, 3,..., mn ⑹
[0039] D≥0.95 ⑺
[0040] Where D is the cumulative variance explanation ratio, and V is the variance explanation ratio calculated for a single feature. V(x l ) represents the total cumulative variance explained by the important features in the random forest in the PCA dimensionality reduction algorithm, V(xk ) represents the process of sorting the remaining important features after removing the important features selected by the random forest from the important features selected by the PCA dimensionality reduction algorithm and calculating the variance explained proportion. The remaining important features are then accumulated one by one, starting with the one with the largest variance explained proportion, until Equation 7 is satisfied, i.e., the cumulative variance explained proportion is greater than 0.95. The minimum k value is then selected, which is the number of remaining important features to be selected from the PCA. Finally, the remaining important features from the PCA are selected and output together with the important features selected by the random forest as the explained features in the digital twin.
[0041] This application has the following benefits:
[0042] This application provides an application scenario construction method based on random forest analysis digital twin mechanism optimization, which uses random forests to monitor and classify the production environment of plant protection factories in real time, thereby improving processing speed and monitoring accuracy.
[0043] This application provides an application scenario construction method based on random forest analysis and digital twin mechanism optimization, which combines random forest feature selection and PCA dimensionality reduction algorithm to screen high-dimensional features and input important features into the digital twin model, thereby improving the overall model interpretability.
[0044] This application provides an application scenario construction method based on random forest analysis and digital twin mechanism optimization, which uses the Internet of Things to extract the physical parameters and environmental data of the entire factory, ensuring the adequacy of the data volume and dimension when the data set is input into the random forest algorithm, thereby improving the accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 Flowchart of the application scenario construction method based on random forest analysis digital twin mechanism optimization provided in the embodiment of the present application;
[0046] Figure 2 According to the application scenario construction method based on random forest analysis digital twin mechanism optimization provided in the embodiment of the present application, the high-latitude characteristic information diagram of the production of Internet of Things plant protection products;
[0047] Figure 3 A flowchart of the merging of important features of random forest and PCA is provided according to the application scenario construction method based on random forest analysis of digital twin mechanism optimization provided in the embodiment of the present application. DETAILED DESCRIPTION
[0048] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:
[0049] like Figure 1 Shown is a flow chart of the application scenario construction method based on random forest analysis and digital twin mechanism optimization provided by this application.
[0050] Step S1: Plant protection production data extraction.
[0051] like Figure 2 Shown is an information diagram of high-latitude characteristics of IoT plant protection product production based on the application scenario construction method of random forest analysis digital twin mechanism optimization provided by this application.
[0052] The real-world application platform for this project is a plant protection product production base. Before conducting random forest algorithm model classification and testing, it is necessary to apply IoT technology to extract all physical parameters and environmental data information of the production process.
[0053] First, data is collected on physical parameters, including sound levels and noise, vibration levels of factory equipment and machinery, real-time location information of factory equipment, vehicles or cargo, and voltage, current and power information of important equipment.
[0054] In addition, the environmental information collected is also extremely important for the production of plant protection products, including temperature data, humidity data, irrigation flow rate during the production process, meteorological data monitoring such as wind speed, wind direction, atmospheric pressure and precipitation, water quality parameters monitoring such as pH value, dissolved oxygen, turbidity and conductivity, gas concentration and chemical content in the air.
[0055] Step S2: Random forest model training monitoring.
[0056] As mentioned above, since the feature parameters of this time involve the construction of the digital twin model of the entire plant protection platform, all feature information proposed by the Internet of Things may be related to the accuracy of subsequent production safety monitoring. Therefore, random forest is used to perform function mapping between the feature parameters and the target labels.
[0057] First, the original feature data is preprocessed. Since the feature data extracted from the Internet of Things has high dimensions and the data scale ranges between each feature dimension vary greatly, the features need to be preprocessed. The preprocessing selected this time is mainly to fill the missing data values with the average value and the classification value with the mode value. After filling, the feature values need to be normalized.
[0058]
[0059] Where i is the feature dimension of the data set, j is the amount of data in the data set, and x' ij is the new eigenvalue after normalization, x ij is the original eigenvalue, x ij _min is the average value of the i-th dimension feature, is the maximum value of the i-th dimension feature.
[0060] After processing the incoming IoT data, a random forest model needs to be constructed. The core of this construction is a set of decision trees. Within each decision tree, features from the total i dimensions are randomly sampled to prevent overfitting due to the large number of dimensions used in this application. Furthermore, sampling with replacement is used for sample selection.
[0061] The division of the splitting points of a single subtree and the selection of the best segmentation features are divided according to the Gini index:
[0062]
[0063] Where Gi is the Gini index, c is the number of target label categories, there are only two categories in this application, namely safe production and non-safe production, and the proportion of samples in category c in P(c).
[0064] After all decision trees are trained, they are combined into a random forest. For the classification problem in this application, a voting method is used to determine the final predicted category. That is, if the number of votes for the safe label exceeds the number of votes for the unsafe label, the prediction is safe; otherwise, the prediction is unsafe.
[0065] This random forest model is used to deal with a classification problem, so the model evaluation criteria can be expressed as:
[0066]
[0067] Where U is the accuracy, M is the number of samples successfully judged, and N is the total number of samples. The model is complete when U for the training set and test set exceeds 0.92 and 0.95 respectively.
[0068] Step S3: PCA feature selection.
[0069] In this PCA feature selection, the massive data extracted from the original Internet of Things first needs to be filled with missing values, just like some preprocessing operations in step S2, and then normalized.
[0070] After filling, the data needs to be unified and centered, that is, the mean is subtracted from each data point so that the mean value of each dimension of the data set is 0.
[0071] In addition, covariance calculation is required, that is, calculating the covariance matrix of the data set to measure the correlation between features:
[0072]
[0073] Where CM is the calculated covariance matrix, n is the number of samples in the data set, and X is the matrix after the data set is centered. TIndicates that the centered matrix is transposed.
[0074] Then the eigenvalues and corresponding eigenvectors of the covariance matrix are calculated, and the eigenvectors are arranged into a matrix from top to bottom in rows according to the corresponding eigenvalues, and the important eigenvalues are calculated and selected.
[0075] Step S4: Extract important features.
[0076] like Figure 3 Shown is a flowchart of the merging of important features of random forest and PCA for the application scenario construction method based on random forest analysis and digital twin mechanism optimization provided by this application.
[0077] According to step S3 and step S4, the important feature selection range of the Internet of Things in step S1 is obtained respectively.
[0078] In random forests, the importance score of features is calculated according to the Gini coefficient. In this application, due to the large feature dimension, a higher threshold is used to select the feature parameter values that have the most important impact on the model in order to enhance the interpretability of the digital twin model.
[0079] In the PCA dimensionality reduction algorithm, a high threshold is first designed based on the PCA dimensionality reduction algorithm itself. Only features above this threshold will be recorded as important features.
[0080] After selecting both, you need to perform a combined analysis according to the following formula:
[0081]
[0082] where X last is the number of features finally input into the digital twin model, x l is an important feature in random forest, x k is the preferred feature in the PCA dimensionality reduction algorithm, n is the number of important features in the random forest, and m is the number of features in the PCA dimensionality reduction algorithm.
[0083] When the number of important features in the random forest is greater than or equal to the PCA dimensionality reduction algorithm, x is directly output. l The important features in the random forest are added to the digital twin model. However, when the number of important features in the random forest is less than the number of features in the PCA dimensionality reduction algorithm, feature screening is required to calculate the optimal feature x. k :
[0084] D=V(x l )+V(x k ), k=1, 2, 3,..., mn ⑹
[0085] D≥0.95 ⑺
[0086] Where D is the cumulative variance explanation ratio, and V is the variance explanation ratio calculated for a single feature. V(x l ) represents the total cumulative variance explained by the important features in the random forest in the PCA dimensionality reduction algorithm, V(x k ) represents the process of sorting the remaining important features after removing the important features selected by the random forest from the important features selected by the PCA dimensionality reduction algorithm and calculating the variance explained proportion. Starting with one, the remaining important features are accumulated one by one until Equation 7 is satisfied, i.e., the cumulative variance explained proportion is greater than 0.95. The minimum k value is then selected, which is the number of features remaining in the PCA. Finally, the remaining important features from the PCA are selected and output together with the important features selected by the random forest as the explained features in the digital twin.
[0087] Step S5: Explanation of the digital twin model mechanism.
[0088] The digital twin system is modeled, deduced, and simulated based on the information source of important feature items input.
[0089] The above description is merely a preferred embodiment of the present invention and does not constitute any other form of limitation to the present invention. Any modification or equivalent variation based on the technical essence of the present invention shall still fall within the scope of protection claimed by the present invention.
Claims
1. The application scenario construction method based on random forest analysis and digital twin mechanism optimization is characterized by: The following steps are involved: 1) Production data extraction; Depending on the required application scenario, before performing random forest algorithm model classification and detection, it is necessary to apply IoT technology to extract all physical parameters and environmental data information of the production process; 2) Random forest model training monitoring; Random forests are used to complete the functional mapping between feature values and label values. Missing data are filled with the mean and mode values. Dimensional imbalance is handled by normalization. A single decision tree uses the Gini coefficient as the division criterion. Model evaluation is based on the proportion of correctly classified samples in the total samples. The dimension imbalance normalization process in step 2) is expressed as: The preprocessing selected this time is to fill the missing data values with the average value and the classification value with the mode value. After the filling is completed, the feature values need to be normalized; ; in is the feature dimension of the dataset, is the amount of data in the dataset, is the new eigenvalue after normalization, is the original eigenvalue, For the The average value of the dimension feature, For the The maximum value of the dimension feature; The Gini coefficient in step 2) is expressed as follows: the division of the splitting points of a single subtree and the selection of the best segmentation features are divided according to the Gini coefficient: ; in is the Gini coefficient, is the number of target label categories. In this application, there are only two categories, namely safe production and non-safe production. The proportion of samples in category c; The model evaluation in step 2) is expressed as: This random forest model is used to deal with a classification problem, so the model evaluation criteria are expressed as: ; Where U is the accuracy, M is the number of samples that are successfully judged, and N is the total number of samples. The model is built when U of the training set and the test set exceed 0.92 and 0.95 respectively; 3) PCA feature selection; Use the PCA dimensionality reduction algorithm to calculate the covariance matrix and extract important features that exceed the threshold in the high-dimensional feature information of the Internet of Things; The covariance matrix in step 3) is expressed as: Calculate the covariance matrix of the dataset to measure the correlation between features: ; Where CM is the calculated covariance matrix, is the number of samples in the dataset, is the matrix after the data set is centered, Indicates that the centered matrix is transposed; 4) Extraction of important features; Use PCA principal component analysis to screen features and perform double verification in combination with random forest Gini coefficient feature importance to achieve the minimum number of eigenvalues; The double verification of the important features of random forest and PCA in step 4) is expressed as: After selecting both, you need to perform a combined analysis according to the following formula: ; in is the number of features finally input into the digital twin model, is an important feature in random forest, is the preferred feature in the PCA dimensionality reduction algorithm, is the number of important features in the random forest, is the number of features in the PCA dimensionality reduction algorithm; When the number of important features of the random forest in step 4) and the number of important features extracted by the PCA dimensionality reduction algorithm are n and m respectively, the important features output to the digital twin are expressed as: When the number of important features in the random forest is greater than or equal to the PCA dimensionality reduction algorithm, it is directly output The important features in the random forest are added to the digital twin model. However, when the number of important features in the random forest is less than the number of features in the PCA dimensionality reduction algorithm, feature screening is required to calculate the optimal features. : ; ; Where D is the cumulative explained proportion of variance, Then calculate the single variance explanation ratio for a single feature, Indicates the total cumulative variance explained by the important features in the random forest in the PCA dimensionality reduction algorithm, After removing the important features selected by random forest from the important features selected by PCA dimensionality reduction algorithm, the remaining important features are sorted and the variance explanation ratio is calculated. The variance explanation ratio is accumulated one by one starting from the one with the largest variance explanation ratio until formula (7) is satisfied, that is, the cumulative variance explanation ratio is greater than 0.
95. The minimum k value is selected, that is, the number of important features remaining in PCA that need to be selected. Finally, the remaining important features selected in PCA are output together with the important features selected by random forest as the explanation feature items in the digital twin. 5) Explanation of the mechanism of the digital twin model; Model, deduce, and simulate the information sources of the minimum number of important feature items of the digital twin system calculated according to the above steps.
Citation Information
Patent Citations
Fault current multi-domain identification method based on RF-LSTM, and storage medium
CN114077846A
Plant factory intelligent management system based on digital twinning
CN115270642A