A froth flotation grade prediction method based on adversarial training denoising autoencoder

Through the combination of adversarial training denoising autoencoder and multi-layer perceptron, the problem of noise interference in the flotation industry is solved, high accuracy and robust grade prediction is achieved, and the flotation process is optimized.

CN118823446BActive Publication Date: 2025-08-19CENT SOUTH UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410822516.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2024-05-06
Filing Date
2024-06-24
Publication Date
2025-08-19
Estimated Expiration
2044-06-24

AI Technical Summary

Technical Problem

In the flotation industry, the accuracy and reliability of foam image processing and grade prediction are disturbed by noise due to sensor sensitivity limitations, signal interference and industrial environment influence. The existing adversarial deep learning methods have complex challenges and are difficult to meet industrial production needs.

Method used

The combination of adversarial training denoising autoencoder and multi-layer perceptron is adopted to generate adversarial samples through adversarial training, optimize the robustness of the model, and use projection gradient descent optimizer to solve the minimum-maximum problem in adversarial training, extract potential features and perform grade prediction.

Benefits of technology

It improves the accuracy and robustness of grade prediction during foam flotation, optimizes production efficiency, reduces costs, and improves mineral extraction effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118823446B_ABST
    Figure CN118823446B_ABST
Patent Text Reader

Abstract

The present invention provides a method for predicting the grade of froth flotation based on an adversarially trained denoising autoencoder (Adv‑DAE). The PGD method is used to attack the original flotation image. After generating adversarial samples, the samples are input into the denoising autoencoder for feature extraction and data reconstruction. The encoder part of the trained Adv‑DAE model is combined with a multi-layer perceptron to establish a regression relationship model between the flotation froth image and the grade data, and the grade during the froth flotation process is predicted. The present invention does not require the preparation of a specific noise data set, but instead improves the noise resistance of the model through adversarial training. This method can effectively improve the robustness of the model under noisy data, thereby improving the accuracy of grade prediction under industrial site noise data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention is used in the field of image processing and mainly relates to a foam flotation grade prediction method based on adversarial training denoising autoencoder. Background Art

[0002] Flotation is a crucial component of the mining industry, playing a key role in extracting valuable minerals from ore. Within this industry, flotation froth image processing and grade prediction play a crucial role. By processing and analyzing froth images, ore particles suspended in the flotation cell can be quickly and accurately identified and classified, effectively improving beneficiation efficiency and enhancing the accuracy of grade prediction. During froth flotation, sensors are often used to collect key parameters such as ore composition, bubble concentration, and flotation cell level. This real-time data can be used to develop models for grade prediction, making froth flotation grade prediction an application of industrial soft sensor models. However, in current flotation processes, various noises are often generated due to sensor sensitivity limitations, signal interference, and the influence of the industrial environment. This severely impacts the accuracy and reliability of froth image processing and grade prediction.

[0003] To address this issue, adversarial deep learning has been introduced to industrial soft sensor model denoising, achieving some success. By introducing adversarial examples, the robustness of the model can be increased, improving the accuracy of model denoising. Furthermore, adversarial deep learning can be used to fill in missing data in industrial soft sensor models, thereby improving the model's prediction accuracy and stability. The goal of adversarial training can be formulated as a minimax optimization problem as shown below:

[0004] min θ E[max δ∈S L(x+δ,y;θ)]

[0005] Where δ is the perturbation and S is the set of allowed perturbations. The inner maximization term searches for adversarial inputs that produce high loss, while the outer minimization term updates the model weights to minimize this loss. Neural networks trained in this way are robust to adversarial attacks. During training, adversarial inputs X are generated by adding perturbations δ to the original inputs x. adv Generate X advCommonly used methods include the Fast Gradient Sign Method (FGSM), the Carlini-Wagner attack, and Projected Gradient Descent (PGD). PGD is an algorithm originally introduced in the field of computer vision for generating adversarial inputs. Its principle is to adjust the input data by adjusting the gradient associated with the loss function. By perturbing the input data in the gradient direction, PGD can effectively generate adversarial samples, thereby deceiving machine learning models. Due to its simplicity, efficiency, and compatibility, PGD has become the preferred method for dealing with input signal perturbations. However, directly adopting the original PGD equation may have some limitations and disadvantages, so appropriate modifications are needed.

[0006] Although the application of adversarial deep learning in industrial soft sensor model denoising has certain advantages, its complexity also brings certain challenges to model training and implementation. Therefore, it is necessary to further optimize the algorithm and model structure to improve the effectiveness of adversarial attacks and defenses to meet the actual needs of industrial production processes.

[0007] PGD: PGD (Projected Gradient Descent) is a commonly used optimization algorithm, widely used in adversarial machine learning. It is a variant of gradient descent that, at each iteration, projects the gradient onto a set of constraints to ensure that the updated parameters meet certain constraints. The core idea of this algorithm is to introduce a projection step based on gradient descent to ensure that the parameter update does not exceed the pre-set constraints. The PGD iteration steps are as follows:

[0008] 1. Calculate the gradient of the current parameters.

[0009] 2. Update the parameters according to the gradient direction.

[0010] 3. Project the updated parameters into the constraint set to ensure that they satisfy the constraints. Summary of the Invention

