A classification and recognition method for iron ore LIBS data using a twin network fused with autoencoders
By combining autoencoders and Siamese networks, the problems of high-dimensional dimensionality reduction and gradient vanishing in iron ore LIBS data were solved, achieving efficient iron ore classification and recognition, and improving the model's accuracy and training speed.
Patent Information
- Application Number
- CN202311021346.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-14
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2043-08-14
AI Technical Summary
Existing technologies for classifying iron ore LIBS data suffer from poor dimensionality reduction for high-dimensional data, vanishing gradient problem, time-consuming model training, and low accuracy with small samples.
An autoencoder is used for data dimensionality reduction, and a Siamese network is combined for feature extraction and classification. A residual network is used to solve the gradient vanishing problem, and the model is optimized by sharing parameters and Euclidean distance.
It improved the model's accuracy and training speed, especially the classification accuracy for small samples, thus enhancing the model's real-time performance and efficiency.
Smart Images

Figure CN117076985B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of classification and recognition of iron ore LIBS (Laser-Induced Breakdown Spectroscopy) data, and in particular to a classification and recognition method for iron ore LIBS data by using a twin network fused with an autoencoder. Background Art
[0002] Existing methods for classifying iron ore include chemical methods, deep learning and machine learning.
[0003] Chemical method: Chemical method is a commonly used method to determine the content and composition of each element in the ore. Commonly used chemical methods include titration, colorimetry and composite indicator method, etc. The content of the main components, impurities and useful elements can be determined, thereby realizing the classification of iron ore.
[0004] Machine learning: Machine learning methods include KNN, SVM and other methods. Patent document CN103488874A discloses an improved support vector machine combined with laser induced breakdown spectroscopy to classify steel materials; first, a one-to-many modeling classification is established, and a binary classifier is established for each type of iron ore. During the prediction process, if the predicted result has multiple categories, a one-to-one model is established for these categories. Then the process is iterated repeatedly until a unique result is selected.
[0005] Deep learning: The existing LIBS iron ore data classification method mainly relies on training neural networks for large data samples. PCA technology is used to reduce the dimension and extract features of data. Usually, deep learning neural networks are trained and classified using 1DCNN (one-dimensional neural network), such as the method for identifying the country and brand of iron ore production provided by patent document CN111239103A.
[0006] Disadvantages / deficiencies of existing technologies:
[0007] 1. Iron ore LIBS data is high-dimensional data. A sample of iron ore LIBS spectrum data has 14,916 feature points. Existing deep learning often uses PCA to reduce the dimension of iron ore spectrum data. PCA is a linear dimensionality reduction method that can only capture linear relationships in data. PCA may face the problem of dimensionality disaster in high-dimensional space, that is, when the dimension is much larger than the number of samples, the effect of PCA may not be good.
[0008] 2. Most existing deep learning models can train relatively accurate models when there are sufficient samples. In order to improve the accuracy of the model, the number of layers of the model is increased. However, when training the model, as the depth of the model increases, gradient disappearance or network degradation may occur (network degradation: in deep learning neural networks, the accuracy of the training set tends to saturation in the process of increasing network layer parameters, and the accuracy of the training set will decrease as the number of network layers is increased, and this decrease is not caused by overfitting).
[0009] 3. There is sample imbalance in the training of these data. The sample size of some types of iron ore is much smaller than that of other samples, which causes the accuracy of the model to be biased towards the types with a large number of samples, while the accuracy is not high enough for the types of iron ore with a small sample size.
[0010] 4. Current machine learning methods, such as the method of using an improved support vector machine combined with Libs spectrum in patent document CN103488874A, are very time-consuming for predicting some samples. Because in this way, if a one-to-many model is used for the first time, it cannot be screened layer by layer to a specific category, but multiple categories are selected, and it is necessary to re-establish a one-to-one model and screen repeatedly. It is time-consuming and labor-intensive, and it is impossible to achieve industrial real-time rapidity. Summary of the invention
[0011] The purpose of the present invention is to provide a classification and recognition method for iron ore LIBS data by using a twin network integrating an autoencoder to solve the problems in the prior art.
[0012] To achieve the above-mentioned purpose, the present invention provides the following technical solutions: a classification and identification method for iron ore LIBS data by a twin network integrating an autoencoder, comprising the following steps: S1: collecting iron ore spectral data as original training data through a laser induced breakdown spectrometer; S2: performing dimensionality reduction on the original training data by an autoencoder, and using the reduced dimensionality data as the input of the training network; S3: selecting two identical branch networks as twin networks, each branch network processing an input spectral sample; the two branch networks remain synchronized during the training process by sharing parameters.
[0013] Furthermore: the step S2 uses an autoencoder to extract data features, and uses the data after dimensionality reduction by the autoencoder as the input layer of the subsequent deep learning classification network; the autoencoder includes 3 linear layers, 3 linear rectification functions are activated, and the optimization function of back propagation selects the mean square error.
[0014] Further: the autoencoder is used for feature extraction and reconstruction of data; it is composed of two main components, an encoder and a decoder; the goal of the autoencoder is to achieve self-representation of input data by learning a compressed representation and a decoder that reconstructs the input data from the representation; the training process of the autoencoder includes two stages:
[0015] Forward propagation: Pass the input data to the encoder to produce feature representation:
[0016]
[0017] Where W1: weight of forward propagation, b1: bias parameter of forward propagation;
[0018] Backpropagation: The output of the encoder is passed to the decoder, and the reconstruction error is calculated by comparing the decoder output with the original input; then the backpropagation algorithm is used to update the weights and biases of the network to minimize the reconstruction error:
[0019]
[0020] Where W2: weight of back propagation, b2: bias parameter of back propagation;
[0021] The objective function of the algorithm optimization is: MinimizeLoss = dist(X,X R ).
[0022] Further: the step S2 also includes normalizing the data as follows:
[0023]
[0024] Furthermore: the branch network is a residual network, and the basic component unit of the residual network is a residual block, which optimizes the training and performance of the network through cross-layer connection and residual learning; within each residual block, the input data is processed through two or more convolutional layers and activation functions; then the input data is added to the residual connection to obtain the output of the residual block.
[0025] Furthermore: each branch network contains a convolution layer and a pooling layer structure to extract features and learn sample representations; the two branch networks share weights to obtain two vectors, and the Euclidean distance is used to calculate the distance between the two vectors; finally, the S-type activation function is used.
[0026] Further: the step S3 divides the data set into a training set, a validation set and a test set; generates a corresponding "positive sample" for each sample, and a "negative sample" of a different category; the positive sample is the original sample, and the negative sample is a sample selected from other categories; creates pairs of input samples, each pair contains a positive sample and a negative sample; uses a contrastive loss function, including a boundary loss and an inter-sample distance loss;
[0027]
[0028] N represents the number of samples, that is, the number of paired samples; Dw is the Euclidean distance between the two outputs of the twin network: E w =|X1-X2|2; the Y value is 1 or 0; when the two inputs are similar, Y=1, otherwise it is 0.
[0029] Further: the training process of step S3 is as follows: use the training data to train the twin network to minimize the defined loss function; use the gradient descent algorithm to optimize and update the weights and biases of the network; use the validation set to monitor the performance of the model, and adjust the parameters or stop training early based on the performance.
[0030] Furthermore: step S3 also includes using a test set to evaluate the performance of the trained model on unseen data, and the testing method is as follows: select the average spectrum of each type of iron ore sample as the standard sample of that type of sample, and input the unknown sample to be tested and the average spectrum into the twin network at the same time to obtain the prediction result; calculate the classification accuracy and confusion matrix indicators to evaluate the effect of the model; for new spectral samples, input them into the deployed model and classify them according to the prediction results output by the model.
[0031] Furthermore: the residual network is composed of 50 layers, and the ratio of the number of training sets, validation sets and test sets is 8:1:1.
[0032] Compared with the prior art, the present invention has the following beneficial effects:
[0033] 1. Using autoencoders can reduce data dimensions, extract important information, and better cluster features together; thereby effectively shortening model training time and improving model accuracy.
[0034] 2. After using the twin network, the accuracy of small samples is improved (among the 35 selected samples, the overall accuracy is 96.06%, and the accuracy of the five small samples has reached 95.3% overall).
[0035] 3. Model training and prediction speed are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0037] Figure 1 It is a structural diagram of the autoencoder of the present invention;
[0038] Figure 2 It is the effect diagram of the autoencoder of the present invention;
[0039] Figure 3 is the residual network graph of the present invention;
[0040] Figure 4 It is a twin network structure diagram of the present invention;
[0041] Figure 5 It is the loss s diagram of the training process of the present invention and the accuracy diagram on the training set and the test set.
[0042] Figure 6 It is a confusion matrix diagram of the prediction results of the present invention on 35 kinds of iron ores. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention.
[0044] See also Figure 1-6 In an embodiment of the present invention, a classification and recognition method for iron ore LIBS data using a twin network fused with an autoencoder comprises the following steps:
[0045] S1: Collect original training data: collect iron ore spectrum data through laser induced breakdown spectrometer;
[0046] S2: Autoencoder dimension reduction of the original data:
[0047] 2.1. Data normalization processing:
[0048]
[0049] 2.2. After the autoencoder, 3 linear layers, and 3 Relu function activations, the data is reduced in dimension. The reduced-dimensional data is used as the input for the training network.
[0050] S3: Training of the twin network: The twin network has two branch networks, which are used to extract data features;
[0051] The twin neural network is composed of a residual network as a branch network;
[0052] Preferably, the residual network is composed of 50 layers; a 50-layer residual network can obtain the best results in 140 iterations of training. If the number of network layers is too small, the LIBS data features cannot be fully extracted, and more iterations are required, which is time-consuming. If the residual network exceeds 50 layers, the results will not improve. On the contrary, as the number of layers increases, the parameters will increase. In addition, a deeper network requires more training time and computing resources, and each round of iteration will take longer.
[0053] The two branch networks select the residual network; the branch network shares weights to obtain two vectors, and the Euclidean distance is used to calculate the difference between the two vectors; the S-type activation function is used.
[0054] Preferably, an autoencoder is used to extract data features, and the data after dimensionality reduction by the autoencoder is used as the input layer of the subsequent deep learning classification network; the autoencoder includes 3 linear layers, 3 linear rectification functions are activated, and the optimization function of back propagation selects the mean square error.
[0055] Preferably, the autoencoder is used for feature extraction and reconstruction of data; it is composed of two main components, an encoder and a decoder; the goal of the autoencoder is to achieve self-representation of input data by learning a compressed representation and a decoder that reconstructs the input data from the representation;
[0056] The training process of the autoencoder consists of two stages:
[0057] Forward propagation: Pass the input data to the encoder to produce feature representation:
[0058]
[0059] Backpropagation: The output of the encoder is passed to the decoder, and the reconstruction error is calculated by comparing the decoder output with the original input; then the backpropagation algorithm is used to update the weights and biases of the network to minimize the reconstruction error:
[0060]
[0061] The objective function of the algorithm optimization is: MinimizeLoss = dist(X,X R ).
[0062] Preferably, the residual network introduces the concept of residual blocks, and optimizes the training and performance of the network through cross-layer connections and residual learning;
[0063] The residual block is the basic building block of the residual network. By introducing cross-layer connections to transfer information, the network can learn the residual function. Inside each residual block, the input data is processed through two or more convolutional layers and activation functions. Then, the input data is added to the residual connection to obtain the output of the residual block.
[0064] Preferably, the twin neural network: twin network architecture design:
[0065] The Siamese network consists of two identical network branches, each processing one input spectral sample;
[0066] Each branch contains a convolutional layer, a pooling layer, and a fully connected layer structure to extract features and learn sample representations;
[0067] By sharing parameters, the weights of the two branches are ensured to remain synchronized during training.
[0068] Preferably, training data preparation: the data set is divided into a training set, a validation set, and a test set, and the ratio of the three is 8:1:1; this is because there is a very small amount of LIBS data in the sample, and it is preferred to ensure that there is enough data to participate in the training to prevent overfitting or underfitting. If the training set exceeds the ratio, the accuracy of the model cannot be explained by the validation set and the test set. If the training set is lower than the ratio, the data of the small sample cannot be fully trained, and the training of the small sample in the sample will be underfitting, resulting in a decrease in the accuracy of the model in the prediction of the small sample. Figure 5 In the figure, curve ① on the training set and curve ② on the validation set show the same trend, indicating that the model does not have overfitting.
[0069] Generate a corresponding "positive sample" and a "negative sample" of a different category for each sample; the positive sample is the original sample, and the negative sample is the sample selected from other categories;
[0070] Create pairs of input samples, each pair contains a positive sample and a negative sample;
[0071] Loss function definition: Use the twin network to adopt the contrastive loss function, including boundary loss and distance loss between samples;
[0072]
[0073] N represents the sample size, that is, the number of paired samples;
[0074] Dw is the Euclidean distance between the two outputs of the twin network: D w =|X1-X2|2
[0075] The Y value is 1 or 0; when the two inputs are similar, Y = 1, otherwise it is 0;
[0076] Training process:
[0077] Use the training data to train the twin network and minimize the defined loss function;
[0078] Use the gradient descent optimization algorithm to update the network’s weights and biases;
[0079] Use the validation set to monitor the performance of the model and adjust hyperparameters or stop training early based on the performance;
[0080] Testing and Evaluation:
[0081] Use the test set to evaluate the performance of the trained model on unseen data;
[0082] Calculate indicators such as classification accuracy and confusion matrix to evaluate the effectiveness of the model;
[0083] Model deployment: In practical applications, the trained model is deployed to an appropriate environment.
[0084] For new spectral samples, they are input into the deployed model and classified according to the prediction results output by the model.
[0085] The working principle of the present invention is: the spectrum data of iron ore is collected by laser induced breakdown spectrometer. (A total of 35 types of iron ores)
[0086] Among them, the number of samples of the 3rd, 4th, 10th, 13th and 21st categories of iron ores are 7, 12, 7, 12 and 7 respectively, and the spectral data of the remaining 30 categories of iron ores are all more than 35.
[0087] S2. Perform autoencoder dimensionality reduction on the original data.
[0088] The dimension of the original data of an iron ore line is 1*14916.
[0089] After the autoencoder, 3 linear layers, and 3 ReLU function activations, the dimension of the data is reduced to 1*7458. The reduced-dimensional data is used as the input for the training network.
[0090] Autoencoder Network is an unsupervised learning model that can better capture complex patterns and nonlinear relationships in data. It is used for feature extraction and reconstruction of data. It consists of two main components: encoder and decoder. The goal of the autoencoder is to achieve self-representation of the input data by learning a compressed representation (encoder) and a decoder that reconstructs the input data from the representation.
[0091] The working principle of the autoencoder is as follows:
[0092] Encoder: The encoder takes input data and converts it into a low-dimensional feature representation. The encoder usually consists of multiple hidden layers, each of which contains a set of neurons. Each neuron multiplies the input data with a weight and generates the output of the hidden layer through an activation function. As the number of hidden layers increases, the encoder gradually reduces the data dimension and learns the abstract features of the data.
[0093] Decoder: The decoder takes the feature representation generated by the encoder and decodes it into reconstructed data. The decoder has a similar structure to the encoder, but operates in reverse. It reconstructs the data by reversing layer by layer and getting as close to the original input as possible. The output of the last layer of the decoder usually uses an appropriate activation function to match the range and distribution of the original data.
[0094] The training process of the autoencoder consists of two stages:
[0095] Forward propagation (encoding): Pass the input data to the encoder to produce feature representations.
[0096]
[0097] Backpropagation (decoding and reconstruction): The output of the encoder is passed to the decoder, and the reconstruction error is calculated by comparing the decoder output with the original input. The backpropagation algorithm is then used to update the weights and biases of the network to minimize the reconstruction error.
[0098]
[0099] The objective function of the algorithm optimization is: MinimizeLoss = dist(X,X R )
[0100] In the scheme of the present invention, an autoencoder is used to extract data features, and the data after the autoencoder dimension reduction is used as the input layer of the subsequent deep learning classification network. The autoencoder in this scheme contains 3 linear layers, 3 linear rectification functions (Rule) activation, and the optimization function of back propagation selects the mean square error. The original spectral information is reduced from 14916 to 7458, and the overall network framework is shown in Figure 1 .
[0101] Residual Network is a deep convolutional neural network architecture that aims to solve the problems of gradient vanishing and information loss in deep network training. The concept of residual block is introduced to optimize the training and performance of the network through cross-layer connections and residual learning.
[0102] In the training process of traditional deep neural networks, the gradient will gradually become smaller during the back propagation process, making it difficult to update the parameters of the earlier layers, which is called the gradient vanishing problem. In addition, the increase in the number of network layers may also cause information to be lost in the network, making it difficult to improve network performance. In order to solve these problems, ResNet proposed the concept of residual learning.
[0103] In the method of the present invention, the branch network of the twin network is composed of a residual network.
[0104] The residual block is the basic building block of ResNet. It transfers information by introducing cross-layer connections (skip connections) so that the network can learn the residual function. Inside each residual block, the input data is processed through two or more convolutional layers and activation functions. Then, the input data is added with the residual connection to obtain the output of the residual block. This cross-layer connection allows information to be directly transferred from earlier layers to deeper layers, effectively alleviating the gradient vanishing problem and improving the network's expressiveness; the network structure is as follows Figure 3 shown.
[0105] In the residual network, a design called "bottleneck structure" is also introduced. This structure uses 1x1, 1x3 and 1x1 convolution layers in each residual block to reduce the dimension of the feature map and reduce the computational complexity. This design allows the residual network to handle deeper network structures without introducing too many parameters and computational burden.
[0106]
[0107]
[0108] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A classification and recognition method for iron ore LIBS data using a twin network fused with an autoencoder, characterized in that: The following steps are involved: S1: Collect iron ore spectrum data as original training data through laser induced breakdown spectrometer; S2: Perform dimensionality reduction on the original training data using the autoencoder, and use the reduced-dimensional data as the input of the training network; S3: Two identical branch networks are selected as twin networks, each of which processes one input spectral sample; the two branch networks are kept synchronized during the training process by sharing parameters; The step S2 uses an autoencoder to extract data features, and uses the data after the autoencoder dimension reduction as the input layer of the subsequent deep learning classification network; the autoencoder includes 3 linear layers, 3 linear rectification functions are activated, and the optimization function of back propagation selects the mean square error; The autoencoder is used for feature extraction and reconstruction of data; it consists of two main components, an encoder and a decoder; the goal of the autoencoder is to achieve self-representation of input data by learning a compressed representation and a decoder that reconstructs the input data from the representation; The training process of the autoencoder consists of two stages: Forward propagation: Pass the input data to the encoder to produce feature representation: ; Where W1: weight of forward propagation, b1: bias parameter of forward propagation; Backpropagation: The output of the encoder is passed to the decoder, and the reconstruction error is calculated by comparing the decoder output with the original input; then the backpropagation algorithm is used to update the weights and biases of the network to minimize the reconstruction error: ; Where W2: weight of back propagation, b2: bias parameter of back propagation; The objective function of the algorithm optimization is: ; The step S2 also includes normalizing the data as follows: , The branch network is a residual network, and the basic component unit of the residual network is a residual block. The training and performance of the network are optimized through cross-layer connection and residual learning. Each branch network includes a convolution layer, a pooling layer structure and a residual block to extract features and learn sample representations; In each residual block, the input data is processed through two or more convolutional layers and activation functions; the input data is then added to the residual connection to obtain the output of the residual block; 1x1, 1x3 and 1x1 convolutional layers are used in each residual block to reduce the dimension of the feature map and reduce the computational complexity, and the residual network removes the fully connected layer; The two branch networks share weights to obtain two vectors, and the Euclidean distance is used to calculate the difference between the two vectors; finally, the S-type activation function is used; The step S3 divides the data set into a training set, a validation set and a test set; Generate a corresponding "positive sample" for each sample, as well as a "negative sample" of a different category; the positive sample is the original sample, and the negative sample is a sample selected from other categories; Create pairs of input samples, each pair contains a positive sample and a negative sample; Adopt contrastive loss function, including boundary loss and distance loss between samples; ; N represents the sample size, that is, the number of paired samples; Dw is the Euclidean distance between the two outputs of the twin network: ; The Y value is either 1 or 0; if the two inputs are similar, Y=1, otherwise it is 0.
2. According to claim 1, a classification and recognition method for iron ore LIBS data using a twin network fused with an autoencoder is characterized in that: The training process of step S3 is as follows: Use the training data to train the twin network and minimize the defined loss function; Use the gradient descent algorithm to optimize and update the weights and biases of the network; Use the validation set to monitor the performance of the model and adjust parameters or stop training early based on the performance.
3. The classification and recognition method for iron ore LIBS data using a twin network fused with an autoencoder according to claim 2 is characterized in that: The step S3 also includes using a test set to evaluate the performance of the trained model on unseen data, and the test method is as follows: selecting the average spectrum of each type of iron ore sample as the standard sample of that type of sample, and inputting the unknown sample to be tested and the average spectrum into the twin network at the same time to obtain a prediction result; Calculate classification accuracy and confusion matrix indicators to evaluate the effectiveness of the model; For new spectral samples, they are input into the deployed model and classified according to the prediction results output by the model.
4. The classification and recognition method for iron ore LIBS data using a twin network fused with an autoencoder according to claim 1 is characterized in that: The residual network is composed of 50 layers, and the ratio of the number of training sets, validation sets and test sets is 8:1:1.
