Ore sorting method and computer storage medium based on adaptive threshold semi-supervision

Through the adaptive threshold semi-supervised ore sorting method, the ResNet-CA-AUX model and adaptive threshold adjustment are used to optimize the network model, solving the problems of high cost and low precision in the existing technology, and achieving efficient and low-cost ore sorting.

CN115937161BActive Publication Date: 2025-08-19EAST CHINA JIAOTONG UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211629189.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-16
Publication Date
2025-08-19
Estimated Expiration
2042-12-16

AI Technical Summary

Technical Problem

In the prior art, ore sorting methods based on convolutional neural networks require a large number of labeled samples for training, resulting in high labor and time costs, and the semi-supervised learning methods cannot effectively utilize labelless data, which is prone to false pseudo-labels, affecting the selection accuracy.

Method used

The ore sorting method with adaptive threshold semi-supervised is adopted. By constructing the ResNet-CA-AUX model, combining adaptive threshold adjustment and KL divergence loss, the network model is optimized, and a small number of labeled samples are used for training, enhancing the robustness and sorting accuracy of the model.

Benefits of technology

High-precision and low-cost large-scale ore sorting are achieved, reducing the cost brought by manual label data, improving on-site sorting efficiency, adapting to ore source changes and ray attenuation, and reducing the probability of false labels occurring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115937161B_ABST
    Figure CN115937161B_ABST
Patent Text Reader

Abstract

The present invention relates to an ore sorting method and computer storage medium based on adaptive threshold semi-supervision. The method comprises inputting labeled ore samples into a network model to obtain a first prediction result, discarding the first prediction results that exceed the labeled adaptive threshold α, and calculating the cross-entropy loss between the remaining first prediction results and their true labels; processing unlabeled ore samples and inputting them into the network model to obtain a first prediction output result and a second prediction output result; calculating a KL divergence loss based on the first preset output result and the second prediction output result, summing the cross-entropy loss and the KL divergence loss and performing backpropagation to optimize the network model; training the network model, and then performing ore sorting based on the trained network model. By adjusting the training strategy through an adaptive threshold, the present invention achieves model training results close to supervised learning with a small number of labeled samples.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of ore sorting, and more particularly to an ore sorting method based on self-adaptive threshold semi-supervision and a computer storage medium. Background Art

[0002] Amid the rapid development of artificial intelligence, current mineral processing equipment manufacturers are generally adopting the latest X-ray imaging and AI recognition technology. Convolutional neural network-based recognition technology is one of the mainstream image recognition methods today, effectively extracting ore features and improving sorting accuracy. However, this type of recognition technology relies on supervised learning and requires a large number of labeled samples for model training and testing, which increases the labor and time costs of sampling and labeling. Furthermore, for X-ray imaged ores, not only does the ore grade fluctuate, but the attenuation of the radiation itself also causes the overall image data distribution to change over time, forcing manual labeling of all new samples for each retraining.

[0003] The task of semi-supervised learning is to train a model using limited labeled data and a large amount of unlabeled data to achieve better performance. A key challenge in semi-supervised learning is how to fully extract effective information from unlabeled data. Currently popular semi-supervised learning methods use a fixed confidence threshold to force the model to focus only on labeled and unlabeled data that meets the threshold, while ignoring other labeled and unlabeled data. This not only fails to effectively learn from the data, but also increases the probability of false positives. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a semi-supervised ore sorting method and computer storage medium based on adaptive thresholds for the above-mentioned problems in the prior art. By utilizing a network model to extract image features and adjusting the training strategy through adaptive thresholds, the model training effect with a small number of labeled samples is close to that of supervised learning, thereby achieving high-precision, low-cost, and large-scale ore sorting.

[0005] The technical solution adopted by the present invention to solve the technical problem is to construct an adaptive threshold semi-supervised ore sorting method, including:

[0006] S1. Collecting ore samples and labeling some of the ore samples to obtain labeled ore samples and unlabeled ore samples;

[0007] S2. Input the labeled ore sample into the network model to obtain a first prediction result, compare the first prediction result with a labeled adaptive threshold, discard the first prediction results greater than the labeled adaptive threshold α, and calculate the cross entropy loss between the remaining first prediction results and their true labels;

[0008] S3. Process the unlabeled ore sample to obtain a first processed sample, a second processed sample, a third processed sample, and a fourth processed sample, input the first processed sample and the second processed sample into the network model to obtain a first prediction output result, and input the third processed sample and the fourth processed sample into the network model to obtain a second prediction output result;

[0009] S4. Obtaining a KL divergence loss based on the first preset output result and the second predicted output result, adding the cross entropy loss and the KL divergence loss and performing back propagation to optimize the network model;

[0010] S5. Adjust the hyperparameter learning rate and optimizer method of the network model and repeatedly execute steps S2-S4 to train the network model, and then perform ore sorting based on the trained network model.

[0011] In the semi-supervised ore sorting method with adaptive threshold according to the present invention, in step S2, the value range of the marked adaptive threshold α is as follows:

[0012]

[0013] Where i represents the current iteration number, which is a positive integer; α(i) represents the value generated by the annotation adaptive threshold α after the i-th iteration; k represents the sinusoidal rise after the k-th iteration; μ min represents the minimum value of the annotation adaptive threshold; μ max represents the maximum value of the annotation adaptive threshold;