[0011] To solve the above problems, the present invention discloses a froth flotation grade prediction method based on adversarial training denoising autoencoder.

[0012] In order to achieve the above objectives, the present invention is implemented through the following technical solutions:

[0013] A method for predicting froth flotation grade based on adversarial training denoising autoencoder, comprising the following steps:

[0014] Step 1: photograph the foam in the flotation cell to obtain a foam image, and simultaneously record the process parameters of the froth flotation and the corresponding grade data;

[0015] Step 2: Perform image enhancement and normalization preprocessing on the foam image and form a data set with the corresponding process parameters and grade data, and divide the data set into a training set and a test set;

[0016] Step 3: Use a denoising autoencoder and a multi-layer perceptron based on adversarial training to jointly model the froth flotation image data and ore grade to form a grade prediction model. The grade prediction model is trained using the training set to obtain a trained grade prediction model. The trained grade prediction model is then tested using the test set. If the accuracy is greater than a preset threshold, the final grade prediction model is obtained. Otherwise, training continues.

[0017] Step 4: Input the current bubble image data and froth flotation process parameters into the final grade prediction model in real time to perform grade prediction, and adjust the froth flotation process parameters according to the prediction results.

[0018] As a further improvement, the process parameters of the froth flotation include dosage and stirring speed.

[0019] As a further improvement, in step 2, the steps of performing image enhancement and normalization preprocessing on the foam image are as follows:

[0020] The foam image is enhanced through grayscale adjustment, filtering and Canny edge detection algorithm, and then the pixel values in the enhanced foam image are normalized to between 0 and 1.

[0021] As a further improvement, in step 3, obtaining the trained quality prediction model includes the following steps: S31, creating adversarial samples of the training data set:

[0022] The denoising autoencoder consists of two mirror-symmetrical parts, an encoder and a decoder; the encoder is formed by three convolution blocks connected in series; each convolution block includes a convolution layer, an activation function, and a batch normalization layer in sequence; the feature map sizes output by the three convolution blocks are 512*512, 256*256, and 128*128 respectively;

[0023] Based on the image data in the training dataset S, create the final adversarial sample x adv :

[0024] After starting the adversarial search, the denoising autoencoder calculates the latent feature x latent Initial value of The calculation formula is:

[0025]

[0026] Where x=[x1,x2,...x i ,...x p] is the foam flotation image data input into the denoising autoencoder based on adversarial training. The image is cropped to a size of 512*512 after being captured by the industrial camera; p is the number of foam flotation images, x i is the i-th two-dimensional matrix of size 512*512. The elements in the matrix are the corresponding pixel values in the image. Each pixel value x i- The value of {m,n} is [0,1], where m and n represent the horizontal and vertical coordinates of the pixel respectively; latent is the potential feature of the input image projected into the low-dimensional space after being encoded by the encoder in the denoising autoencoder, W is the weight matrix, b is the bias vector, and σ() is a nonlinear activation function;

[0027] According to the structure of the encoder in the denoising autoencoder used, we get The calculation formula is as follows:

[0028] Conv1=ReLU(BN(Conv(x,W1)+b1))

[0029] Conv2=ReLU(BN(Conv(Conv1,W2)+b2))

[0030] Conv3=ReLU(BN(Conv(Conv2,W3)+b3))

[0031]

[0032] In the formula, Conv represents the convolution operation, BN represents batch normalization, ReLU is the activation function, x is the input image, Conv1, Conv2, and Conv3 represent the first layer convolution operation, the second layer convolution operation, and the third layer convolution operation respectively, and W l , b l is the weight and bias term of the lth layer convolution, l = 1, 2, 3;

[0033] Next, Gaussian noise is added to the froth flotation image data. The formula for generating the image after being contaminated by Gaussian noise is:

[0034] x guass =x+εε=clip(randn(μ,σ),0,1)

[0035] Where x guass is the image contaminated by Gaussian noise, ε is Gaussian noise; Gaussian noise is a random number that follows a Gaussian distribution with a mean of μ and a standard deviation of σ. Since the image pixel values have been normalized, clip() is used to ensure that the randomly generated noise range is between [0,1]; randn() represents the randn function;

[0036] Then use the PGD method to generate adversarial samples: set the target true label y, learning rate η, perturbation radius ε and number of iterations t, and add Gaussian noise to the original image x guass As the initial adversarial sample, an additional perturbation δ is added to the initial adversarial sample to create a guass Different adversarial examples x adv ; δ is determined by calculating the gradient of the loss function;

[0037] Use L ∞ The norm limits the perturbation δ to a preset L p norm, i.e. ‖δ‖ ∞ ≤ε, ε is the adversarial radius, which is a hyperparameter that controls the size of the perturbation; finally, the adversarial sample is projected back to L ∞ Update the adversarial sample within the range where the norm is less than ε; repeat the above steps until the preset number of iterations t is reached, stop the iteration, and obtain the final adversarial sample;

[0038] The adversarial sample update formula is as follows:

[0039]

[0040]

[0041] Where, L adv is the adversarial loss, which is used to guide the optimization direction when generating adversarial samples; i is the true label value of the i-th sample, is the i-th prediction value of the encoder in the denoising autoencoder after the adversarial attack, and a is the step size of the perturbation; is the adversarial sample at the k-th step; To counter the gradient of the loss function with respect to the input sample; the projection function Π(·) ensures that the adversarial sample Restricted to ||x adv -x|| ∞ ≤ within the ε sphere centered on ε;

