A zinc liquid cobalt ion concentration detection model suitable for small samples and capable of resisting interference

By combining neural networks and manifold learning methods with feature selection algorithms, the problems of scarce samples and multi-factor interference in the detection of cobalt ion concentration in zinc solution were solved, achieving high-precision and stable cobalt ion concentration prediction.

CN118366565BActive Publication Date: 2026-07-31CENT SOUTH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CENT SOUTH UNIV
Filing Date
2024-04-02
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies for detecting cobalt ion concentration in zinc solutions suffer from insufficient sample size and interference from multiple factors, resulting in inadequate model accuracy and stability, making it difficult to construct high-performance cobalt ion concentration prediction models.

Method used

By employing a contrastive neural network structure and manifold learning method, combined with a feature selection algorithm, interference factors are eliminated through a feature extraction network, high-dimensional distortion is corrected using manifold learning, and useful features are screened out through a competitive adaptive reweighted sampling algorithm. Finally, cobalt ion concentration is predicted using partial least squares regression.

Benefits of technology

Under small sample conditions, the influence of interfering factors was effectively suppressed, the accuracy and stability of cobalt ion concentration detection were improved, overfitting was reduced, and efficient cobalt ion concentration prediction was achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118366565B_ABST
    Figure CN118366565B_ABST
Patent Text Reader

Abstract

This invention relates to the field of metal ion detection technology, specifically disclosing a method for detecting cobalt ion concentration in zinc solution that is suitable for small samples and resistant to interference. The method includes the following steps: Step S1, using a feature extraction network to eliminate temperature interference in the spectral signal and extract cobalt ion concentration features from the spectrum; Step S2, using a manifold learning method to correct potential high-dimensional distortions in the features; Step S3, using a feature selection algorithm to filter out features with strong information; Step S4, using a regression algorithm to regress the features and predict the cobalt ion concentration. The purpose of this invention is to provide a method for detecting cobalt ion concentration in zinc solution that is suitable for small samples and resistant to interference.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of metal ion detection technology, and specifically discloses a zinc liquid cobalt ion concentration detection model that is suitable for small samples and can resist interference. Background Technology

[0002] Cobalt ions are a common metallic impurity in hydrometallurgical zinc smelting. The effectiveness of cobalt removal during the purification process directly impacts zinc production. Excessive cobalt ion concentration leads to "plate burning" during electrolysis, significantly reducing the energy efficiency and quality of zinc production. Conversely, excessively low cobalt ion concentrations indicate excessive addition of zinc powder and antimony salts during purification, resulting in raw material waste and increased cobalt recovery costs. Therefore, accurate detection of cobalt ion concentration in molten zinc is crucial for precise cobalt recovery and improving the energy efficiency and stability of the zinc smelting process.

[0003] Currently, the zinc smelting industry commonly uses spectrophotometry based on colorimetric reactions to detect cobalt ions in molten zinc. Its basic principle is based on the property that nitrosyl salts can only form stable colored complexes with cobalt ions under nitric acid and high-temperature conditions, thus constructing a model relating absorbance spectra to cobalt ion concentration. Since the relationship between absorbance and concentration of substances in a solution is almost linear under ideal conditions, the common analytical approach in similar spectroscopic detection fields is to first apply wavelength selection algorithms to screen for effective wavelengths, and then use partial least squares regression for target prediction. However, during testing, it was found that the absorbance of molten zinc treated with this detection system is not only affected by cobalt ion concentration but also significantly influenced by temperature and other impurities. This greatly affects the accuracy and stability of the aforementioned regression model, even rendering it ineffective.

[0004] Traditional methods for eliminating interference involve using mathematical statistics and analysis to construct a model of the relationship between interfering factors and the data, and then correcting the data based on this model. However, the relationship between interfering factors and the data is often nonlinear and multi-coupled, making this very difficult in practice. Therefore, neural network-based intelligent learning models are becoming increasingly common in spectral data modeling. Theoretically, as long as we provide the model with sufficient effective data and labels, it can automatically ignore interference information in the spectrum and learn features related to cobalt ion concentration for modeling, which greatly reduces the workload of manual data statistics and analysis.