[0014] The cross entropy loss Where N represents the number of labeled ore samples; x i represents the i-th ore sample; y i represents the true label of the i-th sample; P represents the maximum category probability of the predicted sample.

[0015] In the adaptive threshold semi-supervised ore sorting method of the present invention, step S3 further includes:

[0016] S31, performing weak enhancement and strong enhancement on the unlabeled ore sample to obtain a first processed sample and a second processed sample, respectively, and introducing gradient noise into the first processed sample and the second processed sample to generate the third processed sample and the fourth processed sample, respectively;

[0017] S32, inputting the first processed sample and the second processed sample into the network model to obtain a first main classification prediction result, a second main classification prediction result, a first auxiliary classification prediction result, and a second auxiliary classification prediction result corresponding to the main classifier and the auxiliary classifier, respectively;

[0018] S33. Input the third processed sample and the fourth processed sample into the network model to obtain a third main classification prediction result, a fourth main classification prediction result, a third auxiliary classification prediction result and a fourth auxiliary classification prediction result corresponding to the main classifier and the auxiliary classifier respectively.

[0019] In the self-adaptive threshold semi-supervised ore sorting method of the present invention, in step 31, let the unlabeled ore sample U = [U1, U2, ..., U N ]∈R N*D , where R represents a real number set, N represents the number of samples, and D represents the feature dimension; random noise γ that conforms to the standard normal distribution is injected into the unlabeled ore sample U, and then the gradient noise is obtained through the back propagation of the network model

[0020]

[0021] Among them D kl is the KL divergence loss calculation function, i represents the number of iterations, θ represents the weight of the network model, u i represents the unlabeled ore sample under the i-th iteration, γ represents the random noise of normal distribution; P(y|u i ,θ) represents the input unlabeled ore sample u i Then we get the probability that the output category is y.

[0022] In the adaptive threshold semi-supervised ore sorting method of the present invention, step S4 further includes:

[0023] S41, comparing the third main classification prediction result and the third auxiliary classification prediction result with an unlabeled adaptive threshold β, retaining the third main classification prediction result and the third auxiliary classification prediction result that are greater than the unlabeled adaptive threshold β, and discarding the rest;

[0024] S42, performing a KL divergence loss on the third main classification prediction result and the third auxiliary classification prediction result obtained in step S41, the first main classification prediction result and the first auxiliary classification prediction result to obtain a first KL divergence loss;

[0025] S43, comparing the fourth main classification prediction result and the fourth auxiliary classification prediction result with the unlabeled adaptive threshold β, retaining the fourth main classification prediction result and the fourth auxiliary classification prediction result that are greater than the unlabeled adaptive threshold β, and discarding the rest;

[0026] S44, performing KL divergence loss on the fourth main classification prediction result and the fourth auxiliary classification prediction result obtained in step S43, the second main classification prediction result, and the second auxiliary classification prediction result to obtain a second KL divergence loss;

[0027] S45 , performing KL divergence loss on the first main classification prediction result and the first auxiliary classification prediction result, the second main classification prediction result and the second auxiliary classification prediction result to obtain a third KL divergence loss.

[0028] In the semi-supervised ore sorting method with adaptive threshold according to the present invention, in step S4, the unlabeled adaptive threshold β satisfies

[0029] Where i represents the number of iterations, c represents the category, and τ is the set fixed threshold;

[0030] represents the number of pseudo labels of category c in the i-th iteration, for Normalized result

[0031]

[0032] The KL divergence loss

[0033] N represents the number of labeled ore samples; u i represents the unlabeled ore sample under the i-th iteration; γ represents the random noise of the normal distribution; d represents the gradient noise; P represents the maximum category probability of the predicted sample.

[0034] In the adaptive threshold semi-supervised ore sorting method of the present invention, the network model includes a ResNet-CA-AUX model;

[0035] The ResNet-CA-AUX model includes a first main component, two first ResNet-CA components, two second ResNet-CA components, two third ResNet-CA components, two fourth ResNet-CA components, a second main component, a main classifier, a first auxiliary component, a second auxiliary component, a third auxiliary component and an auxiliary classifier;

[0036] The first main component is sequentially connected to the two first ResNet-CA components, the two second ResNet-CA components, the two third ResNet-CA components, the two fourth ResNet-CA components, the second main component and the main classifier;

[0037] The first auxiliary component is connected between the second ResNet-CA component and the third ResNet-CA component, and is simultaneously connected to the second auxiliary component, the third auxiliary component and the auxiliary classifier in sequence.

[0038] In the adaptive threshold semi-supervised ore sorting method described in the present invention, each ResNet-CA component includes a first pooling layer, a second pooling layer, a merged convolution layer, a batch normalization activation layer, a first convolution layer, a second convolution layer, a first activation layer, a second activation layer, and an output layer. The first pooling layer and the second pooling layer respectively receive input residuals and are sequentially connected to the merged convolution layer and the batch normalization activation layer. The first convolution layer is connected to the batch normalization activation layer and the first activation layer. The second convolution layer is connected to the batch normalization activation layer and the second activation layer. The first activation layer and the second activation layer are connected to the output layer.