[0042] The potential feature x latent The update formula is:

[0043]

[0044] Where, represents the potential features at the t-th iteration, η is the learning rate, Represents the gradient of the loss function with respect to , and finally gets x latent ;

[0045] During the denoising feature extraction process, gradient inversion continuously adjusts the adversarial training. After reaching the set number of iterations t, it is considered that the final generated adversarial sample meets the maximum difference between it and the original sample:

[0046]

[0047] Where ‖‖2 is the l2 norm;

[0048] S32. Input the generated adversarial sample into the denoising autoencoder to perform image reconstruction, optimize the parameters of the denoising autoencoder based on adversarial training, and extract the potential features based on the adversarial sample:

[0049] After obtaining the final adversarial sample, the final adversarial sample x adv Input into the denoising autoencoder;

[0050] The encoder part of the denoising autoencoder receives the adversarial example x adv , the adversarial sample x adv Convert to latent feature representation based on adversarial examples

[0051]

[0052] Specifically:

[0053]

[0054] Where Conv represents the convolution operation, BN represents batch normalization, ReLU is the activation function, ReLU(x)=max(0,x); x adv To input adversarial samples, are the weights and bias terms of the corresponding layer l;

[0055] The latent features are calculated based on the encoder part of the denoising autoencoder Reconstructed image vector

[0056] Latent features fed into the decoder part of the denoising autoencoder The feature map size is 128*128, and the two deconvolution layers use 3*3 convolution kernels to expand the feature map to 256*256 and 512*512 respectively: After each deconvolution layer, the sigmoid activation function is applied. With the batch normalization (BN) operation, nonlinearity is introduced to stabilize the training process and finally obtain the reconstructed image.

[0057] The reconstruction process is to solve the optimization problem:

[0058]

[0059] In the formula is x adv Reconstruction of L rec is the reconstruction loss function;

[0060] Taking into account the adversarial loss and reconstruction error, the total loss function is defined as:

[0061] L Adv-DAE =L rec +γL adv

[0062] Where, L rec is the reconstruction loss function introduced, L adv is the introduced adversarial loss function, γ is the balance L rec With L adv The hyperparameters of the relationship between them, in each iteration, take the sample as input, use the loss function L Adv-DAE Back propagation, calculating the gradient of the loss function Update the parameters in the denoising autoencoder until L Adv-DAE Convergence, that is, obtaining the trained denoising autoencoder model based on adversarial training;

[0063] S33, using multi-layer perceptron to predict mineral grade data:

[0064] The potential features obtained by encoding the adversarial sample by the encoder in the denoising autoencoder in step S32 are The corresponding real mineral grade data y i Input a multilayer perceptron with the latent feature representation as input and the quality data as output; the multilayer perceptron has two hidden layers, each containing 4 and 3 neurons respectively. The neurons in each hidden layer are connected to all the neurons in the previous layer, forming a fully connected feedforward neural network. The output calculation formula of the jth neuron in the rth hidden layer is:

[0065]

[0066] In the formula is the weighted input of the jth neuron in the rth layer, n (r-1) Indicates the number of neurons in the previous layer; is the connection weight between the jth neuron in the rth layer and the kth neuron in the r-1th layer, represents the output of the kth neuron in the previous layer, is the bias term of the jth neuron in the rth layer, is the output of the jth neuron in the rth layer, σ(·) is the activation function, and the activation function uses the Sigmoid function:

[0067]

[0068] The calculation formula of the output layer is:

[0069]

[0070] is the predicted value of the grade data output by the output layer, W T is the transpose of the output layer weight matrix, b is the bias of the output layer, and σ(·) is the sigmoid activation function;

[0071] The back propagation algorithm is used to train the multi-layer perceptron grade prediction model. The weights and bias terms of the multi-layer perceptron are iteratively optimized according to the gradient of the loss function to minimize the error between the predicted output and the actual grade data. The loss function calculation formula is:

[0072]

[0073] Where y i is the true grade label of the i-th sample, is the grade prediction value of the i-th sample obtained by the multi-layer perceptron, and n is the number of training samples. After the iterative update of the input training set is completed, the trained multi-layer perceptron grade prediction model is obtained.

[0074] As a further improvement, in step 3, the steps of testing the trained grade prediction model with the test set are as follows:

[0075] S34, test the trained joint grade prediction model using the test set:

[0076] The foam images in the test set and the corresponding mineral grade data are input into the trained foam flotation image processing and grade prediction model based on adversarial training, and the hyperparameters γ and perturbation radius ε are optimized; the foam images in the test set are encoded by the denoising autoencoder based on adversarial training to obtain the potential feature representation. Latent feature representation The grade data in the test set are input into the multi-layer perceptron, and the grade prediction value is output. The RMSE is calculated. If the RMSE value is lower than the set threshold h, the training stops and the final foam image and grade prediction model are obtained. Otherwise, the training continues. In this step, adversarial samples are generated and encoded. The calculation process is the same as S31-S32, and the process of the multi-layer perceptron outputting the grade prediction value is the same as S33.

