Disclosure of Invention
In order to solve the defects of the technology, the invention provides a precise batching system for casting aluminum alloy.
In order to solve the technical problems, the technical scheme adopted by the invention is that the accurate batching system for casting aluminum alloy comprises a historical data collection module, a processing module and a processing module, wherein the historical data collection module is used for collecting historical data of aluminum alloy during casting, and the historical data comprises raw material component data, batching proportion and production environment parameters;
The historical data processing module is used for cleaning and normalizing the collected historical data to eliminate the influence of abnormal values, and the normalization processing formula is as follows:
Wherein x' is normalized data, x i is the value of the ith historical data, x max is the maximum value in the historical data, and x min is the minimum value in the historical data;
the feature selection module is used for selecting the feature with the largest influence on the quality of the aluminum alloy as the model input through correlation analysis and feature importance evaluation;
The model training module is used for training a prediction model of the batching proportion based on the convolutional neural network CNN;
The feedback control module is used for collecting raw material components and production environment parameters in real time, predicting the proportion of ingredients, forming an output instruction from a prediction result, and sending the output instruction to the execution control module;
and the execution control module is used for controlling the batching scale and the conveying equipment based on the PLC controller according to the output instruction, so as to realize weighing of the batching and automatic control alarm.
Further, the calculation formula of the correlation coefficient r in the correlation analysis is as follows:
Wherein x i is the value of the i-th history data; is the average of this historical data.
Further, the feature importance assessment method is to assess the importance of features based on a tree model, i.e. calculate the number of times each feature is used in the tree model or the importance of the feature used for splitting based on XGBoost model.
Further, evaluating feature importance based on XGBoost model, comprising the steps of:
step 1, constructing a data set according to historical data;
Step 2, dividing the data set into a feature variable and a target variable, and dividing the training set and the testing set;
initializing XGBoost models, and optimizing super parameters based on grid search;
Step 4, based on the five-fold cross verification technology, finding out the optimal super-parameters, and evaluating XGBoost the performance of the model according to the negative mean square error;
Step 5, acquiring contribution degrees of all the features, and sorting the contribution degrees in a descending order;
Step 6, sorting the names and the corresponding contribution of the features according to descending order, and storing;
and 7, evaluating the importance of the features according to the storage result.
Further, a regression loss function is calculated based on a mean square error MSE in a model training module, an Adam optimizer is used for updating model parameters, and the model parameters are adjusted through iterative training, so that the regression loss function is minimized;
The mean square error MSE is calculated as:
Where n is the number of samples, x i is the true ingredient ratio for the ith sample, and y i is the predicted ingredient ratio for the ith sample.
Further, the model training module performs prediction model optimization based on the Dropout layer after training the prediction model for preventing the prediction model from overfitting.
Further, the feedback control module comprises a temperature sensor for monitoring temperature change in the aluminum alloy smelting process;
the component analyzer is used for analyzing chemical components in the aluminum alloy raw materials, and the accuracy of the batching proportion is ensured by accurately measuring the content of various elements.
Further, the execution control module comprises a weight sensor which is used for being installed on the batching scale, collecting weight data of various raw materials in real time and ensuring batching accuracy.
The invention discloses an accurate batching system for casting aluminum alloy, which predicts batching proportion by a model training module, calculates regression loss function based on mean square error, minimizes regression loss function by iterative training, further ensures accuracy of the predicted batching proportion, reduces numerical deviation, improves high-quality casting productivity of aluminum alloy, realizes automatic batching and control by a feedback control module and an execution control module, and saves manpower.
Detailed Description
The invention will be described in further detail with reference to the drawings and the detailed description.
Embodiment one:
the accurate batching system for casting aluminum alloy as shown in fig. 1 and 2 comprises a historical data collection module, a batch mixing module and a batch mixing module, wherein the historical data collection module is used for collecting historical data of aluminum alloy casting, and the historical data comprises raw material composition data, a batching proportion and production environment parameters, wherein the production environment parameters comprise a production temperature and a cooling speed;
The historical data processing module is used for cleaning and normalizing the collected historical data to eliminate the influence of abnormal values, and the normalization processing formula is as follows:
Wherein x' is normalized data, x i is the value of the ith historical data, x max is the maximum value in the historical data, and x min is the minimum value in the historical data;
the normalization processing refers to processing that a column of data is changed into a certain fixed interval, and the data is mapped to a range of 0-1 for processing in order to be more convenient for processing the data;
The characteristic selection module is used for selecting the characteristic with the greatest influence on the quality of the aluminum alloy as the model input through correlation analysis and characteristic importance evaluation, wherein the correlation analysis aims at evaluating the relation strength between each characteristic and the quality of the aluminum alloy, and identifying the characteristic highly correlated with the quality index of the aluminum alloy by calculating the correlation coefficient between the characteristic and the quality index, wherein the value of the correlation coefficient is between-1 and 1, and the closer the value is 1 or-1, the stronger the correlation between the characteristic and the quality index of the aluminum alloy is represented;
the calculation formula of the correlation coefficient r in the correlation analysis is as follows:
Wherein x i is the value of the i-th history data; is an average of the historical data;
Feature importance assessment is to evaluate the influence degree of features on a target variable, namely the importance degree of the features in a model, calculate the importance based on the features of a tree model, calculate the number of times each feature is used in the tree model or the importance used for splitting based on XGBoost models, and measure the importance of the features. The more features are used in the XGBoot model to construct a decision tree therein, the higher the feature importance is, the attribute importance is obtained by computing and ordering each attribute in the dataset;
The feature importance assessment method is to assess the importance of the features based on a tree model, namely, calculate the number of times each feature is used in the tree model or the importance of the importance measurement features used for splitting based on XGBoost models;
Evaluating feature importance based on XGBoost model, comprising the steps of:
step 1, constructing a data set according to historical data;
Step 2, dividing the data set into a feature variable and a target variable, and dividing the training set and the testing set;
initializing XGBoost models, and optimizing super parameters based on grid search;
Step 4, based on the five-fold cross verification technology, finding out the optimal super-parameters, and evaluating XGBoost the performance of the model according to the negative mean square error;
Step 5, acquiring contribution degrees of all the features, and sorting the contribution degrees in a descending order;
Step 6, sorting the names and the corresponding contribution of the features according to descending order, and storing;
step 7, evaluating the importance of the features according to the storage result;
The model training module is used for training a prediction model of the batching proportion based on the convolutional neural network CNN;
Calculating a regression loss function based on a mean square error MSE in a model training module, using an Adam optimizer to update model parameters, and adjusting the model parameters through iterative training to minimize the regression loss function;
The mean square error MSE is calculated as:
Wherein n is the number of samples, x i is the true ingredient proportion of the ith sample, y i is the predicted ingredient proportion of the ith sample;
The model training module is used for carrying out prediction model optimization based on the Dropout layer after training the prediction model so as to prevent the prediction model from being fitted excessively;
The feedback control module is used for collecting raw material components and production environment parameters in real time, predicting the proportion of ingredients, forming an output instruction from a prediction result, and sending the output instruction to the execution control module;
The feedback control module comprises a temperature sensor for monitoring the temperature change in the aluminum alloy smelting process;
The component analyzer is used for analyzing chemical components in the aluminum alloy raw materials, and the accuracy of the batching proportion is ensured by accurately measuring the content of various elements;
the execution control module is used for controlling the batching scale and the conveying equipment based on the PLC controller according to the output instruction, so as to realize weighing of the batching and automatic control alarm;
the execution control module comprises a weight sensor and is used for being installed on a batching scale, acquiring weight data of various raw materials in real time and ensuring batching accuracy.
Embodiment two:
The convolutional neural network CNN is a deep learning model or a multi-layer perceptron similar to an artificial neural network, and comprises a data input layer, a convolutional layer, a pooling layer, a full-connection layer and an output layer, wherein a prediction model of the batching proportion is built based on the convolutional neural network CNN, and the model comprises the following structures:
The method comprises the steps of taking preprocessed raw material component data and production environment as input of a prediction model, extracting local features in the input data through a convolution layer through a convolution kernel, capturing spatial relation and mode in the data through a network, carrying out nonlinear transformation by the convolution layer after receiving an activation function, namely a ReLU function, so as to enhance the expression capability of the prediction model, effectively reducing the spatial dimension of the data through an average pooling layer in the pooling layer, carrying out global integration on the local features through a full-connection layer after the extraction of the convolution layer and the dimension reduction treatment of the pooling layer, generating a final batching proportion prediction result, namely multiplying the input feature vector by a weight matrix, adding a bias parameter, and outputting an accurate batching proportion, wherein the formula of the full-connection layer is as follows:
y=σ(ω*x+b);
wherein y is an output batching proportion vector, sigma is a ReLU activation function, x is an input vector, omega is a weight matrix, and b is a bias parameter.
According to the invention, the model training module is constructed, so that the proportioning proportion can be accurately predicted. This process involves a mean square error based calculation to derive a regression loss function. By constantly iterating the training, we strive to minimize this regression loss function to ensure that the predicted ingredient ratios are highly accurate. The method obviously reduces the numerical deviation, thereby improving the efficiency of high-quality casting production of the aluminum alloy.
In addition, the invention introduces a feedback control module and an execution control module, and the two modules work cooperatively, thereby realizing the automation of the batching process. By the mode, the proportion of ingredients can be accurately controlled, the production process can be monitored and adjusted in real time, and the stability and consistency of the production process are ensured. The automatic control system greatly saves human resources, reduces errors and uncertainty of manual operation, and further improves production efficiency and product quality.
The above embodiments are not intended to limit the present invention, and the present invention is not limited to the above examples, but is also intended to be limited to the following claims.