[0005] However, traditional neural network models have many limitations in practical applications. On one hand, neural network models are essentially black-box models. While they possess powerful learning capabilities and can automatically adjust their internal parameters based on training data to construct a suitable model relating spectra to cobalt ion concentration, this learning process is blind and uncontrollable. They lack a mechanism to directly and specifically eliminate useless interference features in the data and learn useful cobalt ion spectral information according to our intentions, which limits further performance improvements. On the other hand, the accuracy and stability of deep learning models heavily depend on the quantity and diversity of training data; otherwise, they are prone to overfitting. However, sample preparation and spectral sampling for cobalt ion concentration detection are extremely cumbersome, making it very difficult to obtain large amounts of data. Therefore, how to construct a cobalt ion concentration prediction model with strong learning objectives, high stability, and small errors under conditions of scarce samples and multiple interference factors is an urgent problem to be solved. Summary of the Invention

[0006] The purpose of this invention is to provide a zinc solution cobalt ion concentration detection model that is suitable for small samples and resistant to interference.

[0007] To achieve the above objectives, the present invention provides the following basic solution:

[0008] A zinc solution cobalt ion concentration detection model suitable for small samples and resistant to interference.

[0009] The principle and effect of this basic scheme are as follows:

[0010] 1. Compared with existing technologies, since the contrastive neural network requires a pair of data as input for each training iteration, the data will have N... 2 The model is input in the form of (N represents the total number of data points). This greatly improves the diversity of data compared to traditional networks with a single data input, and alleviates the overfitting problem caused by insufficient data.

[0011] 2. Compared with existing technologies, using a contrastive neural network structure and formula (1) as the loss function to construct a training model for the feature extraction network will make the training process more directional, removing all interference except for concentration features and improving the quality of feature extraction.

[0012] 3. Compared with existing technologies, it can be seen that when the contrastive neural network is trained, |v1-v2|≈|y1-y2|, which indicates that the features output by the feature extraction network will automatically tend to a linear distribution relative to the concentration, which is very beneficial for subsequent regression modeling.

[0013] 4. The use of manifold learning methods and feature selection algorithms can effectively compensate for the potential defects in feature extraction networks in generating features, and effectively improve the accuracy of cobalt ion concentration regression.

[0014] Furthermore, the feature extraction network in step S1 employs one feature extraction network from a contrastive neural network; the contrastive neural network comprises two feature extraction networks with identical structures and internal parameters, and a loss function; after the contrastive neural network is trained, only one of its feature extraction networks needs to be extracted for step S1; the formula for the loss function is:

[0015] L(v1,v2,y1,y2)=(‖v1-v2‖-|y1-y2|) 2 (1);

[0016] In the formula, v1 and v2 represent the output vectors of the two sets of data after being input into the feature extraction network, and y1 and y2 represent the corresponding concentrations of the two sets of data.

[0017] Furthermore, the feature extraction network comprises three linear layers and one self-attention layer; the calculation formula for the linear layer is as follows:

[0018]

[0019]

[0020] The input vector is X = [x1, x2, x3, ..., x...]. n The output vector is Z = [z1, z2, z3, ..., z]. m ], where w represents the weight coefficient, b represents the bias coefficient, n represents the dimension of the input vector, m represents the dimension of the output vector, and s is the intermediate value calculated; the calculation formula for the self-attention layer is as follows:

[0021] Q = W q X,(4);

[0022] K = W k X,(5);

[0023] V = W v X,(6);

[0024] Z = VK T Q,(7);