[0077] Compared with the existing methods, the present invention has the following advantages:

[0078] The present invention improves the robustness of the DAE model by adding perturbations to the original image for adversarial training, introduces a projected gradient descent (PGD) optimizer to solve the minimum-maximum problem in the adversarial training process, and optimizes the parameters of the entire network. In addition, the potential feature representation learned by the autoencoder in the present invention is combined with a multi-layer perceptron to perform grade prediction. Noise is often present in the flotation process, and this model does not need to be trained with noisy data. Through adversarial training, it resists the interference of various noises, helps optimize the froth flotation process, and improves the accuracy and robustness of grade prediction. By timely predicting the grade during the froth flotation process, production efficiency can be optimized, costs can be reduced, and the effect of mineral extraction can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] Figure 1 This is a diagram of the denoising autoencoder architecture based on adversarial training;

[0080] Figure 2 Schematic diagram of convolutional blocks and deconvolutional blocks in the denoising autoencoder;

[0081] Figure 3 It is a taste prediction model composed of Adv-DAE and multi-layer perceptron;

[0082] Figure 4 It is the structure diagram of the multi-layer perceptron;

[0083] Figure 5 This is the flow chart for flotation foam image processing and grade prediction.

[0084] Specific implementation methods The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0085] This paper proposes a denoising autoencoder (Adv-DAE) model based on adversarial training to establish a mapping relationship model between flotation foam images and grades, such as Figure 1 As shown. With the denoising autoencoder (DAE) as the backbone of the Adv-DAE model and adversarial deep learning as the core method, the proposed method can train a robust anti-noise model without the need for a dataset containing multiple data noise features. This embodiment provides a method for predicting froth flotation grade based on adversarial training of denoising autoencoders, which specifically includes the following steps, as shown in the flowchart. Figure 5 As shown:

[0086] In S1, a high-resolution, high-speed camera captures real-time images of the surface foam in the flotation cell and transmits them to an image analysis card for subsequent processing. Sensors also collect relevant process parameter data, such as dosage and stirring speed. The foam rising from the stirred flotation cell is collected and scraped with a foam scraper to obtain solid mineral particle samples. The mineral samples are then measured using an X-ray fluorescence analyzer to obtain and record mineral grade data.

[0087] In S2, the collected foam images are enhanced through grayscale adjustment, filtering, and the Canny edge detection algorithm to improve image clarity and quality. The image data is shuffled, and 80% of the normal samples are extracted as the training set, with the remaining data used as the test set. All process variables are normalized to the range [0, 1] to mitigate the impact of inconsistent measurement scales.

[0088] S3, the specific steps of the invented froth flotation grade prediction method based on adversarial training denoising autoencoder are as follows:

[0089] S31, create adversarial examples for the training dataset:

[0090] First, the training data set S is input into the adversarial sample generator to start the adversarial search. The adversarial sample generator uses the PGD method. In the process of adversarial training using the PGD method, the encoder part of the denoising autoencoder based on adversarial training is also utilized. The denoising autoencoder consists of two mirror-symmetrical parts, the encoder and the decoder. The encoder structure in the present invention is shown in the figure, which mainly includes a convolution layer, an activation function, and a batch normalization layer (Batch Normalization, BN). The convolution layer, the activation function, and the BN layer constitute a convolution block. The encoder is composed of three convolution blocks connected together, and the output feature map sizes are 512*512, 256*256, and 128*128, respectively.

[0091] After starting the adversarial search, we first use the encoder in the adversarially trained denoising autoencoder to calculate the latent feature x latent Initial value The calculation formula is:

[0092]

[0093] Where x=[x1,x2,...x i ,...x p ] is the foam flotation image data in the denoising autoencoder based on adversarial training. The image is cropped to a size of 512*512 after being shot by an industrial camera; p is the number of images, x iIt is a two-dimensional matrix of size 512*512. The elements in the matrix are the corresponding pixel values in the image. Each pixel value x i- The value of {m,n} is [0,1]. latent The latent features of the input image after being encoded by the encoder in the denoising autoencoder are projected into the low-dimensional space. W is a weight matrix, b is a bias vector, and σ(x) is a nonlinear activation function.

[0094] According to the structure of the encoder in the autoencoder used, we get The calculation formula is as follows:

[0095] Conv1=ReLU(BN(Conv(x,W1)+b1))

[0096] Conv2=ReLU(BN(Conv(Conv1,W2)+b2))

[0097] Conv3=ReLU(BN(Conv(Conv2,W3)+b3))

[0098]

[0099] Where Conv represents the convolution operation, BN represents batch normalization, ReLU is the activation function, x is the input image, and W is the s ,b s are the weights and bias terms of the corresponding s-th layer.

[0100] Next, we add Gaussian noise to the froth flotation image data to generate an image contaminated by Gaussian noise. By adding Gaussian noise, we expand the data and enable the autoencoder to learn denoising features to improve robustness and generalization. The formula for generating an image contaminated by Gaussian noise is:

[0101] x guass =x+ε

[0102] ε=clip(randn(μ,σ),0,1)

[0103] Where x is the flotation foam image input to the adversarial training-based autoencoder, x guass is the image contaminated by Gaussian noise, and ε is the Gaussian noise. Gaussian noise is a random number that follows a Gaussian distribution with mean μ and standard deviation σ. Since the image pixel values have been normalized, we use clip() here to ensure that the randomly generated noise ranges between [0, 1].