[0039] In the adaptive threshold semi-supervised ore sorting method described in the present invention, the first main component includes a convolution layer, a normalized network layer, an activation function layer and a pooling layer; the second main component includes an adaptive average pooling layer and a fully connected layer; the first auxiliary component includes an adaptive pooling layer; the second auxiliary component includes a convolution layer, a normalized network layer and an activation function layer; the third auxiliary component includes a first fully connected layer, an activation function layer, a deactivation layer and a second fully connected layer.

[0040] The technical solution adopted by the present invention to solve its technical problem is to construct a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the adaptive threshold semi-supervised ore sorting method is implemented.

[0041] The ore sorting method and computer storage medium based on adaptive threshold semi-supervision of the present invention achieve a model training effect close to supervised learning with a small number of labeled samples by utilizing a network model to extract image features and adjusting the training strategy through adaptive threshold, thereby realizing high-precision, low-cost, and large-scale ore sorting. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:

[0043] Figure 1 is a flow chart of a preferred embodiment of the adaptive threshold semi-supervised ore sorting method of the present invention;

[0044] Figures 2A-2D The ore image data of the Fankou lead-zinc mine sampled by the adaptive threshold semi-supervised ore sorting method of the present invention;

[0045] Figure 3 A schematic structural diagram of a ResNet-CA-AUX model according to a preferred embodiment of the present invention is shown;

[0046] Figure 4 yes Figure 3 Schematic diagram of the structure of the ResNet-CA component of the ResNet-CA-AUX model shown;

[0047] Figure 5 is a schematic diagram of the relationship between the labeling adaptive threshold and the number of iterations according to a preferred embodiment of the present invention;

[0048] Figure 6 is a schematic diagram of introducing gradient noise into a sample according to a preferred embodiment of the present invention;

[0049] Figure 7 1 is a flow chart of a method for semi-supervised ore sorting using an adaptive threshold according to a preferred embodiment of the present invention;

[0050] Figure 8 A schematic diagram showing a comparison of the accuracy of the ore sorting method based on adaptive threshold semi-supervision of the present invention and other known ore sorting methods;

[0051] Figure 9 The heat map of the optimal model under different sample ratios using Grad-CAM technology is shown. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0053] Figure 1 FIG. 1 is a flow chart of a preferred embodiment of the adaptive threshold semi-supervised ore sorting method of the present invention. Figure 1 As shown, in step S1, ore samples are collected and some of the ore samples are labeled to obtain labeled ore samples and unlabeled ore samples. In a preferred embodiment of the present invention, the ore samples refer to ore image data, such as Figures 2A-2D The image data of Fankou lead-zinc ore is shown. Figures 2A-2B Shown is the concentrate image data, Figures 2C-2DThe tailings image data is shown. Of course, in other preferred embodiments of the present invention, any suitable ore image data can be used. In a preferred embodiment of the present invention, about 10% of the ore samples can be labeled to obtain labeled ore samples and unlabeled ore samples. Of course, in other preferred embodiments of the present invention, other percentages of ore samples can be selected for labeling. The more labels there are, the greater the workload. In the present invention, a data set can be made based on the ore samples, and the data set can be divided into a training set, a test set, and a validation set. Among them, only 10% of the data in the training set are labeled samples, and the rest are unlabeled samples. The test set and the validation set are both labeled samples, used to test and verify the final recognition accuracy.

[0054] In step S2, the labeled ore sample is input into the network model to obtain a first prediction result, the first prediction result is compared with the labeled adaptive threshold, the first prediction results greater than the labeled adaptive threshold α are discarded, and the remaining first prediction results are compared with the true label to which they belong to calculate the cross entropy loss.

[0055] In a preferred embodiment of the present invention, the value range of the labeling adaptive threshold α is as follows: Where i represents the current iteration number, which is a positive integer; α(i) represents the value generated by the adaptive threshold α after the i-th iteration; and k represents the sinusoidal rise starting after the k-th iteration. Figure 5 FIG. 1 is a schematic diagram showing the relationship between the labeling adaptive threshold and the number of iterations according to a preferred embodiment of the present invention. Figure 5 As shown, when the number of iterations i is less than a certain value, such as 51, the labeling adaptive threshold α remains unchanged and is the minimum value of the labeling adaptive threshold, such as 0.6. After the number of iterations is greater than 51, the labeling adaptive threshold α rises sinusoidally, that is, When the number of iterations continues to increase, for example, to k=5100, the labeling adaptive threshold α approaches the maximum value of the labeling adaptive threshold, and its preferred value is 0.99.

[0056] The cross entropy loss Where N represents the number of labeled ore samples; x i represents the i-th ore sample; y i represents the true label of the i-th sample; P represents the maximum category probability of the predicted sample, that is, P i Indicates the maximum category probability of the preset i-th sample.

[0057] Here, by utilizing adaptive thresholds, the problem of difficulty in improving the accuracy of semi-supervised training is overcome. With 10% labeled samples, the effect of supervised training can be approached, which greatly reduces the manpower and time costs brought by manually labeled data and improves on-site sorting efficiency.