[0025] Where X = [x1, x2, ..., x n ] represents the input vector, Z = [z1, z2, z3, ..., z n [] represents the output vector, n represents the dimension of the input vector, Q, K, and V represent the query vector, key vector, and value vector, respectively, all with an n×n shape, and W q W k and W vThe weights that need to be trained are all n×1; the linear layer and the self-attention layer are connected in series, and the self-attention layer is located in the second layer.

[0026] Furthermore, in step S2, the manifold learning method used in step S2 employs an isometric mapping algorithm, which can map a curled high-dimensional space to a flat low-dimensional space through nonlinear dimensionality reduction, thereby suppressing feature distortion.

[0027] Furthermore, the specific operation process of the equimetric mapping algorithm is as follows:

[0028] (1) Construct the adjacency matrix D based on the Euclidean distance between the eigenvectors. When the eigenvector X i and X j When they are k-nearest neighbors, D(i,j)=||X i -X j ||, otherwise D(i,j) is infinity;

[0029] (2) Use the shortest path algorithm in graph theory on the adjacency matrix D to calculate the shortest path distance between any two eigenvectors and construct the shortest path matrix S;

[0030] (3) Use the multidimensional scaling transformation algorithm to reconstruct the shortest path matrix S and obtain the corrected low-dimensional features.

[0031] Furthermore, the feature selection algorithm used in step S3 is a competitive adaptive reweighted sampling algorithm.

[0032] Furthermore, the specific operation process of the competitive adaptive reweighted sampling algorithm is as follows: (1) A certain proportion of samples are randomly selected using the Monte Carlo method to establish the PLSR model, and the absolute value of the regression coefficient of each variable is calculated;

[0033] (2) The variable with the lowest absolute value of the regression coefficient is forcibly removed according to the exponentially decreasing function. The expression of the exponentially decreasing function is:

[0034] D i =μe -θi , (8);

[0035] Where i represents the number of iterations, D i μ and θ represent the ratio of the remaining variables to the total variables. μ and θ are constants, with θ controlling the rate of decay. The expressions for μ and θ are:

[0036]

[0037] Where n represents the total number of variables, and N represents the manually set total number of iterations. When i = 1, all variables are retained, i.e., D1 = 1. When i = N, only 2 variables remain.

[0038] If the number of iterations i ≤ N, proceed to (1); otherwise, proceed to (4).

[0039] (3) Calculate the root mean square error of all PLSR models during the iteration process, and select the subset of variables with the smallest root mean square error as the final feature variables.

[0040] Furthermore, the regression algorithm used in step S4 is the partial least squares regression (PLSR) algorithm. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 This paper illustrates the overall process flow of a detection model for detecting cobalt ion concentration in zinc solution that is suitable for small samples and resistant to interference, as proposed in an embodiment of this application.

[0043] Figure 2 This paper illustrates a comparative neural network structure for a zinc liquid cobalt ion concentration detection model that is suitable for small samples and resistant to interference, as proposed in an embodiment of this application.

[0044] Figure 3 This illustration shows a schematic diagram of the principle of a linear layer for a zinc liquid cobalt ion concentration detection model that is suitable for small samples and can resist interference, as proposed in an embodiment of this application.

[0045] Figure 4 This illustration shows a schematic diagram of the principle of a self-attention layer for a zinc liquid cobalt ion concentration detection model that is suitable for small samples and can resist interference, as proposed in an embodiment of this application. Detailed Implementation

[0046] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.

[0047] The reference numerals in the accompanying drawings include: spectral data 1, contrastive neural network 2, feature extraction network 21, loss function 22, linear layer 211, and self-attention layer 212.

[0048] Implementation, for example Figure 1 , Figure 2 , Figure 3 and Figure 4 As shown:

[0049] A zinc solution cobalt ion concentration detection model suitable for small samples and resistant to interference includes the following steps:

[0050] Step S1: Use feature extraction network 21 to eliminate temperature interference in the spectral signal and extract the cobalt ion concentration features in the spectrum;

[0051] Step S2: Use manifold learning methods to correct potential high-dimensional distortions in features;

[0052] Step S3: Use a feature selection algorithm to filter out features with strong information;

[0053] Step S4: Use a regression algorithm to regress the features and predict the cobalt ion concentration.

[0054] Furthermore, the feature extraction network in step S1 employs one feature extraction network from a contrastive neural network; the contrastive neural network comprises two feature extraction networks with identical structures and internal parameters, and a loss function; after the contrastive neural network is trained, only one of its feature extraction networks needs to be extracted for step S1; the formula for the loss function is:

[0055] L(v1,v2,y1,y2)=(‖v1-v2‖-|y1-y2|) 2 (1);

[0056] In the formula, v1 and v2 represent the output vectors of the two sets of data after inputting them into the feature extraction network 21, and y1 and y2 represent the corresponding concentrations of the two sets of data.

[0057] Preferably, the feature extraction network 21 includes three linear layers 211 and one self-attention layer 212; the calculation formula for the linear layer 211 is as follows:

[0058]

[0059]

[0060] The input vector is X = [x1, x2, x3, ..., x...]. n The output vector is Z = [z1, z2, z3, ..., z]. m ], w represents the weight coefficient, b represents the bias coefficient, n represents the dimension of the input vector, m represents the dimension of the output vector, and s is the intermediate value calculated; the calculation formula for the self-attention layer 212 is as follows:

[0061] Q = W q X, (4);

[0062] K = W k X, (5);

[0063] V = W v X, (6);

[0064] Z = VK T Q,(7);

[0065] Where X = [x1, x2, ..., x n ] represents the input vector, Z = [z1, z2, z3, ..., z n [] represents the output vector, n represents the dimension of the input vector, Q, K, and V represent the query vector, key vector, and value vector, respectively, all with an n×n shape, and W q W k and W v The weights that need to be trained are all n×1; the linear layer 211 and the self-attention layer 212 are connected in series, and the self-attention layer 212 is located in the second layer.

[0066] In practice, the collected spectral data 1 is continuously input into the contrast neural network 1 in pairs to train the feature extraction network 21 until the calculated loss value of the loss function 22 approaches 0. Then, the trained feature extraction network 21 is separated out and used for feature extraction.

[0067] Preferably, the manifold learning method used in step S2 employs an isometric mapping algorithm, which can map a curled high-dimensional space to a flat low-dimensional space through nonlinear dimensionality reduction, thereby suppressing feature distortion. The specific operation process of the isometric mapping algorithm is as follows: (1) Construct the adjacency matrix D based on the Euclidean distance between feature vectors. When feature vector X i and X j When they are k-nearest neighbors, D(i,j)=||X i -X j ||, otherwise D(i,j) is infinity;

[0068] (2) Use the shortest path algorithm in graph theory on the adjacency matrix D to calculate the shortest path distance between any two eigenvectors and construct the shortest path matrix S;

[0069] (3) Use the multidimensional scaling transformation algorithm to reconstruct the shortest path matrix S and obtain the corrected low-dimensional features.

[0070] In practice, manifold learning algorithms are only used to correct features whose linear regression errors are higher than the average.

[0071] Preferably, the feature selection algorithm used in step S3 is a competitive adaptive reweighted sampling algorithm; the specific operation process of the competitive adaptive reweighted sampling algorithm is as follows:

[0072] (1) A certain proportion (usually 80%) of the sample is randomly selected using the Monte Carlo method to establish the PLSR model, and the absolute value of the regression coefficient of each variable is calculated.

[0073] (2) By forcibly removing the variable with the lowest absolute value of the regression coefficient according to the exponentially decreasing function, the expression of the exponentially decreasing function is:

[0074] D i =μe -θi , (8);

[0075] Where i represents the number of iterations, D i μ represents the ratio of the remaining variables to the total variables. θ is a constant, with θ controlling the rate of decay. The expressions for μ and θ are:

[0076]

[0077] Where n represents the total number of variables, and N represents the manually set total number of iterations. When i = 1, all variables are retained, i.e., D1 = 1. When i = N, only 2 variables remain.

[0078] (3) If the number of iterations i ≤ N, go to (1); otherwise, go to (4).

[0079] (4) Calculate the root mean square error of all PLSR models during the iteration process, and select the subset of variables with the smallest root mean square error as the final feature variables.

[0080] Preferably, the regression algorithm used in step S4 is the partial least squares regression (PLSR) algorithm.

[0081] Detailed implementation process of the PLSR algorithm

[0082] (1) Perform Z-Score standardization on the independent variable matrix and the dependent variable matrix. The standardized independent variable matrix and dependent variable matrix are represented as X and Y, respectively.

[0083] (2) By solving the optimization equation

[0084]

[0085] st ‖p1‖=1, ‖q1‖=1 (11)

[0086] Calculate the principal components p1 and q1 of X and Y;

[0087] (3) Let u1 = Xp1, and establish the regression equation.

[0088]

[0089]

[0090] The least squares method is used to find the answer. Substitute them into formulas (12) and (13) to calculate the residual matrices E1 and F1;

[0091] (4) Replace X and Y with E1 and F1 to form new independent variable matrices and dependent variable matrices, and repeat steps (2) and (3) until all effective decompositions are completed, i.e.

[0092]

[0093]

[0094] (5) Let U=[u1,u2,…,u n ], C = [c1, c2, ..., c n ],R=[r1,r2,…,r n ], P = [p1, p2, ..., p n Formulas (14) and (15) can be transformed into

[0095] X≈UC T (16)

[0096] Y≈UR T (17)

[0097] Because U = XP, therefore

[0098] Y≈UR=XPR T (18)

[0099] Let B = PR T B is the mapping matrix from X to Y, and the regression model is now complete.

[0100] The purpose of this invention is to provide a zinc solution cobalt ion concentration detection model that is suitable for small samples and resistant to interference.

[0101] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A method for detecting cobalt ion concentration in zinc solution that is suitable for small samples and resistant to interference, characterized in that: Includes the following steps: Step S1: Use a feature extraction network to eliminate temperature interference in the spectral signal and extract the cobalt ion concentration features in the spectrum; Step S2: Use manifold learning methods to correct potential high-dimensional distortions in features; Step S3: Use a feature selection algorithm to filter out features with strong information; Step S4: Use a regression algorithm to regress the features and predict the cobalt ion concentration; The feature extraction network in step S1 uses one feature extraction network from a contrastive neural network; the contrastive neural network includes two feature extraction networks with identical structures and internal parameters, and a loss function; after the contrastive neural network is trained, only one of the feature extraction networks needs to be extracted for step S1; the formula for the loss function is: (1); In the formula, and These represent the output vectors of the two sets of data input into the feature extraction network. and These represent the corresponding concentrations of the two sets of data, respectively. The manifold learning method used in step S2 employs an isometric mapping algorithm, which can map a curled high-dimensional space to a flat low-dimensional space through nonlinear dimensionality reduction, thereby suppressing feature distortion. The specific computation process of the equal metric mapping algorithm is as follows: (1) Construct an adjacency matrix based on the Euclidean distance between eigenvectors; the matrix is ​​infinity if the eigenvectors are neighbors, otherwise it is infinite. (2) Use the shortest path algorithm in graph theory to calculate the shortest path distance between any two eigenvectors and construct the shortest path matrix for the adjacency matrix; (3) Use the multidimensional scaling transformation algorithm to reconstruct the shortest path matrix and obtain the corrected low-dimensional features.

2. The method for detecting cobalt ion concentration in zinc solution, suitable for small samples and resistant to interference, as described in claim 1, is characterized in that... The feature extraction network comprises three linear layers and one self-attention layer; the calculation formula for the linear layer is as follows: (2); (3); Where the input vector is The output vector is , Represents the weighting coefficient. Represents the bias coefficient. The dimension of the input vector. The dimension of the output vector. The intermediate value is used in the calculation; the calculation formula for the self-attention layer is as follows: ,(4); ,(5); ,(6); ,(7); in, Represents the input vector. Represents the output vector. The dimension of the input vector. , and These represent the query vector, key vector, and value vector, respectively, all with the following shape: , , and These represent the weight coefficients that need to be trained, and their shapes are all... The linear layer and the self-attention layer are connected in series, and the self-attention layer is located in the second layer.

3. The method for detecting cobalt ion concentration in zinc solution, suitable for small samples and resistant to interference, as described in claim 1, is characterized in that... The feature selection algorithm used in step S3 is a competitive adaptive reweighted sampling algorithm.

4. The method for detecting cobalt ion concentration in zinc solution, suitable for small samples and resistant to interference, as described in claim 3, is characterized in that... The specific computation process of the competitive adaptive reweighted sampling algorithm is as follows: (1) A certain proportion of samples were randomly selected using the Monte Carlo method to establish the PLSR model, and the absolute values ​​of the regression coefficients of each variable were calculated. (2) The variable with the lowest absolute value of the regression coefficient is forcibly removed according to the exponentially decreasing function. The expression of the exponentially decreasing function is: (8); in, Represents the number of iterations. Represents the ratio of the remaining variables to the total number of variables. and It is a constant. Used to control the rate of decay. and The expression is: (9); in, Represents the number of all variables. Represents the total number of iterations set manually, when At that time, all variables are preserved, that is ,when At that time, there are only 2 variables remaining, that is... ; (3) When the number of iterations Go to (1), otherwise go to (4); (4) Calculate the root mean square error of all PLSR models during the iteration process, and select the subset of variables with the smallest root mean square error as the final feature variables.

5. The method for detecting cobalt ion concentration in zinc solution, suitable for small samples and resistant to interference, as described in claim 1, is characterized in that... The regression algorithm used in step S4 is the Partial Least Squares Regression (PLSR) algorithm.