[0104] Then, based on the training dataset S, we create an adversarial sample: add Gaussian noise to the original image x guassAs the initial adversarial sample, add an additional perturbation δ to it to create an adversarial sample x that is different from the original sample adv δ is determined by calculating the gradient of the loss function, and the gradient is added to the current adversarial sample through gradient ascent to generate adversarial; in order to ensure that the generated adversarial sample X adv A certain degree of similarity with the original sample x limits the perturbation δ to a certain L p L p The formula for calculating the norm is:

[0105]

[0106] Where, δ i is the i-th element of the perturbation vector, and n is the dimension of the perturbation vector.

[0107] The following describes the steps of using PGD to create adversarial samples: Given the original sample x, add Gaussian noise to x guass , target true label y, learning rate η, perturbation range ε and number of iterations t; first initialize the adversarial sample x adv (0) =x guass ; Then calculate the loss function on the adversarial sample, backpropagate the loss function, calculate the gradient of the adversarial sample with respect to the loss function, and update the potential feature x latent , and perform a certain amount of gradient clipping, making slight adjustments to the adversarial sample along the gradient direction to limit the size of the perturbation; finally, project the adversarial sample back to L ∞ When the norm is less than ε, update the adversarial sample; repeat the above steps until the preset number of iterations t is reached, stop the iteration, and obtain the adversarial sample.

[0108] The adversarial sample update formula is as follows:

[0109]

[0110] Where, L adv is the adversarial loss, which is used to guide the optimization direction when generating adversarial samples; i is the true label value of the i-th value, is the i-th prediction value of the encoder in the denoising autoencoder after the adversarial attack, a is the perturbation step size. is the adversarial sample at the k-th step; To counter the gradient of the loss function to the input sample. The present invention uses L ∞ The norm limits the perturbation to a certain L p norm, i.e. ‖δ‖ ∞ ≤ε, ε is the adversarial radius, which is a hyperparameter that controls the size of the perturbation. The projection function II(·) ensures that the adversarial sample Restricted to ||x adv -x|| ∞ ≤ε is within the ε sphere centered on ε.

[0111] Latent feature x latent The update formula is:

[0112]

[0113] Where, represents the potential features at the t-th iteration, η is the learning rate, Represents the gradient of the loss function with respect to , and finally gets x latent .

[0114] During the denoising feature extraction process, gradient inversion continuously adjusts the adversarial training to maximize the difference between the adversarial sample and the original sample. Therefore, after reaching the set number of iterations t, it can be considered that the final generated adversarial sample meets the maximum difference between the adversarial sample and the original sample:

[0115]

[0116] Where ‖‖2 is the l2 norm.

[0117] By making the difference between adversarial examples and original examples as large as possible, the features extracted from the network are more likely to be distinguishable. This allows the model to learn more high-level, effective information shared between the latent adversarial data and the original data. If the original example can still be reconstructed despite significant feature differences, it indicates that the model has learned important features as deeply as possible while filtering out less important shallow features.

[0118] S32, input the generated adversarial sample into the denoising autoencoder to perform image reconstruction, optimize the parameters of the denoising autoencoder based on adversarial training, and extract potential features based on the adversarial sample:

[0119] After making the adversarial sample, the adversarial sample x adv Input denoising autoencoder. The autoencoder structure used in the present invention is as follows Figure 1 As shown in [1], the denoising autoencoder consists of a pair of mirrored encoder and decoder layers. In the encoder, the convolutional layer, activation function, and batch normalization (BN) layer together form a convolutional block. The entire encoder is composed of three such convolutional blocks connected in series, where the output feature map size is reduced to 512x512, 256x256, and 128x128, respectively. Correspondingly, in the decoder, the deconvolutional layer, activation function, and BN layer form a deconvolutional block. After processing through two such deconvolutional blocks, the feature map size is expanded to 256*256 and 512*512, respectively.

[0120] The encoder part receives the adversarial sample image x adv , the encoder converts it into a latent feature representation based on the adversarial sample

[0121]

[0122] Specifically:

[0123]

[0124] Where Conv represents the convolution operation, BN represents batch normalization, ReLU is the activation function, ReLU(x)=max(0,x); x adv To input the adversarial sample image, are the weights and biases of the corresponding layer l.

[0125] The latent features are obtained according to the calculation in the encoder part Reconstructed image vector

[0126]

[0127] Latent features input to the decoder part The feature map size is 128*128, and the first deconvolution layer uses a 3*3 convolution kernel to expand the feature map to 256*256:

[0128]

[0129] Where z1 is the output result of the first deconvolution layer, and Deconv is the deconvolution operation;

[0130] After each deconvolution layer, a sigmoid activation function is applied Combined with batch normalization (BN), nonlinearity is introduced to stabilize the training process:

[0131] Deconv1=BN(σ(z1))

[0132] Where Deconv1 is the result after the first layer of deconvolution block processing.

[0133] The second deconvolution layer expands the feature map to a size of 512*512:

[0134] z2=Deconv 3×3 (Deconv1)

[0135] Then the reconstructed image is obtained through activation function and batch normalization