[0058] Here, the network model can select any suitable neural network model in the art, such as a ResNet network model, such as a ResNet-CA or ResNet18 network model. In a further preferred embodiment of the present invention, in order to increase data and improve the feature extraction capability of the intermediate feature layer of the network model, this application borrows the auxiliary classifier idea of InceptionV3 and proposes an improved ResNet-CA network model, namely the ResNet-CA-AUX model.

[0059] Figure 3 FIG. 4 shows a schematic diagram of the structure of the ResNet-CA-AUX model according to a preferred embodiment of the present invention. Figure 3 As shown, the ResNet-CA-AUX model includes a first main component 100, two first ResNet-CA components 1, two second ResNet-CA components 2, two third ResNet-CA components 3, two fourth ResNet-CA components 4, a second main component 300, a main classifier 200, a first auxiliary component 400, a second auxiliary component 500, a third auxiliary component 600 and an auxiliary classifier 700. Figure 3 As shown, the first main component 100 is sequentially connected to the two first ResNet-CA components 1, the two second ResNet-CA components 2, the two third ResNet-CA components 3, the two fourth ResNet-CA components 4, the second main component 300 and the main classifier 200. The first auxiliary component 400 is connected between the second ResNet-CA component 2 and the third ResNet-CA component 3, and is also sequentially connected to the second auxiliary component 500, the third auxiliary component 600 and the auxiliary classifier 700.

[0060] Further Figure 3 As shown, the first main component 100 includes a convolutional layer, a normalized network layer, an activation function layer, and a pooling layer, namely Conv2d+Bn+Relu+Pool. The second main component 300 includes an adaptive average pooling layer and a fully connected layer, namely avg+fc. The first auxiliary component includes an adaptive pooling layer AdaptAvgPool. The second auxiliary component includes a convolutional layer, a normalized network layer, and an activation function layer, namely Conv2d+Bn+Relu; the third auxiliary component includes a first fully connected layer, an activation function layer, a dropout layer, and a second fully connected layer, namely Fc+Relu+Droupout+Fc.

[0061] Figure 4 yes Figure 3The structural diagram of the first to fourth ResNet-CA components 1-4 is shown. The difference between the different components 1-4 is the difference in their parameter settings. Figure 4 As shown, each ResNet-CA component includes a first pooling layer 11, namely XAvgPool; a second pooling layer 12, namely YAvgPool; a combined convolution layer 13, namely Concat+Conv2d, a batch normalization activation layer 14, namely BatchNorm+Relu; a first convolution layer 15, namely Conv2d; a second convolution layer 16, namely Conv2d; a first activation layer 16, namely Sigmoid; and a second activation layer 17, namely Sigmoid. The first pooling layer 11 and the second pooling layer 12 respectively receive input residuals and are sequentially connected to the combined convolution layer 13 and the batch normalization activation layer 14. The first convolution layer 15 is connected to the batch normalization activation layer 14 and the first activation layer 16. The second convolution layer is connected to the batch normalization activation layer 14 and the second activation layer 18. The first activation layer 17 and the second activation layer 18 are connected to the output layer.

[0062] By adopting Figure 3-4 The ResNet-CA-AUX model shown in the figure can extract more intermediate layer features from the same data samples, increase data utilization, and thus obtain more accurate training results in the subsequent training process.

[0063] In step S3, the unlabeled ore sample is processed to obtain a first processed sample, a second processed sample, a third processed sample and a fourth processed sample, the first processed sample and the second processed sample are input into the network model to obtain a first prediction output result, and the third processed sample and the fourth processed sample are input into the network model to obtain a second prediction output result.

[0064] In a preferred embodiment of the present invention, weak enhancement and strong enhancement are performed on the unlabeled ore sample to obtain a first processed sample and a second processed sample, respectively. Preferably, the first processed sample and the second processed sample can be processed into 96×96 pixels. Gradient noise is introduced into the first processed sample and the second processed sample, respectively, to generate the third processed sample and the fourth processed sample. Introducing gradient noise into the first processed sample and the second processed sample can enhance the robustness of the network model. Figure 6 Schematic diagram of introducing gradient noise into a sample according to a preferred embodiment of the present invention. Specifically, let the unlabeled ore sample U = [U1, U2, ..., U N ]∈R N*D, where R represents a real number set, N represents the number of samples, and D represents the feature dimension. Random noise γ that conforms to the standard normal distribution is injected into the unlabeled ore sample U, and then the gradient noise is obtained through the back propagation of the network model.

[0065]

[0066] Among them D kl is the KL divergence loss calculation function, i represents the number of iterations, θ represents the weight of the network model, u i represents the unlabeled ore sample under the i-th iteration, γ represents the random noise of normal distribution; P(y|u i ,θ) represents the input unlabeled ore sample u i Then we get the probability of the output category being y, P(y|(u i +γ), θ) represents the input unlabeled ore sample u after adding noise i Then we get the probability of the output category y. d represents the gradient of the gradient noise.

[0067] In a preferred embodiment of the present invention, the network model is the aforementioned ResNet-CA-AUX model.

[0068] In a preferred embodiment of the present invention, the following KL divergence loss calculation function can be selected:

[0069]

[0070] Where i represents the number of iterations; N represents the number of samples; P and Q represent two different probability distribution systems; H(P,Q) represents the cross entropy of the two probability systems P and Q; and H(P) represents the information entropy of the P system. i ,θ) and P(y|(u i +γ),θ) as two different probability distribution systems into the aforementioned KL divergence loss calculation function to obtain D kl (P(y|u i ,θ),P(y|(u i +γ),θ).

[0071] Preferably, Figure 6 As shown in , in order to prevent weight decay, L2 regularization can be performed before adding noise. Figure 6As shown, the first processed sample and the second processed sample are then input into the network model to obtain the first main classification prediction result, the second main classification prediction result, the first auxiliary classification prediction result, and the second auxiliary classification prediction result corresponding to the main classifier and the auxiliary classifier, respectively; the third processed sample and the fourth processed sample are input into the network model to obtain the third main classification prediction result, the fourth main classification prediction result, the third auxiliary classification prediction result, and the fourth auxiliary classification prediction result corresponding to the main classifier and the auxiliary classifier, respectively. Then, the KL loss is calculated for the first main classification prediction result, the second main classification prediction result, the first auxiliary classification prediction result, the second auxiliary classification prediction result, the third main classification prediction result, the fourth main classification prediction result, the third auxiliary classification prediction result, and the fourth auxiliary classification prediction result.

[0072] In step S4, a KL divergence loss is obtained based on the first preset output result and the second predicted output result, and the cross entropy loss and the KL divergence loss are added together and back propagated to optimize the network model.

[0073] In a preferred embodiment of the present invention, as described above, the first preset output result includes a first main classification prediction result, a second main classification prediction result, a first auxiliary classification prediction result and a second auxiliary classification prediction result; the second preset output result includes a third main classification prediction result, a fourth main classification prediction result, a third auxiliary classification prediction result and a fourth auxiliary classification prediction result.

[0074] In a preferred embodiment of the present invention, the third main classification prediction result and the third auxiliary classification prediction result are first compared with an unlabeled adaptive threshold β, and the third main classification prediction result and the third auxiliary classification prediction result that are greater than the unlabeled adaptive threshold β are retained, and the rest are discarded. Then, the retained third main classification prediction result and the third auxiliary classification prediction result are subjected to a KL divergence loss with the first main classification prediction result and the first auxiliary classification prediction result to obtain a first KL divergence loss.

[0075] In a preferred embodiment of the present invention, the fourth main classification prediction result and the fourth auxiliary classification prediction result are first compared with the unlabeled adaptive threshold β, and the fourth main classification prediction result and the fourth auxiliary classification prediction result that are greater than the unlabeled adaptive threshold β are retained, and the rest are discarded. Then, the retained fourth main classification prediction result and the fourth auxiliary classification prediction result are subjected to KL divergence loss with the second main classification prediction result and the second auxiliary classification prediction result to obtain a second KL divergence loss.

[0076] In a preferred embodiment of the present invention, the first main classification prediction result and the first auxiliary classification prediction result are subjected to KL divergence loss with the second main classification prediction result and the second auxiliary classification prediction result to obtain a third KL divergence loss.

[0077] In a preferred embodiment of the present invention, the first KL divergence loss, the second KL divergence loss, and the third KL divergence loss may be calculated simultaneously or in any suitable order, all of which fall within the protection scope of the present invention.

[0078] In a preferred embodiment of the present invention, the unlabeled adaptive threshold β satisfies represents the number of pseudo labels of category c in the i-th iteration, for Normalized result

[0079]

[0080] Where i represents the number of iterations, c represents the category, and τ is a fixed threshold value, which can be preferably set to 0.95. L represents the conditional function, which is 1 if the condition is met and 0 if it is not met. i (y|u n ,θ) indicates that in the i-th iteration, the unlabeled ore sample u is input n , and the probability of the output category y is obtained, where θ represents the weight of the network model, such as the aforementioned ResNet-CA-AUX model.

[0081] In a preferred embodiment of the present invention, the first KL divergence loss, the second KL divergence loss and the third KL divergence loss can be calculated according to any known scheme in the art, for example

[0082] The KL divergence loss

[0083] N represents the number of labeled ore samples; u i represents the unlabeled ore sample under the i-th iteration; γ represents the random noise of the normal distribution; d represents the gradient noise; P represents the maximum category probability of the predicted sample.

[0084] In step S5, the hyperparameter learning rate and optimizer method of the network model are adjusted and steps S2-S4 are repeatedly performed to train the network model, and then ore sorting is performed based on the trained network model. In a preferred embodiment of the present invention, all network models and data are run under the Ubuntu 18.04 operating system, using the deep learning framework PyTorch 1.12.0 version in a virtual environment, and an NVIDIA GeForce 3080Ti GPU for training. The experimental data comes from the Fankou lead-zinc mine. Here, based on the teachings of the present invention and common knowledge in the field, those skilled in the art know how to train the network model to obtain the optimal network model. For example, the network model, i.e., the relevant hyperparameters of the aforementioned ResNet-CA-AUX model, such as the initial value of the learning rate, the learning rate change method, and the optimizer type, can be fine-tuned N times, the training set can be input into the aforementioned ResNet-CA-AUX model, the validation set can be used to find the optimal N ResNet-CA-AUX models, and finally the test set can be used to test and obtain the ResNet-CA-AUX model with the best sorting effect.

[0085] The adaptive threshold semi-supervised ore sorting method of the present invention utilizes a network model to extract image features and adjusts the training strategy through an adaptive threshold to achieve a model training effect close to supervised learning with a small number of labeled samples, thereby achieving high-precision, low-cost, and large-scale ore sorting. The adaptive threshold semi-supervised ore sorting method of the present invention effectively overcomes the problem of difficulty in improving the accuracy of semi-supervised training. With 10% of labeled samples, it can achieve the effect of supervised training, greatly reducing the manpower and time costs brought by manually labeled data and improving on-site sorting efficiency. When the effect is poor due to changes in the ore source or radiation attenuation, the labeling work can be directly skipped to perform model migration training, achieving a time-saving and high-precision effect, bringing considerable benefits and convenience to enterprises and customers. Furthermore, the adaptive threshold semi-supervised ore sorting method of the present invention comprehensively considers the two perspectives of labeled samples and unlabeled samples, sets two reasonable dynamic thresholds, and greatly reduces the probability of erroneous pseudo-labeling. Furthermore, in terms of data enhancement, gradient noise is introduced to improve the robustness of the model, and ResNet is improved to propose an improved ResNet-CA network, which can achieve model training results close to supervised learning with a small number of labeled samples. In actual industrial environments, the model's dependence on labeled samples is reduced, meeting the requirements of ore sorting accuracy in industrial environments.

[0086] Figure 7 FIG. 1 is a flow chart of a semi-supervised ore sorting method based on an adaptive threshold according to a preferred embodiment of the present invention. Figure 7As shown, after collecting ore image samples and labeling some of the ore image samples, labeled ore samples (i.e., input labeled data) and unlabeled ore samples (i.e., input unlabeled data) are obtained. For input labeled data and output labeled data, they are divided into three branches for subsequent processing, as shown in the following example: Figure 7 shown.

[0087] For input labeled data, which is labeled with a true label, the labeled ore image sample is input into the network model to obtain a first prediction result. The first prediction result is compared with the label adaptive threshold α, and the first prediction results greater than the label adaptive threshold α are discarded. The remaining first prediction results are compared with the true label to which they belong, and the cross entropy loss is calculated, that is, the loss is 1.

[0088] For the input labeled data, it is subjected to weak enhancement and strong enhancement to obtain the first processed sample U w and the second processed sample U s After the splicing process, the aforementioned ResNet-CA-AUX model is input to obtain the four outputs corresponding to the main classifier and the auxiliary classifier. After the splicing and separation process, the first main classification prediction result U is obtained. w_1 , the second main classification prediction result U s_1 , the first auxiliary classification prediction result U w_1 ' and the second auxiliary classification prediction result U s_1 '.

[0089] For the first processed sample U w and the second processed sample U s Introduce gradient noise to obtain a weakly enhanced sample with gradient noise added (i.e., the third processed sample) U wn , a strongly enhanced sample with gradient noise added (ie, the fourth processed sample) U sn After the splicing process, the aforementioned ResNet-CA-AUX model is input to obtain the four outputs corresponding to the main classifier and the auxiliary classifier. After the splicing and separation process, the third main classification prediction result is obtained. wn_1 , the fourth main classification prediction result sn_1 , the third auxiliary classification prediction result U wn_1 ', the fourth auxiliary classification prediction result U sn_1 '.

[0090] Further Figure 7 As shown, for the classification result after the introduction of gradient noise, that is, the third main classification prediction result wn_1 , the fourth main classification prediction result sn_1 , the third auxiliary classification prediction result U wn_1 ', the fourth auxiliary classification prediction result U sn_1', respectively, are selected through the unlabeled adaptive threshold β, and then enter the KL divergence loss calculation, and for the classification result without the introduction of gradient noise, that is, the first main classification prediction result U w_1 , the second main classification prediction result U s_1 , the first auxiliary classification prediction result U w_1 ' and the second auxiliary classification prediction result U s_1 ', directly calculate the KL divergence loss. That is, before and after the introduction of gradient noise, U w_1 and U wn_1 、U s_1 'and U sn_1 'Do KL divergence loss, get loss 2, for U s_1 and U sn_1 、U w_1 'and U wn_1 'Do KL divergence loss and get loss 3; for the output U w_1 and U s_1 、U w_1 Perform KL divergence loss on ' and Us_1' to obtain a loss of 4. Add all the losses and perform backpropagation to optimize the network model.

[0091] The specific calculation of KL divergence loss and cross entropy loss, and the values of the unmarked adaptive threshold β and the marked adaptive threshold α can refer to the above embodiment and will not be repeated here.

[0092] In order to verify the beneficial effect of the semi-supervised ore sorting method based on adaptive threshold of the present invention, 2%, 5%, and 10% of the samples were selected for labeling. When the labeled samples with different proportions were tested, the accuracy rate that could be obtained was compared with that of the fully supervised algorithm. The comparison results are shown in Table 1:

[0093] Table 1

[0094]

[0095] As shown in Table 1, for 10% of samples, the adaptive threshold-based semi-supervised ore sorting method of the present invention performs comparable to the known fully supervised algorithm in terms of ore identification accuracy, waste ore identification accuracy, and average identification accuracy. Therefore, the adaptive threshold-based semi-supervised ore sorting method of the present invention effectively overcomes the difficulty in improving the accuracy of semi-supervised training. With only 10% of labeled samples, it can achieve results close to those of supervised training, significantly reducing the labor and time costs associated with manually labeling data and improving on-site sorting efficiency.

[0096] Furthermore, we conducted ablation experiments on 10% labeled samples using CA attention mechanism, auxiliary classifier AUX, data augmentation, gradient noise, two dynamic adaptive thresholds α and β, and auxiliary classifier, demonstrating the effectiveness and applicability of the semi-supervised ore sorting method based on adaptive thresholds of the present invention.

[0097] Table 2 Ablation experiment of the ore sorting method based on adaptive threshold semi-supervision under 10% labeled samples

[0098]

[0099]

[0100] Figure 8 The figure shows a comparison of the accuracy of the ore sorting method based on the adaptive threshold semi-supervision of the present invention and other known ore sorting methods. Figure 8 As shown in the figure, when the proportion of labeled samples drops to 1%, the error rates of all algorithms increase significantly, with the FlexMatch method performing the best. When the proportion of labeled samples reaches 5% and 10%, the semi-supervised ore sorting method based on adaptive thresholding achieves the lowest error rate, approximately 2% lower than that of MixMatch, FixMatch, Pi, and MeanTeacher.

[0101] Figure 9 The optimal network model obtained by the semi-supervised ore sorting method based on adaptive thresholds of the present invention under different proportions of samples is shown as a heat map display using Grad-CAM technology. (a) and (e) are pictures of ore and waste rock before the optimal network model is input. (b) to (d) and (f) to (h) show the heat map display of the optimal network model of labeled samples with different proportions. It can be found that: the focus points of 1% of the labeled models are mostly not in the ore area; although the focus points of 5% of the labeled models are mostly in the ore area, the focus is not concentrated enough on obvious ore spots; the focus areas of 10% of the labeled models are not only on the ore, but also pay more and more concentrated attention to obvious ore spots. Therefore, this further proves that the semi-supervised ore sorting method based on adaptive thresholds of the present invention can perform ore sorting more accurately.

[0102] The present invention also relates to a computer-readable storage medium having stored thereon a computer program, said computer program comprising all the features enabling the implementation of the method of the present invention, and which, when installed in a computer system, is capable of implementing the method of the present invention. A computer program in this document is defined as any expression of a set of instructions, written in any programming language, code, or notation, which provides a system with information processing capabilities for implementing a specific function, either directly or after one or both of the following steps: a) conversion into another language, code, or notation; or b) reproduction in a different format.

