Ore element grade detection method based on linear regression combined with random configuration network
By combining linear regression and random configuration network algorithms in ore element grade detection, detection instability and local minimal problems in the prior art are solved, and high-precision and efficient ore element grade detection are achieved.
Patent Information
- Application Number
- CN202410878634.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-07-02
AI Technical Summary
The prior art has instability and local minimal problems in the detection of ore element grades, making it difficult to obtain high-precision results.
The detection method based on linear regression combined with random configuration network is adopted, and the initial grade estimate value is obtained through a one-element linear regression model, and the random configuration network algorithm model is used for correction and compensation, and the accurate detection results of ore element grade are finally obtained.
It improves the accuracy and stability of ore element grade detection, overcomes the slow convergence speed and local minimal problems of traditional BP neural networks, and is suitable for real-time and efficient detection at ore dressing sites.
Smart Images

Figure CN118782185B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ore detection, and more specifically, to an ore element grade detection method based on linear regression combined with a random configuration network. Background Art
[0002] my country is one of the world's largest producers of lead and zinc ore, with rich lead and zinc resource reserves and production, mainly distributed throughout the country, such as Yunnan, Guizhou, Xinjiang, Gansu and other regions. Lead and zinc are important non-ferrous metals and are widely used in industrial production. For example, lead is used in batteries, construction, metallurgy and other fields, and zinc is used in galvanizing, alloy manufacturing, chemical industry and other aspects.
[0003] Common XRF matrix correction methods used in mineral processing sites include empirical coefficient method and basic parameter method, and each of these methods has some disadvantages. The empirical coefficient method relies more on a large number of reliable standard samples, and its accuracy and precision are affected by the number of standard samples, sample preparation level, etc., which may lead to deviations in the analysis results. In addition, the empirical coefficient method may not accurately analyze new elements or unknown sample compositions. The basic parameter method requires a complex calibration process, including the selection of appropriate standard substances and the establishment of calibration curves, but the effect is often average for samples with severe mineral effects. Previous quantitative analysis methods often use one or two comprehensive methods for analysis, but with the development of artificial intelligence and the rapid progress of computer level, machine learning algorithms have gradually entered the stage of XRF quantitative analysis. Neural networks, with their powerful data mining and analysis capabilities, are used to learn data and realize tasks such as pattern recognition and nonlinear regression. The BP neural network based on gradient descent performs well in the prediction field. In the study of matrix effect correction, the BP neural network model can be combined to complete the quantitative analysis of the sample to be tested and predict the element content. Compared with traditional chemical analysis methods, it saves time and labor costs and has application value in industries with high timeliness requirements.
[0004] However, based on the research results of neural networks on matrix effect correction in the past few decades, there are still many problems to be solved. For example, instability may occur during the training and prediction process of the neural network. If more accurate results are to be obtained, a more in-depth study of the algorithm for optimizing the neural network is required. After obtaining the initial weights and thresholds, the general BP neural network will continue to adjust the weights and thresholds through the gradient descent method to minimize the value of the loss function. However, this method is prone to falling into a local optimal situation. Summary of the invention
[0005] In view of this, the object of the present invention is to provide a method for detecting ore element grade based on linear regression combined with a random configuration network to solve the problems existing in the prior art.
[0006] According to the present invention, a method for detecting the grade of ore elements based on linear regression combined with a random configuration network is provided. The method for detecting the grade of ore elements based on linear regression combined with a random configuration network comprises:
[0007] Inputting the acquired characteristic X-ray intensity value of the element to be measured in the ore into the trained univariate linear regression model to obtain an initial grade estimation value of the element to be measured;
[0008] Inputting the characteristic X-ray intensity value of the element to be measured and the characteristic X-ray intensity values of the m types of interfering elements selected into the trained random configuration network algorithm model to obtain a correction compensation value of the grade estimation value of the element to be measured;
[0009] The grade estimate of the element to be measured and the correction compensation value of the grade estimate of the element to be measured are added together, and the sum of the two outputs is the final grade estimate of the element to be measured, thereby obtaining the ore element grade detection result.
[0010] Preferably, when training and testing the univariate linear regression model and the random configuration network algorithm model, sample division is first performed, and the sample division includes:
[0011] For n ore samples, the characteristic X-ray intensity value of the element to be measured and the characteristic X-ray intensity values of m interfering elements are measured, and the true grade value of the element to be measured is measured;
[0012] The n ore samples are divided into a training set and a test set, the data corresponding to the first k ore samples are the training set, and the data corresponding to the last nk ore samples are the test set.
[0013] Preferably, after the sample division is completed, the univariate linear regression model is firstly trained and tested, and the training and testing of the univariate linear regression model includes:
[0014] Construct a univariate linear regression model, C i =aI i +b, where C i is the grade value of zinc element, I i is the characteristic X-ray intensity value of zinc element, a and b are the parameters to be estimated;
[0015] The characteristic X-ray intensity value of the element to be measured in the training set is used as the input of the univariate linear regression model, and the true grade value of the element to be measured is used as the expected output of the univariate linear regression model, and the least square method is used to identify the parameters a and b, so as to obtain a trained univariate linear regression model;
[0016] Based on the trained univariate linear regression model, nk test set samples are predicted, and the data corresponding to the nk test set samples are input into the trained univariate linear regression model to estimate the grade of the element to be tested in the ore, and the grade estimation values of the element to be tested in the nk test set samples and the error value between the true grade value of the element to be tested and the grade estimation value of the element to be tested obtained by the univariate linear regression model are obtained and recorded.
[0017] Preferably, after completing the training test of the univariate linear regression model, the random configuration network algorithm model is trained and tested;
[0018] When training the random configuration network algorithm model, a random configuration network algorithm model is established, the characteristic X-ray intensity value of the element to be measured and the characteristic X-ray intensity values of m interference elements in the training set are used as model inputs, and the error value between the true grade value of the element to be measured and the grade estimation value of the element to be measured obtained by the univariate linear regression model is used as the expected output of the model;
[0019] When testing the random configuration network algorithm model, based on the trained random configuration network algorithm model, the test set is input into the trained random configuration network algorithm model for regression prediction, and the correction compensation values of the estimated values of the grade of the element to be tested of nk test set samples in the random configuration network algorithm model are obtained and recorded.
[0020] Preferably, training the random configuration network algorithm model includes:
[0021] Step 1: Construct a random configuration network algorithm model, including an input layer with A nodes and an output layer with B nodes. The number of nodes in the hidden layer is incrementally constructed, and one node is added to the network each time learning, where A = m + 1 and B = 1.
[0022] Step 2: Normalize the sample data of the training set and the test set. The calculation formula is: X_norm = (X-min(X)) / (max(X)-min(X)). Normalize the characteristic X-ray intensity values of the element to be tested and the m interfering elements to the interval [0, 1]. Among them, X represents the original input value of each column of elements in N samples, min(X) represents the minimum value of the data of each column of elements, max(X) represents the maximum value of the data of each column of elements, and X_norm is the normalized value;
[0023] Step 3: Construct randomly assigned candidate hidden layer parameters, including input weight matrix W and bias matrix B:
[0024]
[0025] B=[b1,…bi ,…b k ] 1*k
[0026] In the above formula, d represents the dimension of the input variable, and k is the total number of random configurations of the hidden layer parameters;
[0027] Step 4: Assuming that the number of hidden layer nodes in the current network is L-1, calculate the residual of the current network:
[0028] e L-1 (X) = [e L-1 (X1),…,e L-1 (X N )]∈R N ;
[0029] In the above formula, X represents the training set sample. Assume that there are N groups, which are (X1,…,X N ), with X i For example, the input value matrix vector is 1×(m+1), m is the number of interference elements, 1 is the element to be tested, and the total vector set of N training sets is N×(m+1), and the values inside are the characteristic X-ray intensity values of the elements.
[0030] e L-1 It represents the difference between the grade estimation value of N groups of elements to be tested by the random configuration network algorithm model and the actual grade value of N groups of elements to be tested when the number of hidden layer nodes is L-1.
[0031] Step 5: Add a new candidate hidden layer node output according to the following formula:
[0032] h L (X) = [g L (w L T X1+b L ),g L (w L T X2+b L ),…,g L (w L T X N +b L )] T
[0033] In the above formula, h L (X) indicates that when the input variable is X, the hidden layer output value of a new node in the random configuration network algorithm model is calculated, w L Indicates adding a new node input weight, which is selected in the W matrix in step 3, x N represents N groups of input variables, b LIndicates the bias of a newly added node, selected from B in step 3, is the activation function, which is a nonlinear piecewise continuous function that satisfies the universal approximation ability theorem. We take the Sigmoid function, that is,
[0034]
[0035] Step 6: Screen the parameters of each hidden layer according to the supervision mechanism below and select the best candidate hidden layer single node.
[0036]
[0037] In the above formula, ξ L It represents a judgment value for a node added to the hidden layer in the random configuration network algorithm model, e L-11 (X), h L (X) has the meanings given in Step 4 and Step 5 respectively;
[0038] Step 7: Solve the output weight β between the hidden layer and the output layer using the least squares method:
[0039] In the formula, H L is the hidden layer output with L nodes, T is the expected output of the random configuration network algorithm model, β * is the objective function;
[0040] Step 8: When the random configuration network algorithm model construction meets the learning iteration stopping condition, the model training is completed, thereby obtaining a trained random configuration network algorithm model.
[0041] Preferably, the step three comprises:
[0042] The input weights and biases of the hidden layer are randomly assigned multiple times from the interval [-Υ, Υ], where Υ = {1, 3, 5, 10}, and there are a preset number of optional values, and the values that meet the conditions are selected from the optional values;
[0043] The step six comprises:
[0044] If L ≥0, then ξ L Saved in Z, the input weight w of this configuration k and bias b k Saved in Ω, after multiple random configurations, select ξ in Z from the above candidate hidden layer node pool L The maximum value of w L * and b L *As the best candidate hidden layer single node, it is added to the random configuration network algorithm model.
[0045] Preferably, the step seven comprises:
[0046] Using the output H of the network model L The minimization of the square difference between β and the training set sample label value T is used as the evaluation training error, that is, as the objective function. The solution that minimizes the objective function is the optimal solution, and the weight β is solved by minimizing the approximate square difference. The objective function is:
[0047]
[0048] In the formula, H L is the output matrix of the hidden layer, T is the expected output of the random configuration network algorithm model;
[0049] Using the least squares method, the optimal solution of the objective function can be derived through the knowledge of linear algebra and matrix theory:
[0050]
[0051] in, is the matrix H L The Moore-Penrose generalized inverse matrix of .
[0052] Preferably, the step eight comprises:
[0053] The stopping conditions for the random configuration network algorithm model training include the number of nodes in the current network hidden layer exceeding the set maximum number of nodes or the modulus of the residual of the current network||e L (X)|| is not greater than the given expected tolerance error ε;
[0054] If the network model reaches the stopping criterion, it indicates that the network model determined by the current parameters has reached the optimal value, and the randomly configured network model determined in this way can be directly used to estimate the grade of the elements to be tested in the test set samples.
[0055] Preferably, testing the configuration network algorithm model includes:
[0056] After obtaining the trained univariate linear regression model and the trained random configuration network algorithm model, the two are used together to form a detection model for the element to be detected. The effect evaluation of the detection model for the element to be detected includes:
[0057] The coefficient of determination R 2 And root mean square error are used as evaluation indicators. The formulas of the two indicators are:
[0058]
[0059] Among them, y i is the grade value of the element to be tested in the sample in the test set, is the grade prediction value of the element to be measured output by the detection model of the element to be measured, y m is the average grade value of the element to be tested of all test set samples, and N is the number of samples in the test set.
[0060] Preferably,
[0061] The ore is lead-zinc ore, the element to be measured is zinc, the m interfering elements are Si, Ca, Ti, Mn, Fe and Cu that coexist with the element Zn to be measured; and the true grade value is the grade value obtained by artificial assay method.
[0062] The ore element grade detection method based on linear regression combined with random configuration network provided by the embodiment of the present invention achieves the following beneficial technical effects:
[0063] 1. The linear regression model is introduced in combination with the random configuration network algorithm model to analyze the errors caused by the mutual influence of matrix elements. Compared with the traditional empirical analysis, the fitting results are more accurate, and compared with the basic parameter method, the instrument is more applicable to the mineral processing site environment;
[0064] 2. The application of this method in EDXRF can analyze the grade of zinc in the ore pulp in a more real-time, efficient and green manner, with high stability and efficiency;
[0065] 3. The random configuration network algorithm proposed in the present invention only outputs weights that need to be trained, and other weights are randomly configured within a given range. The entire training process does not require the gradient information of the network, which overcomes the slow convergence speed and local minimum problems of the traditional BP neural network based on gradient descent, and analyzes the mechanism of the physical process in which each element in the lead-zinc ore sample is excited to produce different X-ray fluorescence intensity values, and obtains a linear regression model for the linear known part, while the nonlinear model is a random configuration network algorithm driven by data, which compensates for the estimated result of the zinc grade in the lead-zinc ore. The method proposed in the present invention is based on linear regression combined with a random configuration network algorithm model, which is conducive to improving the detection accuracy of the zinc grade in the lead-zinc ore. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings.
[0067] Figure 1 It is a flowchart of the steps of a method for detecting ore element grade based on linear regression combined with a random configuration network provided by an exemplary embodiment of the present invention.
[0068] Figure 2It is a principle block diagram of an ore element grade detection method based on linear regression combined with a random configuration network provided by an exemplary embodiment of the present invention.
[0069] Figure 3 4 is a graph showing the maximum mutual information correlation coefficient results of six interference elements provided by an exemplary embodiment of the present invention.
[0070] Figure 4 This is a graph of zinc element grade training set prediction results provided by an exemplary embodiment of the present invention.
[0071] Figure 5 It is a graph of prediction results of a zinc element grade test set provided by an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0072] Below, the exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments of the present invention, and it should be understood that the present invention is not limited to the exemplary embodiments described here.
[0073] It should be noted that the relative arrangement of components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
[0074] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present invention are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.
[0075] It should also be understood that, in the embodiments of the present invention, “plurality” may refer to two or more than two, and “at least one” may refer to one, two or more than two.
[0076] It should also be understood that any component, data or structure mentioned in the embodiments of the present invention can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0077] In addition, the term "and / or" in the present invention is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects before and after are in an "or" relationship.
[0078] It should also be understood that the description of the various embodiments of the present invention focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.
[0079] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0080] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
[0081] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.
[0082] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0083] Embodiments of the present invention can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.
[0084] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment, where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.
[0085] like Figure 1-5As shown, the present invention provides an ore element grade detection method based on linear regression combined with random configuration network. In the ore element grade detection method based on linear regression combined with random configuration network, the linear model is constructed by analyzing the mechanism of the physical process that each element in the lead-zinc ore sample is excited to produce different X-fluorescence ray intensity values, and the use of the random configuration network algorithm effectively overcomes the problems of being easily trapped in the local optimum, slow convergence speed, network structure often determined by experience, overfitting, etc. in the traditional BP neural network training process based on gradient descent, and is a compensation for the zinc element grade estimation result in the lead-zinc ore obtained by the univariate linear regression model, which greatly improves the detection accuracy and meets the on-site production requirements.
[0086] The lead-zinc ore samples collected from the site are passed through an X-ray fluorescence analyzer to obtain the characteristic X-ray intensity values of zinc and several other matrix elements, and are sent to the laboratory to obtain the true grade value of zinc through manual testing. The linear model uses the traditional univariate linear regression of the target element, with the characteristic X-ray intensity value of zinc as the input variable and the zinc grade of manual testing as the expected output variable. After model training, the estimated grade value of zinc in the lead-zinc ore of the linear regression model is obtained. The several interfering elements with the greatest impact on zinc are screened out by the feature selection method, and are used together with zinc as the input variables of the random configuration network algorithm. The difference between the zinc grade value of manual testing and the output of the linear regression model is used as the expected output variable. After model training, the estimated grade value of zinc in the lead-zinc ore of the random configuration network algorithm is obtained. The output values of the linear regression model and the random configuration network algorithm model are added to obtain the final estimated grade value of zinc in the lead-zinc ore.
[0087] The following is a more detailed introduction to the ore element grade detection method based on linear regression combined with random configuration network, which can be referred to as the following steps S01)-S03).
[0088] S01), inputting the acquired characteristic X-ray intensity value of the element to be measured in the ore into the trained univariate linear regression model to obtain the initial grade estimation value of the element to be measured;
[0089] In this step, the training and testing of the univariate linear regression model includes the following steps:
[0090] S011), when training and testing the univariate linear regression model and the random configuration network algorithm model, firstly perform sample division, and the sample division includes:
[0091] S0111), for n ore samples, the characteristic X-ray intensity value of the element to be measured and the characteristic X-ray intensity values of m interfering elements are measured, and the true grade value of the element to be measured is measured;
[0092] Specifically, in this embodiment, the ore is lead-zinc ore, the element to be measured is zinc, the m interfering elements are Si, Ca, Ti, Mn, Fe and Cu that coexist with the element Zn to be measured, and the true grade value is the grade value obtained by laboratory artificial analysis method.
[0093] For n lead-zinc ore samples, the characteristic X-ray intensity values of zinc and the characteristic X-ray intensity values of interfering elements that affect zinc, as well as the true grade value of zinc measured by manual assay, were measured. In order to eliminate redundant input variables, the m interfering elements that have the greatest impact on zinc were screened out through feature selection methods.
[0094] In this embodiment, a total of 60 lead-zinc ore samples were collected on site, and the characteristic X-ray intensity values of the element Zn to be measured in each sample were measured by XRF fluorescence spectrum analysis software. The actual lead-zinc ore sample has many types of constituent elements, and the characteristic X-ray intensity values of the element to be measured on the spectrum graph not only depend on the content of the element to be measured, but also on the characteristic X-ray intensity values of other elements in the sample in many cases, which is mainly manifested as the absorption enhancement effect between the elements. Therefore, directly using the characteristic X-ray intensity values of the element to be measured as the input of the zinc element grade estimation model will produce a large error in the detection result. The constituent elements other than the element to be measured in the sample are called coexisting elements, so the characteristic X-ray intensity values of both the coexisting elements and the element to be measured should also be considered, and together as unknown nonlinear influence items, the matrix effect is corrected using a nonlinear random configuration network algorithm model.
[0095] The characteristic X-ray intensity values of the six interfering elements Si, Ca, Ti, Mn, Fe and Cu that coexist with the element Zn to be measured are used to determine the grade of the Zn element through the laboratory manual test method, and the average value of multiple tests is taken as the true grade value of the Zn element. The feature selection method based on the maximum mutual information coefficient is used to screen out the best feature. It is calculated that the maximum mutual information value of the Fe element among the six interfering elements is the smallest. It can be considered that the correlation between the characteristic X-ray intensity value of the Fe element in the characteristic input variable and the output variable Zn element grade is the smallest, so the input variable Fe element with low correlation is removed, achieving the effect of reducing the dimension of the characteristic input variable and eliminating redundant features.
[0096] S0112) Divide the n ore samples into a training set and a test set, the data corresponding to the first k ore samples are the training set, and the data corresponding to the last nk ore samples are the test set, wherein k>nk, n and k are both positive integers greater than 1.
[0097] In this embodiment, 60 lead-zinc ore samples are randomly divided into a training set and a test set, wherein the data corresponding to the first 50 lead-zinc ore samples are used as the training set, and the data corresponding to the last 10 lead-zinc ore samples are used as the test set.
[0098] The data corresponding to the ore sample here are the characteristic X-ray intensity values of the element to be measured and the characteristic X-ray intensity values of m interfering elements, as well as the true grade value of the element to be measured.
[0099] S012), after the sample division is completed, firstly, the univariate linear regression model is trained and tested, and the training and testing of the univariate linear regression model includes:
[0100] S0121), build a univariate linear regression model, C i =aI i +b, where C i is the grade value of zinc element, I i is the characteristic X-ray intensity value of zinc element, a and b are the parameters to be estimated;
[0101] Specifically, the mechanism analysis is carried out based on the physical process that each element in the lead-zinc ore sample is excited to produce different X-ray fluorescence intensity values, so as to obtain the linear known part. The relationship between the content value of the element to be measured in the sample and the characteristic X-ray intensity produced by the excitation is: C i =K i I i M i S i , where C i is the content of the element i to be measured (Zn in this invention), K i is the instrument correction factor, I i M is the intensity of the characteristic X-ray of the element to be measured under the same instrument conditions. i is the correction factor for the matrix effect between elements (mainly manifested as absorption enhancement effect), S i It is the correction factor of the physical and chemical forms between the sample and the standard sample containing the element to be measured. When converting the characteristic X-ray intensity and element content, the most ideal condition is that there is no error caused by the matrix effect. There is a linear relationship between the characteristic X-ray intensity value of the element to be measured and the content of the element to be measured. The direct calibration curve method can be used. The content of the unknown sample to be measured is obtained from the calibration curve according to the calculated characteristic X-ray intensity value. The general expression of the calibration curve is: C i =aI i +b, where a and b are the parameters to be estimated, and the least squares method is used for identification.
[0102] S0122), using the characteristic X-ray intensity value of the element to be measured in the training set as the input of the univariate linear regression model, and the true grade value of the element to be measured as the expected output of the univariate linear regression model, and using the least squares method to identify parameters a and b, thereby obtaining a trained univariate linear regression model;
[0103] In this embodiment, the characteristic X-ray intensity value of the Zn element is used as the input of the linear regression model, and the Zn element grade obtained by the manual analysis method is used as the expected output of the linear regression model. According to the data corresponding to 50 training sets, the least squares method is used to identify the parameters a and b.
[0104] S0123), based on the trained univariate linear regression model, predict nk test set samples, input the data corresponding to the nk test set samples into the trained univariate linear regression model to estimate the grade of the element to be tested in the ore, obtain and record the grade estimation values of the element to be tested in the nk test set samples, and the error value between the actual grade value of the element to be tested and the grade estimation value of the element to be tested obtained by the univariate linear regression model.
[0105] In this embodiment, based on the trained univariate linear regression model, the data corresponding to the last 10 lead-zinc ore samples are input into the model as a test set to estimate the zinc grade of the lead-zinc ore, and the estimated Zn grade values in the 10 test set samples in the linear regression model are obtained and recorded, as well as the difference between the actual Zn grade value measured by the manual assay method and the estimated Zn grade value.
[0106] S02), inputting the characteristic X-ray intensity value of the element to be measured and the characteristic X-ray intensity values of the m types of interfering elements screened out into the trained random configuration network algorithm model to obtain a correction compensation value of the grade estimation value of the element to be measured;
[0107] In this step, with respect to the random configuration network algorithm model, after completing the training test of the univariate linear regression model, the random configuration network algorithm model is trained and tested;
[0108] When training the random configuration network algorithm model, a random configuration network algorithm model is established, the characteristic X-ray intensity value of the element to be measured and the characteristic X-ray intensity values of m interfering elements in the training set are used as model inputs, and the error value between the true grade value of the element to be measured and the grade estimation value of the element to be measured obtained by the univariate linear regression model is used as the expected output of the model; specifically, a random configuration network algorithm model is established, in which the data corresponding to the first 50 lead-zinc ore samples are used as the training set, the characteristic X-ray intensity value of the Zn element and the characteristic X-ray intensity values of the five interfering elements corresponding to the Zn element are used as model inputs, and the error value between the Zn element grade estimation value obtained by the univariate linear regression model and the Zn element grade value measured by the manual assay method is used as the expected output of the model.
[0109] When testing the random configuration network algorithm model, based on the trained random configuration network algorithm model, the test set is input into the trained random configuration network algorithm model for regression prediction, and the correction compensation values of the estimated values of the grade of the element to be tested of nk test set samples in the random configuration network algorithm model are obtained and recorded.
[0110] This will be explained in more detail below.
[0111] Training the random configuration network algorithm model includes:
[0112] Step 1: Construct a random configuration network algorithm model, including an input layer with A nodes and an output layer with B nodes. The number of nodes in the hidden layer is incrementally constructed, and one node is added to the network each time learning, where A = m + 1 and B = 1.
[0113] Specifically, the random configuration network algorithm is an advanced incremental random learning technology. Compared with the BP neural network algorithm based on gradient descent, we randomly assign the input weights and biases of the hidden layer nodes within a certain range, and the output weights are calculated using the least squares method. The random configuration network algorithm is constructed in MATLAB software, including an input layer with a node number A and an output layer with a node number B. The number of hidden layer nodes is constructed incrementally, and one node is added to the network each time learning. Among them, since there is 1 element to be measured and 5 interference elements, the input layer is generated as one layer, so the number of nodes in the input layer is A=6; the output layer is one layer, which is the difference between the Zn element grade estimate obtained by the linear regression model and the Zn element grade measured by the manual assay method. There is only Zn element grade data, so the number of nodes in the output layer is B=1.
[0114] Step 2: Normalize the sample data of the training set and the test set. The calculation formula is: X_norm = (X-min(X)) / (max(X)-min(X)). Normalize the characteristic X-ray intensity values of the element to be tested and the m interfering elements to the interval [0, 1]. Among them, X represents the original input value of each column of elements in N samples, min(X) represents the minimum value of the data of each column of elements, max(X) represents the maximum value of the data of each column of elements, and X_norm is the normalized value;
[0115] In this embodiment, the six characteristic variable data are normalized to the interval [0, 1], and the normalization formula is: X_norm = (X-min(X)) / (max(X)-min(X)).
[0116] Given a training input data set X = {X1,…,X i ,…X N}, X i ={xi1 ,x i2 ,…x id} T , the output data set is T = {t1, t2, …t N}, set the maximum number of nodes in the hidden layer L max is 250, the expected tolerance error ε is 0.01, and the maximum number of random configurations is T max is 10, select a set of positive numbers Υ = {1,3,5,10}. The initial model residual e0 = [t1,t2,…t N ] T , 0<r<1, set two empty sets as Ω and Z. Wherein N refers to the number of training set samples collected in the present invention, which is 50, and d refers to the number of feature input variables in the present invention, which is 6.
[0117] Step 3: Construct randomly assigned candidate hidden layer parameters, including input weight matrix W and bias matrix B:
[0118]
[0119] B=[b1,…b i ,…b k ] 1*k
[0120] In the above formula, d represents the dimension of the input variable, k represents the total number of times the hidden layer parameters are randomly configured, and in this embodiment, the total number is 10 times;
[0121] In this step, the input weights and biases of the hidden layer are randomly assigned 10 times from the interval [-Υ, Υ], where Υ = {1, 3, 5, 10}, and there are a preset number of optional values, and the values that meet the conditions are selected from the optional values;
[0122] Step 4: Assuming that the number of hidden layer nodes in the current network is L-1, calculate the residual of the current network:
[0123] e L-1 (X) = [e L-1 (X1),…,e L-1 (X N )]∈R N ;
[0124] In the above formula, X represents the training set sample. Assume that there are N groups, which are (X1,…,X N ), with X i For example, the input value matrix vector is 1×(m+1), m is the number of interference elements, 1 is the element to be tested, and the total vector set of N training sets is N×(m+1), and the values inside are the characteristic X-ray intensity values of the elements.
[0125] e L-1It represents the difference between the grade estimation value of N groups of elements to be tested by the random configuration network algorithm model and the actual grade value of N groups of elements to be tested when the number of hidden layer nodes is L-1.
[0126] Step 5: Add a new candidate hidden layer node output according to the following formula:
[0127] h L (X) = [g L (w L T X1+b L ),g L (w L T X2+b L ),…,g L (w L T X N +b L )] T
[0128] In the above formula, h L (X) indicates that when the input variable is X, the hidden layer output value of a new node (the number of hidden layer nodes increases from L-1 to L) added to the random configuration network algorithm model is calculated. L () is the activation function, with corresponding instructions, w L Indicates the input weight of adding a new node, which is selected in the W matrix in step 3. The hidden layer is directly connected to the input layer because the number of variables in the input layer is d, that is, the dimension. Therefore, there are d lines connecting the newly added node to the input layer, and each line has a random parameter value, which is represented as a column vector value in W, such as [w 11 ,…,w d1 ], the upper right subscript T represents the matrix transpose, X1 is the first set of input variables, the number is d. As mentioned above, the matrix vector is 1×(m+1), m+1 is d, so w L T X1 represents the corresponding multiplication of the values in the two vectors, such as w 11 ×(the first variable value of X1), b L Indicates the bias of adding a new node. Select B from step 3 and start from b1. Assuming there are K candidate nodes, we start from the first node and calculate h in sequence. L There are K values of (X), among which w L Select from W to the right, b L Select from B to the right, is the activation function, which is a nonlinear piecewise continuous function that satisfies the universal approximation ability theorem. We take the Sigmoid function, that is, Replace w in the original formula L T X1+b L Just substitute x.
[0129] Step 6: Screen the parameters of each hidden layer according to the supervision mechanism below and select the best candidate hidden layer single node.
[0130]
[0131] In the above formula, e L-1 (X), h L (X) Refer to the previous steps for its meaning. The superscript T is the transpose operation of the matrix. r is a value less than 1. In the MATLAB code, it is represented by the following interval [0.9, 0.99, 0.999, 0.9999]. Select from the first value. If it does not meet the conditions, select the second one, and so on.
[0132] ξ L It means to judge a node added to the hidden layer of the randomly configured neural network (the number of hidden layer nodes ranges from L-1 to L). If ξ L If ξ is greater than or equal to 0, then it is retained and becomes a candidate node. L If it is less than 0, it is discarded. Finally, find ξ from the candidate nodes L The node with the maximum value is finally added to the network.
[0133] In this step, if ξ L ≥0, then ξ L Saved in Z, the input weight w of this configuration k and bias b k Saved in Ω, after multiple random configurations, select ξ in Z from the above candidate hidden layer node pool L The maximum value of w L * and b L * As the best candidate hidden layer single node, add it to the random configuration network algorithm model, and calculate the hidden layer output of the network with L hidden layer nodes: H L =[h1 * ,h2 * ,…h L * ];
[0134] After the above steps, the input weights and biases of the hidden layer are determined and added to the network.
[0135] According to the supervision mechanism of the random configuration network algorithm, the hidden layer parameters of each training set are screened respectively to obtain multiple hidden layer parameters that meet the supervision mechanism and build a candidate hidden layer node pool.
[0136] Step 7: Solve the output weight β between the hidden layer and the output layer using the least squares method:
[0137] In the formula, H L is the hidden layer output with L nodes, and T is the expected output of the random configuration network algorithm model;
[0138] In this step, in the second stage of random configuration network algorithm learning, we only need to solve the output weight β between the hidden layer and the output layer. In order to obtain the output weight β with good effect on the training sample set, it is necessary to ensure that its training error is minimized. The output H of the network model can be used. L The square difference between β and the expected output T of the random configuration network algorithm model is minimized as the evaluation training error, that is, as the objective function. The solution that minimizes the objective function is the optimal solution, and the weight β is solved by minimizing the approximate square difference. The objective function is:
[0139]
[0140] In the formula, H L is the output matrix of the hidden layer, T is the expected output of the random configuration network algorithm model, which can also be understood as the difference between the grade estimate of the element to be measured obtained by the linear regression model and the actual grade value of the element to be measured;
[0141] Using the least squares method, the optimal solution of the objective function can be derived through the knowledge of linear algebra and matrix theory:
[0142]
[0143] in, is the matrix H L The Moore-Penrose generalized inverse matrix of .
[0144] After the above steps, the iterative process of this learning is completed, and the hidden layer of the randomly configured network adds an optimal node that satisfies the supervision mechanism.
[0145] Step 8: When the random configuration network algorithm model construction meets the learning iteration stopping condition, the model training is completed, thereby obtaining a trained random configuration network algorithm model.
[0146] In this step, the stopping conditions of the random configuration network algorithm model training include the number of nodes in the current network hidden layer exceeding the set maximum number of nodes or the residual model of the current network.
[0147] ||e L (X)|| is not greater than the given expected tolerance error ε; that is, then calculate the residual of the current network: e L (X) = e L-1 (X)-H L β * , if e L (X)≤ε, no hidden layer nodes are added and the model construction is completed.
[0148] If the network model reaches the stopping criterion, it indicates that the network model determined by the current parameters has reached the optimal value, and the randomly configured network model determined in this way can be directly used to estimate the grade of the elements to be tested in the test set samples.
[0149] On the contrary, if e L (X)>ε, repeat the above steps and add a hidden layer node until the residual of the network model is less than the initial setting. At this point, the training of the random configuration network algorithm model has been completed.
[0150] Furthermore, testing the configuration network algorithm model includes:
[0151] After obtaining the trained univariate linear regression model and the trained random configuration network algorithm model, the two are used together to form a detection model for the element to be detected. The effect evaluation of the detection model for the element to be detected includes:
[0152] The coefficient of determination R 2 And root mean square error are used as evaluation indicators. The formulas of the two indicators are:
[0153]
[0154] Among them, y i is the grade value of the element to be tested in the sample in the test set, is the grade prediction value of the element to be measured output by the detection model of the element to be measured, y m is the average grade value of the element to be tested of all test set samples, and N is the number of samples in the test set.
[0155] S03), adding the grade estimation value of the element to be measured and the correction compensation value of the grade estimation value of the element to be measured, and outputting the sum of the two as the final grade estimation value of the element to be measured, thereby obtaining the ore element grade detection result.
[0156] Compared with the prior art, the advantages of the present invention are:
[0157] 1. The linear regression model is introduced in combination with the random configuration network algorithm model to analyze the errors caused by the mutual influence of matrix elements. Compared with the traditional empirical analysis, the fitting results are more accurate, and compared with the basic parameter method, the instrument is more applicable to the mineral processing site environment;
[0158] 2. The application of this method in EDXRF can analyze the grade of zinc in the ore pulp in a more real-time, efficient and green manner, with high stability and efficiency;
[0159] 3. The random configuration network algorithm proposed in the present invention only outputs weights that need to be trained, and other weights are randomly configured within a given range. The entire training process does not require the gradient information of the network, which overcomes the slow convergence speed and local minimum problems of the traditional BP neural network based on gradient descent, and analyzes the mechanism of the physical process in which each element in the lead-zinc ore sample is excited to produce different X-ray fluorescence intensity values, and obtains a linear regression model for the linear known part, while the nonlinear model is a random configuration network algorithm driven by data, which compensates for the estimated result of the zinc grade in the lead-zinc ore. The method proposed in the present invention is based on linear regression combined with a random configuration network algorithm model, which is conducive to improving the detection accuracy of the zinc grade in the lead-zinc ore.
[0160] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0161] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0162] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0163] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
[0164] It should also be noted that in the apparatus, equipment and method of the present disclosure, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present disclosure. The above description of the disclosed aspects is provided to enable any technician in the field to make or use the present disclosure. Various modifications to these aspects are very obvious to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown here, but to the widest scope consistent with the principles and novel features disclosed herein.
[0165] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A method for detecting ore element grade based on linear regression combined with random configuration network, characterized in that: include: Inputting the acquired characteristic X-ray intensity value of the element to be measured in the ore into the trained univariate linear regression model to obtain an initial grade estimation value of the element to be measured; Inputting the characteristic X-ray intensity value of the element to be measured and the characteristic X-ray intensity values of the m types of interfering elements selected into the trained random configuration network algorithm model to obtain a correction compensation value of the grade estimation value of the element to be measured; The grade estimation value of the element to be measured and the correction compensation value of the grade estimation value of the element to be measured are added, and the sum of the two outputs is the final grade estimation value of the element to be measured, thereby obtaining the ore element grade detection result; When training and testing the univariate linear regression model and the random configuration network algorithm model, sample division is first performed, and the sample division includes: For n ore samples, the characteristic X-ray intensity value of the element to be measured and the characteristic X-ray intensity values of m interfering elements are measured, and the true grade value of the element to be measured is measured; The n ore samples are divided into a training set and a test set, where the data corresponding to the first k ore samples are the training set, and the data corresponding to the last nk ore samples are the test set; After the sample division is completed, the univariate linear regression model is firstly trained and tested. The training and testing of the univariate linear regression model includes: Construct a univariate linear regression model, C i =aI i +b, where C i is the grade value of zinc element, I i is the characteristic X-ray intensity value of zinc element, a and b are the parameters to be estimated; The characteristic X-ray intensity value of the element to be measured in the training set is used as the input of the univariate linear regression model, and the true grade value of the element to be measured is used as the expected output of the univariate linear regression model, and the least square method is used to identify the parameters a and b, so as to obtain a trained univariate linear regression model; Based on the trained univariate linear regression model, nk test set samples are predicted, and the data corresponding to the nk test set samples are input into the trained univariate linear regression model to estimate the grade of the element to be measured in the ore, and the grade estimation values of the element to be measured in the nk test set samples and the error value between the true grade value of the element to be measured and the grade estimation value of the element to be measured obtained by the univariate linear regression model are obtained and recorded; After completing the training and testing of the univariate linear regression model, training and testing the random configuration network algorithm model; When training the random configuration network algorithm model, a random configuration network algorithm model is established, the characteristic X-ray intensity value of the element to be measured and the characteristic X-ray intensity values of m interference elements in the training set are used as model inputs, and the error value between the true grade value of the element to be measured and the grade estimation value of the element to be measured obtained by the univariate linear regression model is used as the expected output of the model; When testing the random configuration network algorithm model, based on the trained random configuration network algorithm model, the test set is input into the trained random configuration network algorithm model for regression prediction, and the correction compensation values of the estimated values of the grade of the element to be tested of nk test set samples in the random configuration network algorithm model are obtained and recorded.
2. The method for detecting ore element grade based on linear regression combined with random configuration network according to claim 1 is characterized in that: Training the random configuration network algorithm model includes: Step 1: Construct a random configuration network algorithm model, including an input layer with A nodes and an output layer with B nodes. The number of nodes in the hidden layer is incrementally constructed, and one node is added to the network each time learning, where A = m + 1 and B = 1. Step 2: Normalize the sample data of the training set and the test set. The calculation formula is: X_norm = (X-min(X)) / (max(X)-min(X)). Normalize the characteristic X-ray intensity values of the element to be tested and the m interfering elements to the interval [0, 1]. Among them, X represents the original input value of each column of elements in N samples, min(X) represents the minimum value of the data of each column of elements, max(X) represents the maximum value of the data of each column of elements, and X_norm is the normalized value; Step 3: Construct randomly assigned candidate hidden layer parameters, including input weight matrix W and bias matrix B: B=[b1,…b i ,…b k ] 1*k In the above formula, d represents the dimension of the input variable, and k is the total number of random configurations of the hidden layer parameters; Step 4: Assuming that the number of hidden layer nodes in the current network is L-1, calculate the residual of the current network: And L-1 (X)=[and L-1 (X1),…,and L-1 (X N )]∈R N ; In the above formula, X represents the training set sample. Assume that there are N groups, which are (X1,…,X N ), with X i For example, the input value matrix vector is 1×(m+1), m is the number of interference elements, 1 is the element to be tested, and the total vector set of N training sets is N×(m+1), and the values inside are the characteristic X-ray intensity values of the elements. e L-1 It indicates the difference between the grade estimation value of N groups of elements to be tested by the random configuration network algorithm model and the actual grade value of N groups of elements to be tested when the number of hidden layer nodes is L-1; Step 5: Add a new candidate hidden layer node output according to the following formula: h L (X)=[g L (w L T X1+b L ),g L (w L T X2+b L ),…,g L (w L T X N +b L )] T In the above formula, h L (X) indicates that when the input variable is X, the hidden layer output value of a new node in the random configuration network algorithm model is calculated, w L Indicates adding a new node input weight, which is selected in the W matrix in step 3, X N represents N groups of input variables, b L Indicates the bias of a newly added node, selected from B in step 3, is the activation function, which is a nonlinear piecewise continuous function that satisfies the universal approximation ability theorem. We take the Sigmoid function, that is, Step 6: Screen the parameters of each hidden layer according to the supervision mechanism below and select the best candidate hidden layer single node. In the above formula, ξ L It represents a judgment value for a node added to the hidden layer in the random configuration network algorithm model, e L-1 (X), h L (X) has the meanings given in Step 4 and Step 5 respectively; Step 7: Solve the output weight β between the hidden layer and the output layer using the least squares method: In the formula, H L is the hidden layer output with L nodes, T is the expected output of the random configuration network algorithm model, β * is the objective function; Step 8: When the random configuration network algorithm model construction meets the learning iteration stopping condition, the model training is completed, thereby obtaining a trained random configuration network algorithm model.
3. The method for detecting ore element grade based on linear regression combined with random configuration network according to claim 2 is characterized in that: The step three comprises: The input weights and biases of the hidden layer are randomly assigned multiple times from the interval [-Υ, Υ], where Υ = {1, 3, 5, 10}, and there are a preset number of optional values, and the values that meet the conditions are selected from the optional values; The step six comprises: If L ≥0, then ξ L Saved in Z, the input weight w of this configuration k and bias b k Saved in Ω, after multiple random configurations, select ξ in Z from the above candidate hidden layer node pool L The maximum value of w L * and b L * As the best candidate hidden layer single node, it is added to the random configuration network algorithm model.
4. The method for detecting ore element grade based on linear regression combined with random configuration network according to claim 2 is characterized in that: The step seven comprises: Using the output H of the network model L The minimization of the square difference between β and the training set sample label value T is used as the evaluation training error, that is, as the objective function. The solution that minimizes the objective function is the optimal solution, and the weight β is solved by minimizing the approximate square difference. The objective function is: In the formula, H L is the output matrix of the hidden layer, T is the expected output of the random configuration network algorithm model; Using the least squares method, the optimal solution of the objective function can be derived through the knowledge of linear algebra and matrix theory: in, is the matrix H L The Moore-Penrose generalized inverse matrix of .
5. The method for detecting ore element grade based on linear regression combined with random configuration network according to claim 2 is characterized in that: The step eight comprises: The stopping conditions for the random configuration network algorithm model training include the number of nodes in the current network hidden layer exceeding the set maximum number of nodes or the modulus of the residual of the current network||e L (X)|| is not greater than the given expected tolerance error ε; If the network model reaches the stopping criterion, it indicates that the network model determined by the current parameters has reached the optimal value, and the randomly configured network model determined in this way can be directly used to estimate the grade of the elements to be tested in the test set samples.
6. The method for detecting ore element grade based on linear regression combined with random configuration network according to claim 2, characterized in that: Testing the configuration network algorithm model includes: After obtaining the trained univariate linear regression model and the trained random configuration network algorithm model, the two are used together to form a detection model for the element to be detected. The effect evaluation of the detection model for the element to be detected includes: The coefficient of determination R 2 And root mean square error are used as evaluation indicators. The formulas of the two indicators are: Among them, y i is the grade value of the element to be tested in the sample in the test set, is the grade prediction value of the element to be measured output by the detection model of the element to be measured, y m is the average grade value of the element to be tested of all test set samples, and N is the number of samples in the test set.
7. The method for detecting ore element grade based on linear regression combined with random configuration network according to claim 1, characterized in that: The ore is lead-zinc ore, the element to be measured is zinc, the m interfering elements are Si, Ca, Ti, Mn, Fe and Cu that coexist with the element Zn to be measured; and the true grade value is the grade value obtained by artificial assay method.
Citation Information
Patent Citations
Ore sorting decision method based on subject operation characteristic curve analysis
CN112024451A
Copper grade SCN modeling algorithm for X fluorescence grade analyzer
CN116738120A