[0136]

[0137] The reconstruction process is to solve the optimization problem:

[0138]

[0139] In the formula is x adv Reconstruction of L rec is the reconstruction loss function. If the reconstructed If it is very close to the original sample x, it means that the model has ignored the influence of the perturbation as much as possible and learned the deep and effective features of the original sample. In order to train the model to achieve the best robustness, it is necessary to simultaneously meet the difference L between the adversarial sample and the original sample. adv Maximize and reconstruct the loss function L rec Therefore, considering the adversarial loss and reconstruction error, the total loss function is defined as:

[0140] L Adv-DAE =L rec +γL adv

[0141] Where, L rec is the reconstruction loss function introduced, L adv is the introduced adversarial loss function, γ is the balance L rec With L adv The hyperparameters of the relationship between them, in each iteration, take the sample as input, use the loss function L Adv-DAE Back propagation, calculating the gradient of the loss function Update the parameters in the denoising autoencoder until L Adv-DAE Convergence means that the trained denoising autoencoder model based on adversarial training is obtained. θ represents the parameters in the autoencoder, including the weights and biases in the convolutional and deconvolutional layers. The parameter update formula is:

[0142]

[0143] The complete input data adversarial training algorithm flow chart is as follows:

[0144]

[0145]

[0146] S33, using multi-layer perceptron to predict mineral grade data:

[0147] The potential features obtained by encoding the adversarial sample by the encoder in the denoising autoencoder in step S32 are The corresponding real mineral grade data y iThe latent feature representation is fed into a multilayer perceptron (MLP) with the grade data as output. This MLP has two hidden layers, each containing four and three neurons, respectively. Each neuron in each hidden layer is connected to all neurons in the previous layer, forming a fully connected feedforward neural network. The MLP network parameters are optimized using a backpropagation algorithm to ensure that the predicted value is as close as possible to the actual mineral grade data. The output of the jth neuron in the rth hidden layer is calculated as follows:

[0148]

[0149] Where, is the weighted input of the jth neuron in the rth layer, n (r-1) Indicates the number of neurons in the previous layer; is the connection weight between the jth neuron in the rth layer and the kth neuron in the r-1th layer, represents the output of the kth neuron in the previous layer, is the bias term of the jth neuron in the rth layer, is the output of the jth neuron in the rth layer, σ(·) is the activation function, and the activation function uses the Sigmoid function:

[0150]

[0151] The calculation formula of the output layer is:

[0152]

[0153] is the predicted value of the grade data output by the output layer, W T is the transpose of the output layer weight matrix, b is the bias of the output layer, and σ(·) is the sigmoid activation function;

[0154] The back propagation algorithm is used to train the multi-layer perceptron grade prediction model. The weights, biases and other parameters of the multi-layer perceptron are iteratively optimized according to the gradient of the loss function to minimize the error between the predicted output and the actual grade data. The loss function calculation formula is:

[0155]

[0156] Where y i is the true grade label of the i-th sample, is the grade prediction value obtained by the multilayer perceptron for the i-th sample, and n is the number of training samples. After iterative updates of the input training set, the trained multilayer perceptron grade prediction model is obtained. The adversarial training-based denoising autoencoder trained in S32 and the multilayer perceptron trained in S33 are combined to form the adversarial training-based froth flotation image processing and grade prediction model.

[0157] In this paper, the neural network was trained using the Adam optimizer with an initial learning rate of 0.001. The mini-batch size was set to 128 samples, and the total number of epochs in the pre-training phase was 301. The parameters of the adversarial training (attack step size α, attack amplitude ε, and number of attacks) were set to 0.05, 0.2, and 10, respectively.

[0158] S34, test the trained joint grade prediction model using the test set:

[0159] The foam images in the test set and the corresponding mineral grade data are input into the trained foam flotation image processing and grade prediction model based on adversarial training, and the hyperparameters γ and perturbation radius ε are optimized. The foam images in the test set are encoded by the denoising autoencoder based on adversarial training to obtain the latent feature representation. Latent feature representation The grade data in the test set are input into the multi-layer perceptron, and the grade prediction value is output. The RMSE is calculated. If the RMSE value is lower than the set threshold h, the training stops and the final foam image and grade prediction model is obtained. Otherwise, the training continues. In this step, adversarial samples are generated and encoded. The calculation process is the same as S31-S32, and the process of the multi-layer perceptron outputting the grade prediction value is the same as S33.

[0160] S4, use the trained model to predict the mineral grade of new samples:

[0161] The new flotation froth flotation image data collected to be tested is input into the trained model (denoising autoencoder based on adversarial training), and the predicted value of the mineral grade is obtained through a multi-layer perceptron. The mean squared error (MSE) is compared with the actual grade data of the sample to be tested to evaluate the model performance. According to the prediction results, the operating parameters of the flotation process, such as the dosage and stirring speed, are adjusted.

[0162]

[0163] where y i is the true grade label of the i-th sample, is the grade prediction value of the i-th sample obtained through model prediction, and n is the total number of samples.