[0103] Although the present invention is described by way of specific embodiments, it will be understood by those skilled in the art that various modifications and equivalent substitutions may be made to the present invention without departing from the scope of the present invention. Furthermore, various modifications may be made to the present invention for specific circumstances or materials without departing from the scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed, but is intended to encompass all embodiments falling within the scope of the claims.

[0104] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. An adaptive threshold semi-supervised ore sorting method, characterized in that: include: S1. Collecting ore samples and labeling some of the ore samples to obtain labeled ore samples and unlabeled ore samples; S2. Input the labeled ore sample into the network model to obtain a first prediction result, compare the first prediction result with a labeled adaptive threshold, discard the first prediction results greater than the labeled adaptive threshold α, and calculate the cross entropy loss between the remaining first prediction results and their true labels; S3. Process the unlabeled ore sample to obtain a first processed sample, a second processed sample, a third processed sample, and a fourth processed sample, input the first processed sample and the second processed sample into the network model to obtain a first prediction output result, and input the third processed sample and the fourth processed sample into the network model to obtain a second prediction output result; S4. Obtaining a KL divergence loss based on the first preset output result and the second predicted output result, adding the cross entropy loss and the KL divergence loss and performing back propagation to optimize the network model; S5, adjusting the hyperparameter learning rate and optimizer method of the network model and repeatedly executing steps S2-S4 to train the network model, and then performing ore sorting based on the trained network model; In step S2, the value range of the labeling adaptive threshold α is as follows: Where i represents the current iteration number, which is a positive integer; α(i) represents the value generated by the annotation adaptive threshold α after the i-th iteration; k represents the sinusoidal rise after the k-th iteration; μ min represents the minimum value of the annotation adaptive threshold; μ max represents the maximum value of the annotation adaptive threshold; Cross Entropy Loss Where N represents the number of labeled ore samples; x i represents the i-th ore sample; y i represents the true label of the i-th sample; P represents the maximum category probability of the predicted sample.

