Camellia sinensis inherent frequency data enhancement method based on improved CTGAN network
By improving the CTGAN network and the three-degree-of-freedom model of Camellia oleifera, synthetic data that satisfies the distribution of real data is generated, which solves the problem of time-consuming dataset collection in the prediction of the inherent frequency of Camellia oleifera and improves the performance and generalization ability of the model.
Patent Information
- Application Number
- CN202410518826.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-28
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2044-04-28
AI Technical Summary
Existing technologies for predicting the inherent frequency of camellia trees are time-consuming and cumbersome to collect data, making it difficult to meet the data requirements of machine learning models. Traditional modeling methods are also time-consuming and inefficient.
An improved CTGAN network was adopted, combined with a three-degree-of-freedom mass-spring-damping model of camellia oleifera, and the generator and discriminator were optimized through a hyperparameter grid search module to generate synthetic data that meets the distribution of real data. Statistical methods and machine learning models were used to evaluate the data quality.
This improved the performance and generalization ability of the Camellia oleifera tree intrinsic frequency prediction model, generated synthetic data that conformed to the real data distribution, expanded the small sample dataset, and improved the training effect of the machine learning model.
Smart Images

Figure CN118395859B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of forest fruit vibration harvesting, and in particular to a camellia oleifera tree natural frequency data enhancement method based on an improved CTGAN network. BACKGROUND
[0002] Due to the strong seasonality and short harvesting period of camellia oleifera fruit picking, the most commonly used harvesting method at present is vibration harvesting, which has high picking efficiency and picking rate. The effect of vibration harvesting is closely related to the vibration frequency during the operation of the harvesting equipment. If the vibration frequency is close to or the same as the natural frequency, the energy transmission will be more effective, and it will be easier to make the fruit fall off.
[0003] The traditional camellia oleifera tree natural frequency prediction method mainly applies the method of camellia oleifera tree three-dimensional model construction and finite element modal analysis, but the structure, stiffness and damping of each camellia oleifera tree are different, which will lead to different natural frequencies, and modeling and finite element analysis of each camellia oleifera tree are too cumbersome and time-consuming. In recent years, with the development of machine learning technology, it has been proved by scholars that the data-driven method can be used for camellia oleifera tree natural frequency prediction, but this method needs a large amount of data for training, and the data set for collecting camellia oleifera tree natural frequency prediction is very time-consuming.
[0004] CTGAN (Conditional Tabular Generative Adversarial Network) is a kind of generative adversarial network for table data. It can generate table data with specific characteristics according to the given conditions by introducing condition generator and discriminator. The CTGAN model can learn the potential relationship between the prediction target and the input features, and greatly preserve the original information of the real data. Therefore, using CTGAN to enhance the camellia natural frequency prediction data set is expected to improve the performance and generalization ability of the prediction model. SUMMARY
[0005] The purpose of the present application is to overcome the shortcomings and deficiencies of the prior art, and to provide a camellia oleifera tree natural frequency data enhancement method based on an improved CTGAN network. The limited original training samples are expanded to generate new samples that meet the real data distribution, so as to meet the requirements of machine learning model for data samples.
[0006] To achieve the above purpose, the technical scheme provided by the present application is: a camellia oleifera tree natural frequency data enhancement method based on an improved CTGAN network, comprising the following steps:
[0007] 1) A simplified camellia oleifera tree three-degree-of-freedom mass-spring-damper model is established, and a camellia oleifera tree forced vibration differential equation is constructed and solved to obtain an equation between camellia oleifera tree natural frequency ω and elastic modulus E, density ρ, cross-sectional diameter d and length l of each branch;
[0008] 2) Collecting multiple groups of size parameters and natural frequency data of camellia oleifera trees, and constructing an original real data set;
[0009] 3) Inputting the original real data set into the constructed improved CTGAN network, obtaining an optimal improved CTGAN network by minimizing the absolute difference of the Pearson correlation coefficient between the original real data set and the synthetic data set, and training the optimal improved CTGAN network to generate multiple groups of synthetic data; wherein the improved CTGAN network is a CTGAN network comprising a conditional vector, a generator G and a discriminator D, and a hyperparameter grid search module is added to the CTGAN network for grid search optimization of hyperparameters;
[0010] 4) Using statistical methods to evaluate the quality of the synthetic data, and verifying whether the generated synthetic data meets the characteristic distribution of the original real data set; developing a machine learning model to make regression prediction on the synthetic data, calculating the evaluation index of the machine learning model, and verifying the quality of the generated synthetic data.
[0011] Further, in step 1), the camellia oleifera tree is simplified as a three-degree-of-freedom mass-spring-damper model, the structure of the camellia oleifera tree is divided into three parts of trunk, main branch and secondary branch, the mass of the trunk of the camellia oleifera tree is equivalent to m1, the elastic coefficient of the trunk is equivalent to k1, and the damping coefficient of the trunk is equivalent to c1, the mass of all main branches of the camellia oleifera tree is equivalent to m2, the elastic coefficient of all main branches is equivalent to k2, and the damping coefficient of all main branches is equivalent to c2, the mass of all secondary branches of the camellia oleifera tree is equivalent to m3, the elastic coefficient of all secondary branches is equivalent to k3, and the damping coefficient of all secondary branches is equivalent to c3; for the trunk vibration type camellia fruit harvesting, the exciting force Q acts on the trunk through the exciting device, and the displacements of the trunk, the main branch and the secondary branch from the equilibrium position when the trunk, the main branch and the secondary branch are subjected to the exciting force Q are x1, x2 and x3 respectively;
[0012] According to Newton's second law, the forced vibration differential equation of the camellia oleifera tree is constructed, and the formula is as follows:
[0013]
[0014] In the formula, represents the acceleration of the trunk, represents the velocity of the trunk, represents the acceleration of the main branch, represents the velocity of the main branch, represents the acceleration of the secondary branch, represents the velocity of the secondary branch, represents the frequency of the exciting force, t represents time, and sin represents sine;
[0015] The forced vibration of camellia oleifera is simplified as undamped vibration, and the forced vibration differential equation of camellia oleifera is written in matrix form, and the matrix form of the forced vibration differential equation and the characteristic equation of camellia oleifera are listed as follows:
[0016]
[0017] det[K-ω 2 M]=0
[0018] In the formula, [M] represents the matrix form of mass, represents the matrix form of acceleration, [K] represents the matrix form of elastic coefficient, {x} represents the matrix form of displacement, det[] represents the determinant of matrix, and ω represents the natural frequency of camellia oleifera;
[0019] The characteristic equation is arranged to obtain the characteristic equation between the natural frequency ω of camellia oleifera and the trunk mass m1, the trunk elastic coefficient k1, all the main branch mass m2, all the main branch elastic coefficient k2, all the secondary branch mass m3 and all the secondary branch elastic coefficient k3, which is expressed as follows:
[0020]
[0021] In order to simplify the calculation, the branch is approximated as a cylindrical rod, and the equivalent mass of the branch is:
[0022]
[0023] In the formula, m represents the mass of the branch, ρ represents the density of the branch, V represents the volume of the branch, d represents the cross-sectional diameter of the branch, and l represents the length of the branch;
[0024] According to material mechanics, the moment of inertia I of a rod with circular cross section is:
[0025]
[0026] The rotational stiffness k of the branch is:
[0027]
[0028] In the formula, E represents the elastic modulus of the branch;
[0029] Bring k and m into the arranged characteristic equation to obtain:
[0030]
[0031]
[0032]
[0033]
[0034] In the formula, A, B, C represent intermediate variables, d1 represents the cross-sectional diameter of the main stem of the tea-oil tree, and l1 represents the length of the main stem of the tea-oil tree; i represents the i-th main branch of the tea-oil tree, and the value of i ranges from 1 to u, where u represents the number of main branches of the tea-oil tree, d 2i represents the cross-sectional diameter of the i-th main branch of the tea-oil tree, and l 2i represents the length of the i-th main branch of the tea-oil tree; j represents the j-th secondary branch of the tea-oil tree, and the value of j ranges from 1 to v, where v represents the number of secondary branches of the tea-oil tree, d 3j represents the cross-sectional diameter of the secondary branch of the tea-oil tree, and l 3j represents the length of the secondary branch of the tea-oil tree.
[0035] Further, in step 2), a plurality of sample trees of tea-oil are randomly selected from a standardized tea-oil plantation base, and the following data is counted: the number of main branches u and the number of secondary branches v of each sample tree, the length of the main stem l1, the length of the main branch l 2i , the length of the secondary branch l 3j , the cross-sectional diameter of the main stem d1, the cross-sectional diameter of the main branch d 2i , and the cross-sectional diameter of the secondary branch d 3j of the tea-oil sample tree are measured using a tape measure and a vernier caliper, and the natural frequency ω of the tea-oil tree is measured using a hammering method, which is achieved by fixing the impact force hammer and moving the acceleration sensor, knocking with the impact force hammer at a fixed position of the trunk, and measuring at multiple measurement points on the main branch and the secondary branch using the moving acceleration sensor.
[0036] The above-mentioned data is brought into A, B, and C in step 1) for calculation, and the five input features including the calculated A, B, C, u, v, and the predicted natural frequency ω of the tea-oil tree are used to construct an original real data set.
[0037] Further, in step 3), the improved CTGAN network will perform specific data preprocessing operations according to the categories of the original real data: the discrete hash, i.e. the number of primary branches u and the number of secondary branches v of each sample tree, is one-hot encoded, and the values of the continuous columns A, B, C, and ω are normalized in a specific mode. Specifically, a plurality of Gaussian curves with different weights and standard deviations are used to fit the continuous values, and a condition vector is introduced to enable the generator G to be trained by sampling. The generator G generates the initial synthetic data similar to the original real data by using random noise, inputs the preprocessed real data and the synthetic data into the discriminator D for adversarial training, and discriminates the two by the discriminator D. In order to generate new samples similar to the real data, the loss function between the generator G and the discriminator D needs to be minimized. Through the hyperparameter grid search module, the optimal set of hyperparameters is found, the improved CTGAN network under the optimal hyperparameters is trained, and the final synthetic data is generated.
[0038] Further, the hyperparameter grid search module specifically performs the following operations:
[0039] a. Define the hyperparameter grid search range, which involves the following hyperparameters: the random sample size (embedding_dim) passed to the generator, the output sample size of each residual layer (generator_dim), the output sample size of each discriminator layer (discriminator_dim), the learning rate of the generator (generator_lr), the generator weight decay of the Adam (Adaptive Moment Estimation) optimizer (generator_decay), the learning rate of the discriminator (discriminator_lr), the discriminator weight decay of the Adam optimizer (discriminator_decay), and the data sample size (batch_size) to be processed at each step;
[0040] b. Generate a synthetic data set when the number of training times (epochs) reaches the preset value;
[0041] c. In order to evaluate the quality of the generated data, the absolute difference ρ between the Pearson correlation coefficients of the original real data set and the synthetic data set needs to be calculated X,Y , which is expressed as follows:
[0042]
[0043] In the formula, X represents the original real data set, Y represents the synthetic data set, cov(X, Y) represents the covariance between the original real data set X and the synthetic data set Y, σ X , and σ Yrespectively represent the standard deviation between the original real dataset X and the synthetic dataset Y, e represents expectation;
[0044] d, update p once per cycle iteration X,Y The hyperparameter combination with the smallest value, then continue to adjust the value of the number of training times (epochs) and the size of the data sample (batch_size), and constantly cycle until the grid search is completed, at this time a p X,Y The hyperparameter combination with the smallest value, then continue to adjust the value of the number of training times (epochs) and the size of the data sample (batch_size), and constantly cycle until the grid search is completed, at this time a p
[0045] Further, in step 4), according to the synthetic dataset generated in step 3), the quality of the synthetic data is evaluated using statistical methods, including data distribution visualization and comparison of some correlation indicators, data distribution can compare the similarity of the original real data and the synthetic data, preferably two methods of histogram and kernel density estimation curve, correlation comparison can quantify the similarity relationship between variables in the dataset, preferably correlation matrix and calculation of KL divergence, JS divergence two methods; Wherein, the calculation formula of KL divergence and JS divergence of original data and synthetic data is as follows:
[0046]
[0047]
[0048] In the formula, KLD(X||Y) represents the calculation of the KL divergence of the original real dataset X and the synthetic dataset Y, JSD(X||Y) represents the calculation of the JS divergence of the original real dataset X and the synthetic dataset Y, a represents the sample in the original real dataset X, F(a) represents the probability distribution of the original real data, H(a) represents the probability distribution of the synthetic data, N(a) represents the average distribution of F(a) and H(a), KLD(F(a)||N(a)) represents the calculation of the KL divergence of F(a) and N(a), KLD(H(a)||N(a)) represents the calculation of the KL divergence of H(a) and N(a), KL divergence and JS divergence are both greater than or equal to 0, and the smaller the better, the larger the more dissimilar.
[0049] Further, in step 4), 80% of the samples generated in step 3) are divided into a training set, and 20% of the samples are divided into a test set, and four machine learning models suitable for small samples are developed, including decision tree regression DT, support vector machine regression SVR, random forest regression RF and extreme gradient boosting XGBoost; in order to obtain the best machine learning model, 10-fold cross-validation is used to adjust the respective hyperparameters of each machine learning model on the training set, the training set is divided into 10 equal-sized subsets, 9 of which are used for training, and the remaining 1 is used for validation, repeated 10 times, and four regression evaluation indicators are preferred, which quantitatively evaluate the accuracy of the machine learning model after data augmentation using the improved CTGAN network, including indicators: root mean square error RMSE, determination coefficient R 2 , mean absolute error MAE and mean absolute percentage error MAPE, and the calculation equations of the respective indicators are as follows:
[0050]
[0051]
[0052]
[0053]
[0054] In the formula, s represents the number of samples, z represents the zth sample, y z represents the true value, represents the predicted value, represents the average value of the true value y z ; wherein, R 2 is closer to 1, RMSE, MAE and MAPE are smaller, and the performance of the model is better.
[0055] Compared with the prior art, the present application has the following advantages and beneficial effects:
[0056] 1. The CTGAN network comprising a condition vector, a generator G and a discriminator D is added with a hyperparameter grid search module, so that the effect of the CTGAN network is optimal.
[0057] 2. The method can well learn the potential relationship between the size parameters of the tea tree and the natural frequency, and the generated synthetic samples can meet the distribution of the original real data set.
[0058] 3. The relationship between the basic size parameters of the tea tree and the natural frequency is derived through a three-degree-of-freedom mass-spring-damper model of the tea tree, and the derived A, B and C coefficients are applied to the input of the improved CTGAN network, which avoids the problem of feature dimension explosion caused by directly taking all the size parameters of the tea tree as input.
[0059] 4、The introduction of the condition vector can ensure that the generated data and the original true data are consistent in distribution, and different characteristic inherent frequency data of camellia trees can be generated by changing the value of the condition vector, thereby increasing the diversity of the data.
[0060] 5、A complete data enhancement and effect verification scheme is proposed, and the quality of the synthetic data is verified by using statistical methods and machine learning models, so that the quality of the synthetic data can be systematically evaluated.
[0061] 6、The method has good scalability and can be applied to the inherent frequency prediction link of other forest fruit vibration harvesting to enhance the data quickly and well.
[0062] 7、The small sample data is also expanded to improve the performance of the subsequent inherent frequency machine learning regression prediction model, so that the model training is more sufficient. BRIEF DESCRIPTION OF DRAWINGS
[0063] Figure 1 The flowchart of the method of the present application.
[0064] Figure 2 The schematic diagram of the three-degree-of-freedom mass-spring-damper model of the camellia tree (also referred to as: forced vibration dynamics model of the camellia tree).
[0065] Figure 3 The schematic diagram of each level of branch of the camellia tree.
[0066] Figure 4 The schematic diagram of the hammering method test of the camellia tree.
[0067] Figure 5 The structure diagram of the improved CTGAN network.
[0068] Figure 6 The schematic diagram of the hyperparameter adjustment process of the improved CTGAN network. DETAILED DESCRIPTION
[0069] The present application will be further described in detail below in combination with the embodiments and the drawings, but the embodiments of the present application are not limited thereto.
[0070] As shown in the drawings, the embodiment discloses a camellia tree inherent frequency data enhancement method based on an improved CTGAN network, and the specific conditions are as follows: Figure 1 1) A simplified three-degree-of-freedom mass-spring-damper model of the camellia tree is established, the forced vibration differential equation of the camellia tree is constructed and solved, and the equation between the inherent frequency ω of the camellia tree and the elastic modulus E, the density ρ, the cross-sectional diameter d and the length l of each level of branch is obtained;
[0071]
[0072] Due to the complex physical properties of the tea-oil tree itself, when performing vibration dynamics analysis, corresponding simplified analysis needs to be done. Existing research shows that it is more practical to establish a mass-spring-damper model for analysis. Therefore, the tea-oil tree is simplified into a three-degree-of-freedom mass-spring-damper model (also known as: tea-oil tree forced vibration dynamics model), as shown in Figure 2 ; the structure of the tea-oil tree is divided into three parts: trunk, main branch and secondary branch, as shown in Figure 3 ; the mass of the tea-oil tree trunk is equivalent to m1, the elastic coefficient of the trunk is equivalent to k1, and the damping coefficient of the trunk is equivalent to c1. The mass of all main branches of the tea-oil tree is equivalent to m2, the elastic coefficient of all main branches is equivalent to k2, and the damping coefficient of all main branches is equivalent to c2. The mass of all secondary branches of the tea-oil tree is equivalent to m3, the elastic coefficient of all secondary branches is equivalent to k3, and the damping coefficient of all secondary branches is equivalent to c3. For trunk vibration type tea fruit harvesting, the excitation force Q acts on the trunk through the excitation device, and the displacements of the trunk, main branch and secondary branch from the equilibrium position when subjected to the excitation force Q are x1, x2 and x3, respectively.
[0073] According to Newton's second law, the tea-oil tree forced vibration differential equation is constructed, and the formula is as follows:
[0074]
[0075] In the formula, represents the acceleration of the trunk, represents the velocity of the trunk, represents the acceleration of the main branch, represents the velocity of the main branch, represents the acceleration of the secondary branch, represents the velocity of the secondary branch, represents the frequency of the excitation force, t represents time, and sin represents sine;
[0076] The tea-oil tree forced vibration is simplified as undamped vibration, and the tea-oil tree forced vibration differential equation is written in matrix form. The tea-oil tree forced vibration differential equation and the characteristic equation in matrix form are listed, and the formulas are as follows:
[0077]
[0078] det[K-ω 2 M]=0
[0079] In the formula, [M] represents the matrix form of mass, represents the matrix form of acceleration, [K] represents the matrix form of elastic coefficient, {x} represents the matrix form of displacement, det[] represents the determinant of the matrix, and ω represents the inherent frequency of the tea tree;
[0080] The characteristic equation is arranged to obtain the characteristic equation between the inherent frequency ω of the tea tree and the main stem mass m1, the main stem elastic coefficient k1, all the main branch mass m2, all the main branch elastic coefficient k2, all the secondary branch mass m3 and all the secondary branch elastic coefficient k3, which is expressed as follows:
[0081]
[0082] In order to simplify the calculation, the branch is approximated as a cylindrical rod, and the equivalent mass of the branch is:
[0083]
[0084] In the formula, m represents the mass of the branch, ρ represents the density of the branch, V represents the volume of the branch, d represents the cross-sectional diameter of the branch, and l represents the length of the branch;
[0085] According to material mechanics, the moment of inertia I of a rod with a circular cross section is:
[0086]
[0087] The rotational stiffness k of the branch is:
[0088]
[0089] In the formula, E represents the elastic modulus of the branch;
[0090] The k and m are brought into the arranged characteristic equation to obtain:
[0091]
[0092]
[0093]
[0094]
[0095] In the formula, A, B and C represent intermediate variables, d1 represents the cross-sectional diameter of the main stem of the tea tree, and l1 represents the length of the main stem of the tea tree; i represents the number of the main branch of the tea tree, the value range of i is from 1 to u, u represents the number of the main branch of the tea tree, d 2i represents the cross-sectional diameter of the i-th main branch of the tea tree, and l 2i represents the length of the i-th main branch of the tea tree; j represents the number of the secondary branch of the tea tree, the value range of j is from 1 to v, v represents the number of the secondary branch of the tea tree, d 3j represents the cross-sectional diameter of the secondary branch of the tea tree, and l 3jThis represents the length of the secondary branches of the camellia oleifera tree.
[0096] 2) Collect 50 sets of camellia tree size parameters and inherent frequency data to construct the original real dataset;
[0097] Fifty camellia oleifera sample trees were randomly selected from a standardized camellia oleifera planting base, and the following data were collected: the number of main branches u and the number of secondary branches v of each sample tree; and the trunk length l1 and main branch length l1 of each sample tree were measured using a measuring tape and vernier calipers. 2i Secondary branch length l 3j , Trunk cross-sectional diameter d1, Main branch cross-sectional diameter d 2i and the cross-sectional diameter d of the secondary branch 3j The natural frequency ω of the camellia tree was measured using the hammer-beating method. The hammer-beating test of the camellia tree is as follows: Figure 4 As shown, specifically, by using a fixed impact hammer and a moving accelerometer, the impact hammer is used to strike the tree trunk at a fixed position, while the moving accelerometer measures the tree at multiple measurement points on the main branches and secondary branches.
[0098] The statistically obtained data is substituted into A, B, and C in step 1) for calculation. The original real dataset is constructed by combining the five input features, including the calculated A, B, C, u, v, and the intrinsic frequency ω of the predicted target camellia tree, with a total of 50 samples.
[0099] 3) Input the original real dataset into the constructed improved CTGAN network, and obtain the optimal improved CTGAN network by minimizing the absolute difference of the Pearson correlation coefficient between the original real dataset and the synthetic dataset. Then train the optimal improved CTGAN network to generate 200 sets of composite data.
[0100] The original real dataset contains 50 samples, with input features including five parameters: A, B, C, u, and v. An initial CTGAN network is constructed, comprising a conditional vector, a generator G, and a discriminator D. Then, a hyperparameter grid search module is designed and added to the initial CTGAN network to form a new, improved CTGAN network. Figure 5 As shown. Specifically, the hyperparameter grid search module is designed to optimize the performance of the initial CTGAN network, so some operations are designed to perform a grid search to optimize the hyperparameters. For example... Figure 6 As shown, the hyperparameter grid search module specifically performs the following operations:
[0101] a. Define the hyperparameter grid search range, including the random sample size passed to the generator (embedding_dim), the output sample size of each residual layer (generator_dim), the output sample size of each discriminator layer (discriminator_dim), the learning rate of the generator (generator_lr), the generator weight decay of the Adam (Adaptive Moment Estimation) optimizer (generator_decay), the learning rate of the discriminator (discriminator_lr), the discriminator weight decay of the Adam optimizer (discriminator_decay), and the data sample size to be processed at each step (batch_size). The different hyperparameter grid search ranges and search results are shown in Table 1:
[0102] Table 1 Different hyperparameter grid search ranges and search results
[0103] Hyperparameter name Grid search range Optimal parameter embedding_dim [64,128] 64 generator_dim [(256,256),(512,512),(1024,1024)] (1024,1024) discriminator_dim [(256,256),(512,512),(1024,1024)] (1024,1024) generator_lr [[2x10 -4 ,2x10 -3 ,2x10 -2 ]]]> 2 x 10 -3 ]]> generator_decay [[1x10 -6 ,1x10 -5 ]]]> 1 x 10 -6 ]] discriminator_lr [[2x10 -5 ,2x10 -4 ,2x10 -3 ]]]> 2 x 10 -4 ]] discriminator_decay [[1x10 -6 ,1x10 -5 ]]]> 1 x 10 -6 ]]> batch_size [10,50] 50
[0104] b. Generate a synthetic data set when the number of training times (epochs) is 10,000;
[0105] c. To evaluate the quality of the generated data, the absolute difference ρ X,Y between the Pearson correlation coefficient of the original real data set and the synthetic data set needs to be calculated, which is represented by the following formula:
[0106]
[0107] In the formula, X represents the original real data set, Y represents the synthetic data set, cov(X, Y) represents the covariance between the original real data set X and the synthetic data set Y, σ X and σ Y represent the standard deviation between the original real data set X and the synthetic data set Y, and e represents the expectation.
[0108] d. Update the ρ X,Y value every time the loop is iterated once, and then continue to adjust the values of the number of training times (epochs) and the data sample size (batch_size). Repeat the loop until the grid search is complete. At this time, output a hyperparameter combination with the smallest ρ X,Y value. Print this best hyperparameter combination, train the improved CTGAN network under the best hyperparameter combination to learn the data distribution of the original real data set and the potential relationship between the size parameters of the tea tree and the inherent frequency, and finally generate a synthetic data set that best satisfies the real data distribution;
[0109] The improved CTGAN network can perform specific data preprocessing operations according to the categories of the original real data. Specifically, the discrete hash (i.e., the number of primary branches u and the number of secondary branches v of each sample tree) is one-hot encoded, and the values of the continuous columns (A, B, C, ω) are normalized in a specific mode. Specifically, a plurality of Gaussian curves with different weights and standard deviations are used to fit the continuous values, and a conditional vector is introduced to enable the generator G to be trained by sampling. The generator G generates initial synthetic data similar to the original real data by using random noise, inputs the preprocessed real data into the discriminator D for adversarial training, and discriminates the comparison by the discriminator D. In order to generate new samples similar to the real data, the loss function between the generator G and the discriminator D needs to be minimized. Through the hyperparameter grid search module, the optimal set of hyperparameters is found, the improved CTGAN network under the optimal hyperparameters is trained, and the final 200 sets of synthetic data are generated.
[0110] 4) Use statistical methods to evaluate the quality of the synthetic data and verify whether the generated synthetic data meets the feature distribution of the original real data set;
[0111] According to the synthetic data set containing 200 samples generated in step 3), the quality of the synthetic data is evaluated using statistical methods. The statistical methods include visualization of data distribution and comparison of some correlation indicators. The data distribution can compare the similarity of the original real data and the synthetic data. The preferred methods are histogram and kernel density estimation curve. The correlation comparison can quantify the similarity relationship between the variables in the data set. The preferred methods are correlation matrix and calculation of KL divergence and JS divergence. The calculation formulas of the KL divergence and the JS divergence of the original data and the synthetic data are as follows:
[0112]
[0113]
[0114] In the formula, KLD(X||Y) represents the calculation of the KL divergence of the original real data set X and the synthetic data set Y, JSD(X||Y) represents the calculation of the JS divergence of the original real data set X and the synthetic data set Y, a represents a sample in the original real data set X, F(a) represents the probability distribution of the original real data, H(a) represents the probability distribution of the synthetic data, N(a) represents the average distribution of F(a) and H(a), KLD(F(a)||N(a)) represents the calculation of the KL divergence of F(a) and N(a), KLD(H(a)||N(a)) represents the calculation of the KL divergence of H(a) and N(a), the KL divergence and the JS divergence are both greater than or equal to 0, and the smaller the value is, the more similar it is, and the larger the value is, the more dissimilar it is.
[0115] 5) Develop machine learning models to make regression predictions on synthetic data, evaluate the machine learning models, and verify the quality of the generated synthetic data;
[0116] Step 3) Divide the 80% of the 200-sample synthetic dataset generated in step 3) into a training set and the 20% into a test set, and develop four preferred machine learning models suitable for small samples, including decision tree regression DT, support vector machine regression SVR, random forest regression RF, and extreme gradient boosting XGBoost. To obtain the best machine learning model, use 10-fold cross-validation to adjust the respective hyperparameters of each machine learning model on the training set, divide the training set into 10 equal-sized subsets, of which 9 are used for training and the remaining 1 is used for validation, repeat 10 times, and select the four regression evaluation indicators to quantitatively evaluate the accuracy of the machine learning model after data augmentation using the improved CTGAN network, including the indicators: root mean square error RMSE, coefficient of determination R 2 , mean absolute error MAE, and mean absolute percentage error MAPE. The equations for calculating each indicator are as follows:
[0117]
[0118]
[0119]
[0120]
[0121] where s represents the number of samples, z represents the zth sample, y z represents the true value, represents the predicted value, represents the average value of the true value y z ; where R 2 is closer to 1, RMSE, MAE, and MAPE are smaller, and the performance of the model is better.
[0122] The above embodiments are the preferred embodiments of the present application, but the embodiments of the present application are not limited by the above embodiments, and any changes, modifications, substitutions, combinations, simplifications made without departing from the spirit and principles of the present application are equivalent replacement methods and are included within the scope of protection of the present application.
Claims
1. A method for enhancing inherent frequency data of Camellia oleifera based on an improved CTGAN network, characterized in that, The method comprises the following steps: 1) A simplified three-degree-of-freedom mass-spring-damper model of Camellia oleifera trees was established, and the forced vibration differential equation and characteristic equation of Camellia oleifera trees were constructed and solved to obtain the natural frequency of Camellia oleifera trees and the equation between the elastic modulus E, the density , the cross-sectional diameter d and the length l of each branch 2) Collecting multiple groups of size parameters and natural frequency data of camellia oleifera trees to construct an original real data set; 3) Inputting the original real data set into the constructed improved CTGAN network to obtain an optimal improved CTGAN network by minimizing the absolute difference of the Pearson correlation coefficient between the original real data set and the synthetic data set, and training the optimal improved CTGAN network to generate multiple groups of synthetic data; wherein the improved CTGAN network is a CTGAN network comprising a conditional vector, a generator G and a discriminator D, and a hyperparameter grid search module is added to the CTGAN network to perform grid search optimization on the hyperparameters; The improved CTGAN network can perform specific data preprocessing operations according to the categories of the original real data: one-hot encoding is performed on discrete hash including the number of main branches u and the number of secondary branches v of each sample tree, and specific mode normalization processing is performed on the values of continuous columns A, B, C, , which are intermediate variables of the characteristic equation, specifically by fitting the continuous values with multiple Gaussian curves with different weights and standard deviations, and introducing a condition vector to enable the generator G to be trained by sampling, the generator G generates the initial synthetic data similar to the original real data, inputs the preprocessed real data into the discriminator D for adversarial training, and discriminates by the discriminator D; in order to generate new samples similar to the real data, it is necessary to minimize the loss function between the generator G and the discriminator D, find the optimal set of hyperparameters through the hyperparameter grid search module, train the improved CTGAN network under the optimal hyperparameters, and generate the final multiple synthetic data. 4) Using a statistical method to evaluate the quality of the synthetic data and verify whether the generated synthetic data meets the characteristic distribution of the original real data set; developing a machine learning model to perform regression prediction on the synthetic data, calculating the evaluation index of the machine learning model, and verifying the quality of the generated synthetic data.
2. The Camellia sinensis inherent frequency data enhancement method based on the improved CTGAN network according to claim 1, characterized in that, In step 1), the camellia oleifera tree is simplified as a three-degree-of-freedom mass-spring-damper model, the structure of the camellia oleifera tree is divided into three parts of trunk, main branch and secondary branch, the mass of the trunk is equivalent to m1, the elastic coefficient of the trunk is equivalent to k1, and the damping coefficient of the trunk is equivalent to c1, the mass of all main branches is equivalent to m2, the elastic coefficient of all main branches is equivalent to k2, and the damping coefficient of all main branches is equivalent to c2, the mass of all secondary branches is equivalent to m3, the elastic coefficient of all secondary branches is equivalent to k3, and the damping coefficient of all secondary branches is equivalent to c3; for the trunk vibration type camellia fruit harvesting, the exciting force Q acts on the trunk through the exciting device, and the displacements of the trunk, main branch and secondary branch from the equilibrium position when subjected to the exciting force Q are x1, x2 and x3 respectively; According to Newton's second law, the forced vibration differential equation of the camellia oleifera tree is constructed, and the formula is as follows: ; wherein represents the acceleration of the trunk, represents the velocity of the trunk, represents the acceleration of the main branch, represents the velocity of the main branch, represents the acceleration of the secondary branch, represents the velocity of the secondary branch, represents the frequency of the exciting force, t represents time, and sin represents the sine function. The forced vibration of the camellia oleifera tree is simplified as undamped vibration, and the forced vibration differential equation of the camellia oleifera tree is written in matrix form, and the matrix form of the forced vibration differential equation and the characteristic equation of the camellia oleifera tree are listed, and the formulas are as follows: ; ; In the formula, Matrix form representing mass, Matrix form representing acceleration, , , Matrix form representing elastic coefficient, , Matrix form representing displacement, , Determinant of the matrix, Representing the inherent frequency of camellia oleifera The characteristic equation is arranged to obtain the inherent frequency of the tea tree The characteristic equation between the trunk mass m1, the trunk elastic coefficient k1, all the main branch mass m2, all the main branch elastic coefficient k2, all the secondary branch mass m3 and all the secondary branch elastic coefficient k3 is expressed by the following formula: ; In order to simplify the calculation, the branch is approximated as a cylindrical rod, and the equivalent mass of the branch is: ; wherein m represents the mass of the branch, wherein p represents the density of the branch, V represents the volume of the branch, d represents the cross-sectional diameter of the branch, and l represents the length of the branch. According to material mechanics, the moment of inertia I of a rod with circular cross section is: ; The rotational stiffness k of the branch is: ; In the formula, E represents the elastic modulus of the branch; Put k and m into the rearranged characteristic equation to get: ; ; ; ; In the formula, d1 represents the cross-sectional diameter of the main stem of the tea-oil tree, and l1 represents the length of the main stem of the tea-oil tree; i represents the i-th main branch of the tea-oil tree, the value range of i is from 1 to u, u represents the number of the main branches of the tea-oil tree, d 2i represents the cross-sectional diameter of the i-th main branch of the tea-oil tree, and l 2i represents the length of the i-th main branch of the tea-oil tree; j represents the j-th secondary branch of the tea-oil tree, the value range of j is from 1 to v, v represents the number of the secondary branches of the tea-oil tree, d 3j represents the cross-sectional diameter of the secondary branch of the tea-oil tree, and l 3j represents the length of the secondary branch of the tea-oil tree.
3. The Camellia sinensis inherent frequency data enhancement method based on the improved CTGAN network according to claim 2, characterized in that, In step 2), multiple camellia oleifera sample trees are randomly selected from a standardized camellia oleifera planting base, and the following data is counted: the number of main branches u of each sample tree, the number of secondary branches v, the length of the camellia oleifera sample tree trunk l1, the length of the main branch l 2i , the length of the secondary branch l 3j , the cross-sectional diameter of the trunk d1, the cross-sectional diameter of the main branch d 2i , and the cross-sectional diameter of the secondary branch d 3j , the natural frequency of the camellia oleifera tree is measured by the hammering method, specifically by fixing the impact hammer and moving the acceleration sensor, knocking with the impact hammer at the fixed position of the trunk, and moving the acceleration sensor to measure at multiple measurement points on the main branch and the secondary branch. The above data is substituted into A, B, C in step 1) for calculation, and five input features including calculated A, B, C, u, v and the predicted inherent frequency of camellia oleifera tree The original real data set is constructed.
4. The Camellia sinensis inherent frequency data enhancement method based on the improved CTGAN network according to claim 3, characterized in that, The hyperparameter grid search module specifically performs the following operations: a. Define the hyperparameter grid search range, which involves the following hyperparameters: the size of the random sample passed to the generator, the output sample size of each residual layer, the output sample size of each discriminator layer, the learning rate of the generator, the generator weight decay of the adaptive moment estimation optimizer, the learning rate of the discriminator, the discriminator weight decay of the adaptive moment estimation optimizer, and the size of the data sample to be processed at each step; b. Generate a synthetic data set when the number of training times reaches a preset value; c. To evaluate the quality of the generated data, the absolute difference of the Pearson correlation coefficient between the original real dataset and the synthetic dataset needs to be calculated The formula is expressed as follows: ; where X represents the original real dataset, Y represents the synthetic dataset, represents the covariance between the original real dataset X and the synthetic dataset Y, and represents the standard deviation between the original real dataset X and the synthetic dataset Y, respectively, and e denotes expectation. d. Update once per cycle iteration The hyperparameter combination with the smallest value, then continue to adjust the training times and data sample size, and cycle until the grid search is completed, at which time a The hyperparameter combination with the smallest value, then continue to adjust the training times and data sample size, and cycle until the grid search is completed, at which time a The hyperparameter combination with the smallest value, print this best hyperparameter combination, train the improved CTGAN network under the best hyperparameter combination to learn the data distribution of the original real data set and the potential relationship between the size parameters and the inherent frequency of the tea tree, and finally generate the synthesized data that best satisfies the real data distribution.
5. The improved CTGAN network-based Camellia oleifera tree natural frequency data enhancement method according to claim 4, characterized in that, In step 4), according to the synthetic data set generated in step 3), the quality of the synthetic data is evaluated using statistical methods, including visualization of data distribution and comparison of some correlation indicators, the data distribution can compare the similarity of the original real data and the synthetic data, the data distribution is visualized using two methods of histogram and kernel density estimation curve, the correlation comparison can quantify the similarity relationship between the variables of the data set, the correlation matrix and the calculation of KL divergence, JS divergence are used to compare the correlation indicators; wherein, the calculation formula of the KL divergence and the JS divergence of the original data and the synthetic data is as follows: ; ; wherein, represents the KL divergence computed between the original real data set X and the synthetic data set Y, represents the JS divergence computed between the original real data set X and the synthetic data set Y, a represents a sample in the original real data set X, represents the probability distribution of the original real data, represents the probability distribution of the synthetic data, represents and the average distribution, represents the KL divergence computed between and the KL divergence computed between and the KL divergence computed between and the KL divergence and the JS divergence are both greater than or equal to 0, and the smaller the value, the more similar, and the larger the value, the more dissimilar.
6. The Camellia sinensis inherent frequency data enhancement method based on the improved CTGAN network according to claim 5, characterized in that, In step 4), 80% of the samples of the synthetic data set generated in step 3) are divided into a training set, and 20% of the samples are divided into a test set, and four machine learning models suitable for small samples are developed, including decision tree regression DT, support vector machine regression SVR, random forest regression RF, and extreme gradient boosting XGBoost; in order to obtain the best machine learning model, 10-fold cross-validation is used to adjust the respective hyperparameters of each machine learning model on the training set, the training set is divided into 10 equal-sized subsets, 9 of which are used for training, and the remaining 1 is used for validation, repeated 10 times, and four regression evaluation indicators are selected to quantitatively evaluate the accuracy of the machine learning model after data augmentation using the improved CTGAN network, including indicators: root mean square error RMSE, coefficient of determination R 2 , mean absolute error MAE, and mean absolute percentage error MAPE, and the calculation equations of the respective indicators are as follows: ; ; ; ; In the formula, s represents the number of samples, z represents the zth sample, represents the true value, represents the predicted value, represents the true value represents the average value; wherein, R 2 The closer to 1, the smaller the RMSE, MAE and MAPE, and the better the performance of the model.
Citation Information
Patent Citations
Electric picking device for camellia fruit
CN107980353A
A dynamic modeling method of forest and fruit tree based on physical rod
CN109299577A