[0164] Table 1 below compares the denoising performance of five models under six conditions on two basic datasets. In the first case, no noise is added; in the remaining cases, different types of noise (Gaussian, speckle, Rayleigh, gamma, and Poisson) are added to comprehensively test model performance. The darkened portion indicates the optimal method in that case. As can be seen, on the FASHION-MNIST dataset, our proposed Adv-DAE achieves optimal performance under most noise conditions. Even under Poisson noise, the gap between our method and the optimal method, ARAE, is only 0.002. On the CIFAR-10 dataset, our method achieves the best denoising performance across all noise types.

[0165] Table 1 Comparison of denoising performance of models on test datasets

[0166]

[0167] The above description is merely a preferred embodiment of the present invention and does not constitute any form of limitation to the present invention. Any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention shall still fall within the scope of the technical solution of the present invention.

Claims

1. A method for predicting froth flotation grade based on adversarial training denoising autoencoder, characterized in that: The following steps are involved: Step 1: photographing the foam in the flotation cell to obtain a foam image, and simultaneously recording the process parameters of the froth flotation and the corresponding grade data; the process parameters of the froth flotation include the dosage and the stirring speed; Step 2: Perform image enhancement and normalization preprocessing on the foam image and form a data set with the corresponding process parameters and grade data, and divide the data set into a training set and a test set; Step 3: Use a denoising autoencoder and a multi-layer perceptron based on adversarial training to jointly model the froth flotation image data and ore grade to form a grade prediction model. The grade prediction model is trained using the training set to obtain a trained grade prediction model. The trained grade prediction model is then tested using the test set. If the accuracy is greater than a preset threshold, the final grade prediction model is obtained. Otherwise, training continues. Obtaining the trained grade prediction model includes the following steps: S31, create adversarial examples for the training dataset: The denoising autoencoder consists of two mirror-symmetrical parts, an encoder and a decoder; the encoder is formed by three convolution blocks connected in series; each convolution block includes a convolution layer, an activation function, and a batch normalization layer in sequence; the feature map sizes output by the three convolution blocks are 512*512, 256*256, and 128*128 respectively; Based on the image data in the training dataset S, create the final adversarial sample x adv : After starting the adversarial search, the denoising autoencoder calculates the latent feature x latent Initial value of The calculation formula is: Where x=[x1,x2,...x i ,...x p ] is the foam flotation image data input into the denoising autoencoder based on adversarial training. The image is cropped to a size of 512*512 after being captured by the industrial camera; p is the number of foam flotation images, x i is the i-th two-dimensional matrix of size 512*512. The elements in the matrix are the corresponding pixel values in the image. Each pixel value x i- The value of {m,n} is [0,1], where m and n represent the horizontal and vertical coordinates of the pixel respectively; latent is the potential feature of the input image projected into the low-dimensional space after being encoded by the encoder in the denoising autoencoder, W is the weight matrix, b is the bias vector, and σ() is a nonlinear activation function; According to the structure of the encoder in the denoising autoencoder used, we get The calculation formula is as follows: Conv1=ReLU(BN(Conv(x,W1)+b1)) Conv2=ReLU(BN(Conv(Conv1,W2)+b2)) Conv3=ReLU(BN(Conv(Conv2,W3)+b3)) In the formula, Conv represents the convolution operation, BN represents batch normalization, ReLU is the activation function, x is the input image, Conv1, Conv2, and Conv3 represent the first layer convolution operation, the second layer convolution operation, and the third layer convolution operation respectively, and W l , b l is the weight and bias term of the lth layer convolution, l = 1, 2, 3; Next, Gaussian noise is added to the froth flotation image data. The formula for generating the image after being contaminated by Gaussian noise is: x guass =x+e g e g =clip(randn(μ,σ),0,1) Where x guass is the image contaminated by Gaussian noise, ε g is Gaussian noise; Gaussian noise is a random number that follows a Gaussian distribution with a mean of μ and a standard deviation of σ. Since the image pixel values have been normalized, clip() is used to ensure that the randomly generated noise range is between [0,1]. randn() represents the randn function. Then use the PGD method to generate adversarial samples: set the hyperparameters of the adversarial attack, including the target true label y, the adversarial perturbation step size a, the adversarial radius ε and the number of iterations t, and add Gaussian noise to the original image x guass As the initial adversarial sample, an additional adversarial perturbation δ is added to the initial adversarial sample to create a guass Different adversarial examples x adv ; δ is determined by calculating the gradient of the loss function; Use L ∞ The norm limits the adversarial perturbation δ to a preset L p norm, i.e. ‖δ‖ ∞ ≤ε, ε is the adversarial radius, which is a hyperparameter that controls the total amplitude of the adversarial perturbation; finally, the adversarial sample is projected back to L ∞ Update the adversarial sample within the range where the norm is less than ε; repeat the above steps until the preset number of iterations t is reached, stop the iteration, and obtain the final adversarial sample; The adversarial sample update formula is as follows: Where, L adv is the adversarial loss, which is used to guide the optimization direction when generating adversarial samples; i is the true label value of the i-th sample, is the i-th prediction value of the encoder in the denoising autoencoder after the adversarial attack, and a is the step size of the adversarial perturbation; is the adversarial sample at the k-th step; To counter the gradient of the loss function to the input sample; the projection function Π(·) ensures that the adversarial sample Restricted to ||x adv -x|| ∞ ≤ within the ε sphere centered on ε; The latent feature x latent The update formula is: Where, represents the potential features at the t-th iteration, η is the learning rate, Represents the gradient of the loss function with respect to , and finally gets x latent ; During the denoising feature extraction process, gradient inversion continuously adjusts the adversarial training. After reaching the set number of iterations t, it is considered that the final generated adversarial sample meets the maximum difference between it and the original sample: Where ‖‖2 is the l2 norm; S32. Input the generated adversarial sample into the denoising autoencoder to perform image reconstruction, optimize the parameters of the denoising autoencoder based on adversarial training, and extract the potential features based on the adversarial sample: After obtaining the final adversarial sample, the final adversarial sample x adv Input into the denoising autoencoder; The encoder part of the denoising autoencoder receives the adversarial example x adv , the adversarial sample x adv Convert to latent feature representation based on adversarial examples Specifically: Where Conv represents the convolution operation, BN represents batch normalization, ReLU is the activation function, ReLU(x)=max(0,x); x adv To input adversarial samples, is the weight and bias term of the corresponding layer l; the potential features are calculated based on the encoder part of the denoising autoencoder Reconstructed image vector Latent features fed into the decoder part of the denoising autoencoder The feature map size is 128*128, and the two deconvolution layers use 3*3 convolution kernels to expand the feature map to 256*256 and 512*512 respectively: After each deconvolution layer, a sigmoid activation function is applied With the batch normalization (BN) operation, nonlinearity is introduced to stabilize the training process and finally obtain the reconstructed image. The reconstruction process is to solve the optimization problem: In the formula is x adv Reconstruction of L rec is the reconstruction loss function; Taking into account the adversarial loss and reconstruction error, the total loss function is defined as: THE Adv-DAE =L rec +γL adv Where, L rec is the reconstruction loss function introduced, L adv is the introduced adversarial loss function, γ is the balance L rec With L adv The hyperparameters of the relationship between them, in each iteration, take the sample as input, use the loss function L Adv-DAE Back propagation, calculating the gradient of the loss function Update the parameters in the denoising autoencoder until L Adv-DAE Convergence, that is, obtaining the trained denoising autoencoder model based on adversarial training; S33, using multi-layer perceptron to predict mineral grade data: The potential features obtained by encoding the adversarial sample by the encoder in the denoising autoencoder in step S32 are The corresponding real mineral grade data y i Input a multilayer perceptron with the latent feature representation as input and the quality data as output; the multilayer perceptron has two hidden layers, each containing 4 and 3 neurons respectively. The neurons in each hidden layer are connected to all the neurons in the previous layer, forming a fully connected feedforward neural network. The output calculation formula of the jth neuron in the rth hidden layer is: Where, is the weighted input of the jth neuron in the rth layer, n (r-1) Indicates the number of neurons in the previous layer; is the connection weight between the jth neuron in the rth layer and the kth neuron in the r-1th layer, represents the output of the kth neuron in the previous layer, is the bias term of the jth neuron in the rth layer, is the output of the jth neuron in the rth layer, σ(·) is the activation function, and the activation function uses the Sigmoid function: The calculation formula of the output layer is: is the predicted value of the grade data output by the output layer, W T is the transpose of the output layer weight matrix, b is the bias of the output layer, and σ(·) is the sigmoid activation function; The back propagation algorithm is used to train the multi-layer perceptron grade prediction model. The weights and bias terms of the multi-layer perceptron are iteratively optimized according to the gradient of the loss function to minimize the error between the predicted output and the actual grade data. The loss function calculation formula is: Where y i is the true grade label of the i-th sample, is the grade prediction value of the i-th sample obtained by the multi-layer perceptron, and n is the number of training samples. After the iterative update of the input training set is completed, the trained multi-layer perceptron grade prediction model is obtained. Step 4: Input the current bubble image data and froth flotation process parameters into the final grade prediction model in real time to perform grade prediction, and adjust the froth flotation process parameters according to the prediction results.