2. The adaptive threshold semi-supervised ore sorting method according to claim 1, characterized in that: The step S3 further comprises: S31, performing weak enhancement and strong enhancement on the unlabeled ore sample to obtain a first processed sample and a second processed sample, respectively, and introducing gradient noise into the first processed sample and the second processed sample to generate the third processed sample and the fourth processed sample, respectively; S32, inputting the first processed sample and the second processed sample into the network model to obtain a first main classification prediction result, a second main classification prediction result, a first auxiliary classification prediction result, and a second auxiliary classification prediction result corresponding to the main classifier and the auxiliary classifier, respectively; S33. Input the third processed sample and the fourth processed sample into the network model to obtain a third main classification prediction result, a fourth main classification prediction result, a third auxiliary classification prediction result and a fourth auxiliary classification prediction result corresponding to the main classifier and the auxiliary classifier respectively.

3. The adaptive threshold semi-supervised ore sorting method according to claim 2, characterized in that: In step 31, let the unlabeled ore sample U = [U1, U2, ..., U N ]∈R N*D , where R represents a real number set, N represents the number of samples, and D represents the feature dimension; random noise γ that conforms to the standard normal distribution is injected into the unlabeled ore sample U, and then the gradient noise is obtained through the back propagation of the network model Among them D kl is the KL divergence loss calculation function, i represents the number of iterations, θ represents the weight of the network model, u i represents the unlabeled ore sample under the i-th iteration, γ represents the random noise of normal distribution; P(y|u i ,θ) represents the input unlabeled ore sample u i Then we get the probability that the output category is y.

