Wine producing area identification model training method and system based on BP neural network
By evaluating and processing the feature correlation in the wine origin identification model, the multicollinearity problem is solved, the stability and accuracy of the model are improved, and the rapid and accurate wine origin identification is achieved.
Patent Information
- Application Number
- CN202411366012.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-02-11
AI Technical Summary
When training the wine origin recognition model based on BP neural network, the high correlation between input features leads to multicollinearity problems, resulting in unstable training process, large fluctuations in weight updates, and difficult for the model to converge.
By calculating the Pearson correlation coefficient matrix, evaluating the correlation between features, dividing high-correlation and normal correlation data sets, feature selection and dimensionality reduction processing of high-correlation data sets, such as PCA, to ensure the stability of the training process.
It effectively solves the multicollinearity problem, improves the stability and convergence of the model, reduces training time and resource utilization, enhances feature independence, and improves the accuracy and generalization ability of the model.
Smart Images

Figure CN119417486A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of wine origin recognition, and in particular to a wine origin recognition model training method and system based on BP neural network. Background Art
[0002] The training of the wine origin recognition model based on BP neural network mainly uses the backpropagation (BP) algorithm to build and optimize the neural network, so as to realize the recognition of wines from different origins. BP neural network is a common multi-layer feedforward neural network, which usually includes an input layer, one or more hidden layers and an output layer. The training process adjusts the weights and biases of the network by inputting the chemical composition or other characteristics of the wine (such as acidity, alcohol content, etc.) to minimize the error between the predicted output and the actual origin label. This adjustment process is repeated until the output of the network is close enough to the actual label.
[0003] Specifically, the first step in model training is to collect and preprocess data, that is, to obtain a large amount of wine sample data of known origin and normalize it to meet the input requirements of the neural network. Then, the data is divided into a training set and a test set. The training set is used to train the model, and the test set is used to verify the performance of the model. During the training process, the network calculates the output value through forward propagation, compares it with the actual value, and calculates the error. Then, the error is transferred from the output layer to the input layer through the back propagation algorithm, and the weight and bias of each node are adjusted layer by layer to reduce the error. After many iterations, the network gradually learns how to accurately predict the origin of wine through input features, and finally forms a BP neural network model that can effectively identify the origin of wine. This model can not only improve the accuracy of wine origin identification, but also provide technical support for wine quality control and market supervision.
[0004] The prior art has the following deficiencies:
[0005] When training a wine origin recognition model based on a BP neural network, the existing technology usually trains the collected features directly. If there is a high correlation between the input features, the highly correlated features will lead to multicollinearity problems in the input data, causing numerical instability in the neural network during training. This instability may manifest as drastic fluctuations in the weight update process, the loss function value during training cannot be effectively reduced, and even the model may not converge. When this happens, the training process will become very time-consuming and difficult to control, and it will be difficult to obtain a stable model in the end.
[0006] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention
[0007] The purpose of the present invention is to provide a wine origin identification model training method and system based on BP neural network, which effectively solves the multicollinearity problem caused by the high correlation of input features through correlation evaluation and classification processing, and uses the Pearson correlation coefficient matrix and the overall correlation coefficient to reasonably divide the feature data set, and perform feature selection and dimensionality reduction processing, such as PCA, on the high correlation data set to ensure the stability of the training process, reduce the risk of numerical instability and weight update fluctuations, and improve the stability and convergence of the model. At the same time, the dimensionality reduction processing improves the training efficiency and resource utilization, enhances the independence of features, and ultimately improves the accuracy and generalization ability of the model, so as to achieve fast and accurate wine origin identification, so as to solve the problems in the above-mentioned background technology.
[0008] In order to achieve the above object, the present invention provides the following technical solution: a wine origin identification model training method based on BP neural network, comprising the following steps:
[0009] Collect a large amount of sample data, including various chemical and physical indicators that can reflect the characteristics of wines from different origins, and perform preliminary cleaning and preprocessing of the data to remove obvious errors and outliers;
[0010] The correlation between input features is evaluated by calculating the Pearson correlation coefficient between each pair of features, and a Pearson correlation coefficient matrix is constructed based on the calculated Pearson correlation coefficients;
[0011] After obtaining the Pearson correlation coefficient matrix, further analysis is performed on it to comprehensively evaluate the correlation of the input features;
[0012] According to the correlation evaluation results, the entire input features are divided into a high correlation data set and a normal correlation data set;
[0013] For normal correlation data sets, they are directly used for training BP neural networks. For high correlation data sets, highly correlated feature pairs are identified and feature selection algorithms are used to reduce feature dimensions.
[0014] In the process of feature selection and dimensionality reduction, the dimensionality reduction effect is analyzed in real time until the high correlation data set is transformed into a normal correlation data set, and then the transformed normal correlation data set is merged with the original normal correlation data set and used again for BP neural network training.
[0015] Preferably, the specific steps of constructing a Pearson correlation coefficient matrix according to the calculated Pearson correlation coefficient are as follows:
[0016] Before calculating the Pearson correlation coefficient, the input features were standardized;
[0017] The linear correlation between two variables is measured by the Pearson correlation coefficient, which is calculated as follows:
[0018]
[0019] , where r xy is the Pearson correlation coefficient between feature x and feature y, x i and i are the sample values of the two features. The sample value refers to the specific measurement value of a feature for each observation object in the data set. and are the means of all sample values of feature x and feature y, respectively. Correlation coefficient r xy The value range is between -1 and 1, and n represents the total number of samples, that is, the number of observations in the data set;
[0020] Calculate the Pearson correlation coefficient between all feature pairs and store the results in a matrix to form the Pearson correlation coefficient matrix, which is a symmetric matrix.
[0021] Preferably, after obtaining the Pearson correlation coefficient matrix, it is further analyzed to extract the minimum value of all non-diagonal elements in the Pearson correlation coefficient matrix and the average value of the sum of the correlation coefficients of each feature with all other features. After analyzing the minimum value of all non-diagonal elements and the average value of the sum of the correlation coefficients of each feature with all other features, a minimum correlation coefficient index and a feature redundancy index are generated respectively, and the minimum correlation coefficient index and the feature redundancy index are input into a pre-trained machine learning model, and an overall correlation coefficient is generated by the machine learning model. The correlation of the input features is comprehensively evaluated by the overall correlation coefficient.
[0022] Preferably, the steps of extracting the minimum value of all non-diagonal elements in the Pearson correlation coefficient matrix, and analyzing the minimum values of all non-diagonal elements to generate the minimum correlation coefficient index are as follows:
[0023] Extract all off-diagonal elements from the Pearson correlation coefficient matrix to form a new set C, then: C = {R i,j |i≠j};
[0024] Sort the elements in set C in order, get the minimum value of the elements in set C, and record the minimum value of the element as m C ;
[0025] The average of the minimum values of all off-diagonal elements is calculated to calculate the average minimum Pearson correlation coefficient. The calculation expression is: |C| is the number of elements in set C, is the Pearson correlation coefficient between the ith and jth pair of features, is the minimum Pearson correlation coefficient mean;
[0026] The standard deviation of the minimum Pearson correlation coefficient is calculated to evaluate the dispersion of the minimum Pearson correlation coefficient. The calculation expression is: is the minimum Pearson correlation coefficient standard deviation;
[0027] Calculate the minimum correlation coefficient index. The expression for calculation is: Where mCCI τ represents the minimum correlation coefficient index, and k is the adjustment coefficient used to balance the influence of the minimum Pearson correlation coefficient mean and the minimum Pearson correlation coefficient standard deviation.
[0028] Preferably, the specific steps of extracting the average value of the sum of the Pearson correlation coefficients of each feature and all other features, and analyzing the average value of the sum of the Pearson correlation coefficients of each feature and all other features to generate the feature redundancy index are as follows:
[0029] For each feature x i , calculate the sum of its Pearson correlation coefficients with all other features, In the formula, S i is feature x i The sum of the Pearson correlation coefficients with all other features represents feature x i Redundancy;
[0030] Calculate the feature redundancy index, the calculation expression is: Where sFRI τ represents the feature redundancy index, w i Represents feature x i The weight is S i The exponential function is used to adjust the influence of feature redundancy. λ represents the adjustment parameter, which controls the weight function w i growth rate.
[0031] Preferably, the overall correlation coefficient generated after the correlation evaluation of the input features is compared and analyzed with a preset overall correlation coefficient reference threshold, and the entire input features are divided, specifically as follows:
[0032] If the overall correlation coefficient is greater than or equal to the overall correlation coefficient reference threshold, the entire input feature is divided into a high correlation data set;
[0033] If the overall correlation coefficient is less than the overall correlation coefficient reference threshold, the entire input feature is divided into a normal correlation data set.
[0034] Preferably, for a highly correlated data set, highly correlated feature pairs are identified, and the identification process is as follows:
[0035] The Pearson correlation coefficient generated between the two variables is compared and analyzed with the pre-set Pearson correlation coefficient reference threshold. If the Pearson correlation coefficient is greater than or equal to the Pearson correlation coefficient reference threshold, the feature pair is marked as high correlation. If the Pearson correlation coefficient is less than the Pearson correlation coefficient reference threshold, the feature pair is marked as normal correlation.
[0036] Preferably, for highly correlated feature pairs, a feature selection algorithm is used to reduce feature dimensions. The specific steps are as follows:
[0037] First, the high-correlation data set is standardized;
[0038] After standardization, the covariance matrix of the highly correlated data set is calculated. The covariance matrix reflects the linear relationship between features, that is, how the features vary together;
[0039] Perform PCA on the standardized high-correlation data set. PCA transforms the original features into a set of new, uncorrelated principal components through linear transformation.
[0040] According to the proportion of explained variance, the first few main principal components are selected as new features;
[0041] The selected main principal components are used as new features to construct a new data set.
[0042] Preferably, in the process of feature selection and dimensionality reduction, a number of overall correlation coefficients generated by comprehensive analysis of the input features are obtained in real time to establish an analysis set, and the overall correlation coefficient mean and the overall correlation coefficient standard deviation are calculated by analyzing the overall correlation coefficients in the set, and the overall correlation coefficient mean and the overall correlation coefficient standard deviation are compared and analyzed with a preset overall correlation coefficient reference threshold and a preset standard deviation reference threshold, respectively, to analyze the dimensionality reduction effect in real time;
[0043] If the overall correlation coefficient is satisfied and the overall correlation coefficient mean is less than the overall correlation coefficient reference threshold and the overall correlation coefficient standard deviation is less than the standard deviation reference threshold, a dimensionality reduction completion signal is generated and the dimensionality reduction operation is stopped;
[0044] If the overall correlation coefficient is not satisfied and the overall correlation coefficient mean is less than the overall correlation coefficient reference threshold and the overall correlation coefficient standard deviation is less than the standard deviation reference threshold, a dimensionality reduction completion signal is generated;
[0045] When the high correlation data set is transformed into a normal correlation data set, the transformed normal correlation data set is merged with the original normal correlation data set and used again for training the BP neural network.
[0046] The wine origin identification model training system based on BP neural network includes data collection and preprocessing module, correlation calculation module, correlation evaluation module, feature data set division module, feature selection and dimension reduction module, and dimension reduction effect analysis and model training module;
[0047] The data collection and preprocessing module collects a large amount of sample data, including various chemical and physical indicators that can reflect the characteristics of wines from different origins, and performs preliminary cleaning and preprocessing on the data to remove obvious errors and outliers;
[0048] A correlation calculation module evaluates the correlation between input features by calculating the Pearson correlation coefficient between each pair of features, and constructs a Pearson correlation coefficient matrix based on the calculated Pearson correlation coefficients;
[0049] The correlation evaluation module further analyzes the Pearson correlation coefficient matrix after obtaining it, and comprehensively evaluates the correlation of the input features;
[0050] The feature data set division module divides the entire input feature into a high correlation data set and a normal correlation data set according to the correlation evaluation results;
[0051] The feature selection and dimension reduction module is used directly for training BP neural network for normal correlation data sets. For high correlation data sets, highly correlated feature pairs are identified and feature selection algorithms are used to reduce feature dimensions.
[0052] The dimensionality reduction effect analysis and model training module analyzes the dimensionality reduction effect in real time during the process of feature selection and dimensionality reduction until the high-correlation data set is transformed into a normal-correlation data set, and then merges the transformed normal-correlation data set with the original normal-correlation data set and uses it again for BP neural network training.
[0053] In the above technical solution, the technical effects and advantages provided by the present invention are:
[0054] The present invention effectively solves the problem of multicollinearity caused by the high correlation between features by performing correlation evaluation and classification processing on the input features. Specifically, the Pearson correlation coefficient matrix is used to comprehensively evaluate the input features and calculate the overall correlation coefficient to ensure the reasonable division of the feature data set. Feature selection and dimensionality reduction processing (such as using PCA) are performed on the high-correlation data set, which is converted into a normal correlation data set and then merged for BP neural network training. This reduces the numerical instability caused by multicollinearity during the training process, reduces the risk of drastic fluctuations in weight updates, and promotes the effective decline of the loss function, thereby improving the stability and convergence of the model.
[0055] The present invention introduces feature selection algorithm and dimensionality reduction technology to make the model training process more efficient and controllable. After dimensionality reduction processing, the high-correlation data set can effectively reduce the feature dimension, reduce the complexity and calculation amount of the model, and optimize the training time and resource utilization. At the same time, the dimensionality reduction effect is analyzed in real time to ensure that the high-correlation data set is converted into a normal-correlation data set, further enhancing the independence of the feature data set, which not only improves the efficiency and effect of BP neural network training, but also improves the accuracy and generalization ability of the final model, achieving the goal of quickly and accurately identifying the origin of wine. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0057] Figure 1 The present invention is a flow chart of a method for training a wine origin identification model based on a BP neural network.
[0058] Figure 2 It is a module schematic diagram of the wine origin identification model training system based on BP neural network of the present invention. DETAILED DESCRIPTION
[0059] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of the present disclosure will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art.
[0060] The present invention provides Figure 1 The wine origin identification model training method based on BP neural network shown includes the following steps:
[0061] Collect a large amount of sample data, including various chemical and physical indicators that can reflect the characteristics of wines from different origins, and perform preliminary cleaning and preprocessing of the data to remove obvious errors and outliers;
[0062] Chemical and physical indicators include alcohol content, total acidity, volatile acidity, residual sugar, chloride, free sulfur dioxide, total sulfur dioxide, density, pH value, sulfate, potassium, color intensity, hue, total phenol content, anthocyanin content, antioxidant capacity, etc. By systematically collecting and recording these data, a complete training data set is formed to provide basic data support for model training.
[0063] After collecting a large amount of wine sample data, data cleaning is used to remove obvious errors and outliers to ensure data accuracy and consistency; preprocessing is used to convert data into a format and range suitable for model training, including normalization, standardization, and processing of missing values to improve the efficiency and effectiveness of model training. Through cleaning and preprocessing, the quality of input data can be ensured, thereby improving the stability of the model and the accuracy of prediction.
[0064] The correlation between input features is evaluated by calculating the Pearson correlation coefficient between each pair of features, and the Pearson correlation coefficient matrix is constructed based on the calculated Pearson correlation coefficients;
[0065] The specific steps for constructing the Pearson correlation coefficient matrix based on the calculated Pearson correlation coefficient are as follows:
[0066] Before calculating the Pearson correlation coefficient, the input features were standardized;
[0067] The purpose of standardization is to convert features of different scales to the same scale for easy comparison. A common method is to subtract the mean of each feature and divide it by its standard deviation.
[0068] The linear correlation between two variables is measured by the Pearson correlation coefficient, which is calculated as follows:
[0069]
[0070] , where r xy is the Pearson correlation coefficient between feature x and feature y, x i and i It is the sample value of two features. The sample value refers to the specific measurement value of each observation object (sample) for a certain feature in the data set. and are the means of all sample values of feature x and feature y, respectively. Correlation coefficient r xyThe value range is between -1 and 1, and n represents the total number of samples, that is, the number of observations (samples) in the data set;
[0071] When xy When it is close to 1, it means there is a strong positive correlation between feature x and feature y.
[0072] When xy When it is close to -1, it means there is a strong negative correlation between feature x and feature y.
[0073] When xy When it is close to 0, it means there is no obvious linear correlation between feature x and feature y.
[0074] Calculate the Pearson correlation coefficient between all feature pairs and store the results in a matrix to form the Pearson correlation coefficient matrix. The Pearson correlation coefficient matrix is a symmetric matrix in which the value of the i-th row and j-th column represents the feature x i and feature x j Pearson correlation coefficient between ;
[0075] The diagonal elements of the matrix are all 1 because each feature has a correlation of 1 with itself.
[0076] After obtaining the Pearson correlation coefficient matrix, further analysis is performed on it to comprehensively evaluate the correlation of the input features;
[0077] After obtaining the Pearson correlation coefficient matrix, further analysis is performed on it to extract the minimum value of all non-diagonal elements in the Pearson correlation coefficient matrix and the average value of the sum of the correlation coefficients of each feature with all other features. After analyzing the minimum value of all non-diagonal elements and the average value of the sum of the correlation coefficients of each feature with all other features, a minimum correlation coefficient index and a feature redundancy index are generated respectively. The minimum correlation coefficient index and the feature redundancy index are input into a pre-trained machine learning model, and the overall correlation coefficient is generated by the machine learning model. The correlation of the input features is comprehensively evaluated through the overall correlation coefficient.
[0078] When the minimum value of all off-diagonal elements in the Pearson correlation coefficient matrix is high, it means that the correlation between all feature pairs is high, indicating that the overall correlation of the input features is high. The details are as follows:
[0079] When calculating the Pearson correlation matrix, each element represents the correlation between a pair of features, and the diagonal elements are always 1 because each feature has a correlation of 1 with itself. By focusing on the minimum value of the off-diagonal elements, we can determine the lowest correlation between feature pairs. When this minimum value is high (for example, close to 1 or -1), it means that there is a strong linear relationship between even the weakest correlated feature pairs. Such a result indicates that the linear correlation between all feature pairs is strong, reflecting the high correlation of the entire input feature set.
[0080] Extract the minimum value of all off-diagonal elements in the Pearson correlation coefficient matrix. After analyzing the minimum values of all off-diagonal elements, the steps to generate the minimum correlation coefficient index are as follows:
[0081] Extract all non-diagonal elements (elements are Pearson correlation coefficients) from the Pearson correlation coefficient matrix to form a new set C, then: C = {R i,j |i≠j};
[0082] Sort the elements in set C in order, obtain the minimum value of the elements in set C (here refers to the minimum value of the Pearson correlation coefficient), and record the minimum value of the element as m C ;
[0083] The average of the minimum values of all off-diagonal elements is calculated to calculate the average minimum Pearson correlation coefficient. The calculation expression is: |C| is the number of elements in set C, is the Pearson correlation coefficient between the ith and jth pair of features, is the minimum Pearson correlation coefficient mean;
[0084] The standard deviation of the minimum Pearson correlation coefficient is calculated to evaluate the dispersion of the minimum Pearson correlation coefficient. The calculation expression is: is the minimum Pearson correlation coefficient standard deviation;
[0085] Calculate the minimum correlation coefficient index. The expression for calculation is: Where mCCI τ Represents the minimum correlation coefficient index, and k is the adjustment coefficient, which is used to balance the influence of the minimum Pearson correlation coefficient mean and the minimum Pearson correlation coefficient standard deviation, and is usually adjusted according to the specific application scenario.
[0086] It can be seen from the minimum correlation coefficient index that the larger the performance value of the minimum correlation coefficient index generated after analyzing the minimum values of all non-diagonal elements, the higher the overall correlation of the input features, and vice versa. The overall correlation of the input features is lower. Specifically, the minimum correlation coefficient index combines the average value of the minimum Pearson correlation coefficient and its discreteness (standard deviation). Therefore, when the minimum correlation coefficient index is large, it means that even the weakest correlation feature pairs have a strong linear relationship, which reflects the high correlation of the entire input feature set. Conversely, if the minimum correlation coefficient index is low, it means that the correlation between feature pairs is lower overall, and the independence between features is stronger.
[0087] When the average of the sum of the correlation coefficients of each feature with all other features is large, it means that the correlation between all feature pairs is high, which indicates that the overall correlation of the input features is high. The specific explanation is as follows:
[0088] After obtaining the correlation coefficient matrix, the overall correlation of the input features can be effectively evaluated by calculating the average of the sum of the correlation coefficients of each feature with all other features. If this average value is large, it means that the linear correlation between most features is strong. This is because a high average correlation coefficient value indicates that there is a significant correlation between feature pairs, which reflects the high redundancy of the overall feature set. In this case, the high correlation between features may lead to multicollinearity problems.
[0089] The specific steps of extracting the average value of the sum of the Pearson correlation coefficients of each feature and all other features and analyzing the average value of the sum of the Pearson correlation coefficients of each feature and all other features to generate the feature redundancy index are as follows:
[0090] For each feature x i , calculate the sum of its Pearson correlation coefficients with all other features, In the formula, S i is feature x i The sum of the Pearson correlation coefficients with all other features represents feature x i Redundancy;
[0091] Calculate the feature redundancy index, the calculation expression is: Where sFRI τ represents the feature redundancy index, w i Represents feature x i The weight is S i The exponential function is used to adjust the influence of feature redundancy. λ represents the adjustment parameter, which controls the weight function w iThe growth rate of the adjustment parameter λ is not specifically limited here and can be selected according to the actual situation;
[0092] The purpose of weight setting is to amplify the influence of highly correlated features so that the feature redundancy index can more sensitively reflect the redundancy of the overall feature set, thereby providing a stronger basis for evaluating and processing highly redundant features.
[0093] It can be seen from the feature redundancy index that the larger the performance value of the feature redundancy index generated after analyzing the average value of the sum of the Pearson correlation coefficients of each feature and all other features, the larger the sum of the Pearson correlation coefficients of each feature and all other features, that is, the higher the overall correlation between the input features; conversely, the smaller the performance value of the feature redundancy index, the lower the correlation between the features. The feature redundancy index can effectively reflect the overall correlation of the input feature set by comprehensively analyzing the correlation of each feature, which helps to identify and process highly redundant features, thereby optimizing the model training process.
[0094] The machine learning model is not specifically limited here, and can achieve the minimum correlation coefficient index mCCI τ and feature redundancy index sFRI τ Perform comprehensive analysis to generate the overall correlation coefficient Overall corr In order to realize the technical solution of the present invention, the present invention provides a specific implementation method;
[0095] Overall correlation coefficient corr The resulting calculation formula is:
[0096]
[0097] , where κ1 and κ2 are the minimum correlation coefficient index mCCI τ and feature redundancy index sFRI τ The preset proportional coefficient, and κ1 and κ2 are both greater than 0.
[0098] It can be seen from the overall correlation coefficient that the larger the performance value of the minimum correlation coefficient index generated after analyzing the minimum values of all non-diagonal elements, the larger the performance value of the feature redundancy index generated after analyzing the average value of the sum of the Pearson correlation coefficients of each feature and all other features, that is, the larger the performance value of the overall correlation coefficient generated between the input features, the higher the overall correlation generated between the input features, and vice versa.
[0099] According to the correlation evaluation results, the entire input features are divided into a high correlation data set and a normal correlation data set;
[0100] The overall correlation coefficient generated after the correlation evaluation of the input features is compared and analyzed with the preset overall correlation coefficient reference threshold, and the entire input features are divided as follows:
[0101] If the overall correlation coefficient is greater than or equal to the overall correlation coefficient reference threshold, the entire input feature is divided into a high correlation data set;
[0102] If the overall correlation coefficient is less than the overall correlation coefficient reference threshold, the entire input feature is divided into a normal correlation data set.
[0103] For normal correlation data sets, they are directly used for training BP neural networks. For high correlation data sets, highly correlated feature pairs are identified and feature selection algorithms (such as principal component analysis PCA) are used to reduce feature dimensions.
[0104] After evaluating and processing the feature correlation, the feature data sets with low correlation between features and no significant multicollinearity problems (i.e., normal correlation data sets) are directly input into the BP neural network model for training. Since these features have low correlation, the numerical stability during the training process is higher, and there will be no drastic fluctuations in the weight update process and difficulty in model convergence due to highly correlated features, which can effectively improve the training efficiency and prediction accuracy of the model.
[0105] For highly correlated data sets, highly correlated feature pairs are identified. The identification process is as follows:
[0106] The Pearson correlation coefficient generated between the two variables is compared and analyzed with the preset Pearson correlation coefficient reference threshold. If the Pearson correlation coefficient is greater than or equal to the Pearson correlation coefficient reference threshold, the feature pair is marked as high correlation. If the Pearson correlation coefficient is less than the Pearson correlation coefficient reference threshold, the feature pair is marked as normal correlation.
[0107] The feature pairs marked as highly correlated are screened out for the next step of feature dimension operation.
[0108] For highly correlated feature pairs, feature selection algorithms (such as principal component analysis PCA) are used to reduce feature dimensions. The specific steps are as follows:
[0109] First, the high-correlation data set is standardized;
[0110] The purpose of standardization is to convert all features to the same scale, usually by subtracting the mean of each feature and dividing it by its standard deviation. Standardization helps eliminate the dimensional differences of different features, allowing principal component analysis (PCA) to more fairly evaluate the importance and contribution of each feature.
[0111] After standardization, the covariance matrix of the highly correlated data set is calculated. The covariance matrix reflects the linear relationship between features, that is, how the features vary together;
[0112] Each element of the covariance matrix represents the covariance value between two features, which provides the basis for feature dimensionality reduction in the subsequent steps. By analyzing the covariance matrix, it is possible to determine which pairs of features are highly correlated and need to be reduced in dimension through PCA.
[0113] Perform PCA on the standardized high-correlation data set. PCA transforms the original features into a set of new, uncorrelated principal components through linear transformation.
[0114] These principal components are linear combinations of the original features, sorted from largest to smallest according to their ability to explain the variance of the data. The first few principal components are usually able to explain most of the variance of the data, so they can be used to replace the original high-dimensional feature set, thereby reducing the feature dimension.
[0115] According to the proportion of explained variance, the first few main principal components are selected as new features;
[0116] These principal components should be able to explain most of the variance of the data set, retain important information, and remove redundancy and noise. The selection criterion can be that the cumulative explained variance reaches a certain proportion (such as 90% or 95%) to ensure that the new feature set can effectively simplify the data structure and retain enough data information for model training.
[0117] Use the selected main principal components as new features to construct a new data set;
[0118] The feature dimension of this new data set has been significantly reduced while retaining most of the data information. This new data set is input into the BP neural network for training. Since the feature dimension is reduced and redundant information is removed, the training process will be more efficient and stable, ultimately improving the prediction accuracy and generalization ability of the model.
[0119] In the process of feature selection and dimensionality reduction, the dimensionality reduction effect is analyzed in real time until the high correlation data set is transformed into a normal correlation data set, and then the transformed normal correlation data set is merged with the original normal correlation data set and used again for BP neural network training;
[0120] In the process of feature selection and dimensionality reduction, a number of overall correlation coefficients generated by comprehensive analysis of input features are obtained in real time to establish an analysis set, and the overall correlation coefficient mean and the overall correlation coefficient standard deviation are calculated by analyzing the overall correlation coefficients in the set, and the overall correlation coefficient mean and the overall correlation coefficient standard deviation are compared and analyzed with the pre-set overall correlation coefficient reference threshold and the pre-set standard deviation reference threshold, respectively, to analyze the dimensionality reduction effect in real time;
[0121] If the overall correlation coefficient is satisfied and the overall correlation coefficient mean is less than the overall correlation coefficient reference threshold and the overall correlation coefficient standard deviation is less than the standard deviation reference threshold, a dimensionality reduction completion signal is generated and the dimensionality reduction operation is stopped;
[0122] If the overall correlation coefficient is calculated to find that the mean of the overall correlation coefficient is less than the reference threshold of the overall correlation coefficient and the standard deviation of the overall correlation coefficient is less than the reference threshold of the standard deviation, it means that the overall correlation coefficient in the data set is generally less than the reference threshold of the overall correlation coefficient, which means that the dimensionality reduction has a significant effect.
[0123] If the overall correlation coefficient is not satisfied and the overall correlation coefficient mean is less than the overall correlation coefficient reference threshold and the overall correlation coefficient standard deviation is less than the standard deviation reference threshold, a dimensionality reduction completion signal is generated;
[0124] If the overall correlation coefficient is satisfied and the calculated overall correlation coefficient mean is less than the overall correlation coefficient reference threshold and the overall correlation coefficient standard deviation is less than the standard deviation reference threshold, it means that the overall correlation coefficient in the data set is not generally less than the overall correlation coefficient reference threshold, which means that the dimensionality reduction has no obvious effect, then continue the dimensionality reduction operation.
[0125] When the high correlation data set is transformed into a normal correlation data set, the transformed normal correlation data set is merged with the original normal correlation data set and used again for training the BP neural network.
[0126] The present invention effectively solves the problem of multicollinearity caused by the high correlation between features by performing correlation evaluation and classification processing on the input features. Specifically, the Pearson correlation coefficient matrix is used to comprehensively evaluate the input features and calculate the overall correlation coefficient to ensure the reasonable division of the feature data set. Feature selection and dimensionality reduction processing (such as using PCA) are performed on the high-correlation data set, which is converted into a normal correlation data set and then merged for BP neural network training. This reduces the numerical instability caused by multicollinearity during the training process, reduces the risk of drastic fluctuations in weight updates, and promotes the effective decline of the loss function, thereby improving the stability and convergence of the model.
[0127] The present invention introduces feature selection algorithm and dimensionality reduction technology to make the model training process more efficient and controllable. After dimensionality reduction processing, the high-correlation data set can effectively reduce the feature dimension, reduce the complexity and calculation amount of the model, and optimize the training time and resource utilization. At the same time, the dimensionality reduction effect is analyzed in real time to ensure that the high-correlation data set is converted into a normal-correlation data set, further enhancing the independence of the feature data set, which not only improves the efficiency and effect of BP neural network training, but also improves the accuracy and generalization ability of the final model, achieving the goal of quickly and accurately identifying the origin of wine.
[0128] The present invention provides Figure 2 The wine origin identification model training system based on BP neural network shown includes a data collection and preprocessing module, a correlation calculation module, a correlation evaluation module, a feature data set division module, a feature selection and dimension reduction module, and a dimension reduction effect analysis and model training module;
[0129] The data collection and preprocessing module collects a large amount of sample data, including various chemical and physical indicators that can reflect the characteristics of wines from different origins, and performs preliminary cleaning and preprocessing on the data to remove obvious errors and outliers;
[0130] A correlation calculation module evaluates the correlation between input features by calculating the Pearson correlation coefficient between each pair of features, and constructs a Pearson correlation coefficient matrix based on the calculated Pearson correlation coefficients;
[0131] The correlation evaluation module further analyzes the Pearson correlation coefficient matrix after obtaining it, and comprehensively evaluates the correlation of the input features;
[0132] The feature data set division module divides the entire input feature into a high correlation data set and a normal correlation data set according to the correlation evaluation results;
[0133] The feature selection and dimension reduction module is used directly for training BP neural network for normal correlation data sets. For high correlation data sets, highly correlated feature pairs are identified and feature selection algorithms are used to reduce feature dimensions.
[0134] The dimension reduction effect analysis and model training module analyzes the dimension reduction effect in real time during the process of feature selection and dimension reduction until the high correlation data set is transformed into a normal correlation data set, and then merges the transformed normal correlation data set with the original normal correlation data set and uses it again for BP neural network training;
[0135] The wine origin identification model training method based on BP neural network provided in the embodiment of the present invention is implemented by the wine origin identification model training system based on BP neural network. The specific method and process of the wine origin identification model training system based on BP neural network are detailed in the embodiment of the wine origin identification model training method based on BP neural network, which will not be repeated here.
[0136] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.
[0137] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0138] The above description is only by way of illustration of certain exemplary embodiments of the present invention. It is undoubted that those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the above drawings and descriptions are illustrative in nature and should not be construed as limiting the scope of protection of the claims of the present invention.
Claims
1. A wine origin identification model training method based on BP neural network, characterized in that: The following steps are involved: Collect a large amount of sample data, including various chemical and physical indicators that can reflect the characteristics of wines from different origins, and perform preliminary cleaning and preprocessing of the data to remove obvious errors and outliers; The correlation between input features is evaluated by calculating the Pearson correlation coefficient between each pair of features, and a Pearson correlation coefficient matrix is constructed based on the calculated Pearson correlation coefficients; After obtaining the Pearson correlation coefficient matrix, further analysis is performed on it to comprehensively evaluate the correlation of the input features; According to the correlation evaluation results, the entire input features are divided into a high correlation data set and a normal correlation data set; For normal correlation data sets, they are directly used for training BP neural networks. For high correlation data sets, highly correlated feature pairs are identified and feature selection algorithms are used to reduce feature dimensions. In the process of feature selection and dimensionality reduction, the dimensionality reduction effect is analyzed in real time until the high correlation data set is transformed into a normal correlation data set, and then the transformed normal correlation data set is merged with the original normal correlation data set and used again for BP neural network training.
2. The wine origin identification model training method based on BP neural network according to claim 1 is characterized in that: The specific steps for constructing the Pearson correlation coefficient matrix based on the calculated Pearson correlation coefficient are as follows: Before calculating the Pearson correlation coefficient, the input features were standardized; The linear correlation between two variables is measured by the Pearson correlation coefficient, which is calculated as follows: , where r xy is the Pearson correlation coefficient between feature x and feature y, x i and i are the sample values of the two features. The sample value refers to the specific measurement value of a feature for each observation object in the data set. and are the means of all sample values of feature x and feature y, respectively. Correlation coefficient r xy The value range is between -1 and 1, and n represents the total number of samples, that is, the number of observations in the data set; Calculate the Pearson correlation coefficient between all feature pairs and store the results in a matrix to form the Pearson correlation coefficient matrix, which is a symmetric matrix.
3. The wine origin identification model training method based on BP neural network according to claim 1 is characterized in that: After obtaining the Pearson correlation coefficient matrix, further analysis is performed on it to extract the minimum value of all non-diagonal elements in the Pearson correlation coefficient matrix and the average value of the sum of the correlation coefficients of each feature with all other features. After analyzing the minimum value of all non-diagonal elements and the average value of the sum of the correlation coefficients of each feature with all other features, a minimum correlation coefficient index and a feature redundancy index are generated respectively. The minimum correlation coefficient index and the feature redundancy index are input into a pre-trained machine learning model, and the overall correlation coefficient is generated by the machine learning model. The correlation of the input features is comprehensively evaluated through the overall correlation coefficient.
4. The wine origin identification model training method based on BP neural network according to claim 3 is characterized in that: Extract the minimum value of all off-diagonal elements in the Pearson correlation coefficient matrix. After analyzing the minimum values of all off-diagonal elements, the steps to generate the minimum correlation coefficient index are as follows: Extract all off-diagonal elements from the Pearson correlation coefficient matrix to form a new set C, then: C = {R i,j |i≠j}; Sort the elements in set C in order, get the minimum value of the elements in set C, and record the minimum value of the element as m C ; The average of the minimum values of all off-diagonal elements is calculated to calculate the average minimum Pearson correlation coefficient. The calculation expression is: |C| is the number of elements in set C, is the Pearson correlation coefficient between the ith and jth pair of features, is the minimum Pearson correlation coefficient mean; The standard deviation of the minimum Pearson correlation coefficient is calculated to evaluate the dispersion of the minimum Pearson correlation coefficient. The calculation expression is: is the minimum Pearson correlation coefficient standard deviation; Calculate the minimum correlation coefficient index. The expression for calculation is: Where mCCI τ represents the minimum correlation coefficient index, and k is the adjustment coefficient used to balance the influence of the minimum Pearson correlation coefficient mean and the minimum Pearson correlation coefficient standard deviation.
5. The wine origin identification model training method based on BP neural network according to claim 4 is characterized in that: The specific steps of extracting the average value of the sum of the Pearson correlation coefficients of each feature and all other features and analyzing the average value of the sum of the Pearson correlation coefficients of each feature and all other features to generate the feature redundancy index are as follows: For each feature x i , calculate the sum of its Pearson correlation coefficients with all other features, In the formula, S i is feature x i The sum of the Pearson correlation coefficients with all other features represents feature x i Redundancy; Calculate the feature redundancy index, the calculation expression is: Where sFRI τ represents the feature redundancy index, w i Represents feature x i The weight is S i The exponential function is used to adjust the influence of feature redundancy. λ represents the adjustment parameter, which controls the weight function w i growth rate.
6. The wine origin identification model training method based on BP neural network according to claim 4 is characterized in that: The overall correlation coefficient generated after the correlation evaluation of the input features is compared and analyzed with the preset overall correlation coefficient reference threshold, and the entire input features are divided as follows: If the overall correlation coefficient is greater than or equal to the overall correlation coefficient reference threshold, the entire input feature is divided into a high correlation data set; If the overall correlation coefficient is less than the overall correlation coefficient reference threshold, the entire input feature is divided into a normal correlation data set.
7. The wine origin identification model training method based on BP neural network according to claim 2 is characterized in that: For highly correlated data sets, highly correlated feature pairs are identified. The identification process is as follows: The Pearson correlation coefficient generated between the two variables is compared and analyzed with the pre-set Pearson correlation coefficient reference threshold. If the Pearson correlation coefficient is greater than or equal to the Pearson correlation coefficient reference threshold, the feature pair is marked as high correlation. If the Pearson correlation coefficient is less than the Pearson correlation coefficient reference threshold, the feature pair is marked as normal correlation.
8. The wine origin identification model training method based on BP neural network according to claim 1 is characterized in that: For highly correlated feature pairs, a feature selection algorithm is used to reduce feature dimensions. The specific steps are as follows: First, the high-correlation data set is standardized; After standardization, the covariance matrix of the highly correlated data set is calculated. The covariance matrix reflects the linear relationship between features, that is, how the features vary together; Perform PCA on the standardized high-correlation data set. PCA transforms the original features into a set of new, uncorrelated principal components through linear transformation. According to the proportion of explained variance, the first few principal components are selected as new features; The selected principal components are used as new features to construct a new data set.
9. The wine origin identification model training method based on BP neural network according to claim 4 is characterized in that: In the process of feature selection and dimensionality reduction, a number of overall correlation coefficients generated by comprehensive analysis of input features are obtained in real time to establish an analysis set, and the overall correlation coefficient mean and the overall correlation coefficient standard deviation are calculated by analyzing the overall correlation coefficients in the set, and the overall correlation coefficient mean and the overall correlation coefficient standard deviation are compared and analyzed with the pre-set overall correlation coefficient reference threshold and the pre-set standard deviation reference threshold, respectively, to analyze the dimensionality reduction effect in real time; If the overall correlation coefficient is satisfied and the overall correlation coefficient mean is less than the overall correlation coefficient reference threshold and the overall correlation coefficient standard deviation is less than the standard deviation reference threshold, a dimensionality reduction completion signal is generated and the dimensionality reduction operation is stopped; If the overall correlation coefficient is not satisfied and the overall correlation coefficient mean is less than the overall correlation coefficient reference threshold and the overall correlation coefficient standard deviation is less than the standard deviation reference threshold, a dimensionality reduction completion signal is generated; When the high correlation data set is transformed into a normal correlation data set, the transformed normal correlation data set is merged with the original normal correlation data set and used again for training the BP neural network.
10. A wine origin identification model training system based on BP neural network, used to implement the wine origin identification model training method based on BP neural network as described in any one of claims 1 to 9, characterized in that: It includes data collection and preprocessing module, correlation calculation module, correlation evaluation module, feature data set partitioning module, feature selection and dimension reduction module, and dimension reduction effect analysis and model training module; The data collection and preprocessing module collects a large amount of sample data, including various chemical and physical indicators that can reflect the characteristics of wines from different origins, and performs preliminary cleaning and preprocessing on the data to remove obvious errors and outliers; A correlation calculation module evaluates the correlation between input features by calculating the Pearson correlation coefficient between each pair of features, and constructs a Pearson correlation coefficient matrix based on the calculated Pearson correlation coefficients; The correlation evaluation module further analyzes the Pearson correlation coefficient matrix after obtaining it, and comprehensively evaluates the correlation of the input features; The feature data set division module divides the entire input feature into a high correlation data set and a normal correlation data set according to the correlation evaluation results; The feature selection and dimension reduction module is used directly for training BP neural network for normal correlation data sets. For high correlation data sets, highly correlated feature pairs are identified and feature selection algorithms are used to reduce feature dimensions. The dimensionality reduction effect analysis and model training module analyzes the dimensionality reduction effect in real time during the process of feature selection and dimensionality reduction until the high-correlation data set is transformed into a normal-correlation data set, and then merges the transformed normal-correlation data set with the original normal-correlation data set and uses it again for BP neural network training.
Citation Information
Cited By
Drought monitoring method and system integrating multi-source remote sensing data
CN119848704A
Traditional Chinese medicinal material quality evaluation method and system based on data analysis
CN122412927A