2. The method for predicting froth flotation grade based on adversarial training denoising autoencoder according to claim 1, characterized in that: In step 2, the steps of image enhancement and normalization preprocessing of the foam image are as follows: the foam image is enhanced by grayscale adjustment, filtering processing and Canny edge detection algorithm, and then the pixel values in the enhanced foam image are normalized to between 0 and 1.

3. The method for froth flotation image processing and grade prediction based on adversarial training denoising autoencoder according to claim 1, characterized in that: In step 3, the steps of testing the trained grade prediction model using the test set are as follows: S34, test the trained joint grade prediction model using the test set: The foam images in the test set and the corresponding mineral grade data are input into the trained foam flotation image processing and grade prediction model based on adversarial training to evaluate the performance of the model and optimize the hyperparameters γ and adversarial radius ε. The foam images in the test set are encoded by the denoising autoencoder based on adversarial training to obtain the latent feature representation. Latent feature representation The grade data in the test set are input into the multi-layer perceptron, the grade prediction value is output, and the RMSE is calculated. If the RMSE value is lower than the set threshold h, the training stops and the final foam image and grade prediction model are obtained. Otherwise, the training continues.

Citation Information

Patent Citations

  • Image data extraction and neural network modeling-based platinum flotation grade estimation method

    CN104331714A

  • Preprocessing defense method aiming at target detection confrontation attack

    CN114723663A