4. The adaptive threshold semi-supervised ore sorting method according to claim 2, characterized in that: The step S4 further comprises: S41, comparing the third main classification prediction result and the third auxiliary classification prediction result with an unlabeled adaptive threshold β, retaining the third main classification prediction result and the third auxiliary classification prediction result that are greater than the unlabeled adaptive threshold β, and discarding the rest; S42, performing a KL divergence loss on the third main classification prediction result and the third auxiliary classification prediction result obtained in step S41, the first main classification prediction result and the first auxiliary classification prediction result to obtain a first KL divergence loss; S43, comparing the fourth main classification prediction result and the fourth auxiliary classification prediction result with the unlabeled adaptive threshold β, retaining the fourth main classification prediction result and the fourth auxiliary classification prediction result that are greater than the unlabeled adaptive threshold β, and discarding the rest; S44, performing KL divergence loss on the fourth main classification prediction result and the fourth auxiliary classification prediction result obtained in step S43, the second main classification prediction result, and the second auxiliary classification prediction result to obtain a second KL divergence loss; S45 , performing KL divergence loss on the first main classification prediction result and the first auxiliary classification prediction result, the second main classification prediction result and the second auxiliary classification prediction result to obtain a third KL divergence loss.

5. The adaptive threshold semi-supervised ore sorting method according to claim 4, characterized in that: In step S4, the unlabeled adaptive threshold β satisfies Where i represents the number of iterations, c represents the category, and τ is the set fixed threshold; represents the number of pseudo labels of category c in the i-th iteration, for Normalized result The KL divergence loss N represents the number of labeled ore samples; u i represents the unlabeled ore sample under the i-th iteration; γ represents the random noise of the normal distribution; d represents the gradient noise; P represents the maximum category probability of the predicted sample.

6. The method for semi-supervised ore separation using an adaptive threshold according to any one of claims 1 to 5, characterized in that: The network model includes a ResNet-CA-AUX model; The ResNet-CA-AUX model includes a first main component, two first ResNet-CA components, two second ResNet-CA components, two third ResNet-CA components, two fourth ResNet-CA components, a second main component, a main classifier, a first auxiliary component, a second auxiliary component, a third auxiliary component and an auxiliary classifier; The first main component is sequentially connected to the two first ResNet-CA components, the two second ResNet-CA components, the two third ResNet-CA components, the two fourth ResNet-CA components, the second main component and the main classifier; The first auxiliary component is connected between the second ResNet-CA component and the third ResNet-CA component, and is simultaneously connected to the second auxiliary component, the third auxiliary component and the auxiliary classifier in sequence.

7. The adaptive threshold semi-supervised ore sorting method according to claim 6, characterized in that: Each ResNet-CA component includes a first pooling layer, a second pooling layer, a merged convolution layer, a batch normalization activation layer, a first convolution layer, a second convolution layer, a first activation layer, a second activation layer, and an output layer. The first pooling layer and the second pooling layer receive the input residual respectively and are connected to the merged convolution layer and the batch normalization activation layer in sequence. The first convolution layer is connected to the batch normalization activation layer and the first activation layer, the second convolution layer is connected to the batch normalization activation layer and the second activation layer, and the first activation layer and the second activation layer are connected to the output layer.

8. The adaptive threshold semi-supervised ore sorting method according to claim 6, characterized in that: The first main component includes a convolution layer, a normalized network layer, an activation function layer and a pooling layer; the second main component includes an adaptive average pooling layer and a fully connected layer; the first auxiliary component includes an adaptive pooling layer; the second auxiliary component includes a convolution layer, a normalized network layer and an activation function layer; the third auxiliary component includes a first fully connected layer, an activation function layer, a deactivation layer and a second fully connected layer.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the adaptive threshold semi-supervised ore sorting method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Semi-supervised image classification method based on generative adversarial network

    CN110097103A

  • Limited data spectrum sensing method based on semi-supervised deep neural network

    CN113570032A