Grade detection algorithm and system

The improved YOLOv8-based model with UniRepLKNet and PAFPN features addresses the issue of large parameters and low precision in mineral ore detection, achieving high accuracy and efficient deployment.

CN120318488APending Publication Date: 2025-07-15JIANGXI UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510373995.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

The detection model parameters in the existing ore detection algorithm are large, and the accuracy is not enough to meet the actual production requirements.

Method used

The improved network structure based on YOLOv8, including the UniRepLKNet module and the PAFPN feature pyramid structure, combined with the WIOU loss function, is used to build a lightweight ore grade detection model, and improve detection accuracy through data augmentation and sample data set training.

Benefits of technology

It realizes high accuracy and lightweight deployment of ore grade detection, reduces the amount of model parameters and improves detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120318488A_ABST
    Figure CN120318488A_ABST
Patent Text Reader

Abstract

The invention discloses a grade detection algorithm and system. The algorithm comprises the following steps: acquiring a target image of ore to be detected; inputting the target image into a pre-constructed detection model for ore grade detection, and outputting according to the model to obtain an ore grade detection result; and the network structure of the detection model adopts an improved network based on YOLOv8. By utilizing the scheme of the invention, the model parameter quantity can be reduced, the model accuracy is improved, and the recognition rate of ore grade detection is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of ore identification, and particularly to a grade detection algorithm and system. Background Art

[0002] The ore grade refers to the content of useful components or useful minerals in unit volume or unit weight of ore. Automatic ore grade identification refers to the technology of using advanced optical, computer and control technologies to perform rapid, accurate and non-destructive grade detection on ores. The core of this technology lies in analyzing and identifying the elements in the ore through a non-contact spectral analysis instrument, and then judging the grade and mineral composition of the ore. Although significant progress has been made in automatic ore grade identification technology, there are still some technical challenges, such as further improving the detection accuracy and speed, and reducing the equipment cost.

[0003] With the continuous progress of technology and the reduction of costs, the application scope of automatic ore grade identification technology will be further expanded. It will play an increasingly important role in the development and utilization of mining resources, providing strong support for the intelligent and efficient development of mines. An efficient grade identification technology helps mining enterprises to obtain ore quality information in a timely manner, optimize production plans, reduce waste and losses in the production process, and improve the production efficiency of mines.

[0004] Currently, the detection models adopted in common ore detection algorithms have a large number of parameters and the accuracy is insufficient to meet the requirements of actual production. Summary of the Invention

[0005] The present invention provides an ore grade detection algorithm and system to reduce the number of model parameters, improve the model accuracy, and thus improve the recognition rate of ore grade detection.

[0006] To this end, the present invention provides the following technical solutions:

[0007] A grade detection algorithm, the algorithm comprising:

[0008] Obtaining a target image of the ore to be detected;

[0009] Inputting the target image into a pre-constructed detection model for ore grade detection, and obtaining a detection result of the ore grade according to the model output; the network structure of the detection model adopts an improved network based on YOLOv8.

[0010] Optionally, the algorithm further comprises constructing the detection model in the following manner:

[0011] Collecting ore images of different grades from different mine pits;

[0012] Performing grade feature annotation on the ore images to obtain corresponding labels;

[0013] Generate a sample data set based on the ore image and the corresponding label;

[0014] Determine the network structure of the detection model;

[0015] Train the detection model using the sample data set.

[0016] Optionally, the acquisition of ore images with different grades from different ore pits includes: using a high-speed camera installed above the production line conveyor belt to take fixed-point and timed shots of the ore on each batch of conveyor belts, obtaining ore images with different grades from different ore pits.

[0017] Optionally, the label is a TXT file.

[0018] Optionally, the algorithm further includes: performing data augmentation processing on the images in the sample data set to increase the number of sample data in the sample data set.

[0019] Optionally, the performing data augmentation processing on the images in the sample data set includes: performing any one or a combination of translation, flipping, rotation, adding noise, and scaling on the images in the sample data set.

[0020] Optionally, the network structure of the detection model includes: a backbone network, a connection part, and a task head;

[0021] The backbone network includes: a UniRepLKNet module and a C2f module;

[0022] The connection part adopts a PAFPN feature pyramid structure;

[0023] The WIOU loss function is adopted in the task head.

[0024] A grade detection system, the system includes:

[0025] An image acquisition module, configured to acquire a target image of the ore to be detected;

[0026] A detection module, configured to input the target image into a pre-constructed detection model for ore grade detection, and obtain a detection result of the ore grade according to the model output; the network structure of the detection model adopts an improved network based on YOLOv8.

[0027] Optionally, the system further includes: a model construction module, configured to pre-construct the detection model;

[0028] The model construction module includes:

[0029] An acquisition unit, configured to acquire ore images with different grades from different ore pits;

[0030] An annotation unit for annotating the grade characteristics of the ore image to obtain corresponding labels;

[0031] A sample set generation unit for generating a sample data set according to the ore image and the corresponding labels;

[0032] A network structure determination unit for determining the network structure of the detection model;

[0033] A training unit for training the detection model using the sample data set.

[0034] Optionally, the acquisition unit is specifically configured to use a high-speed camera installed above the production line conveyor belt to perform fixed-point and timed shooting on the ore on each batch of conveyor belts, so as to obtain ore images of different grades in different ore pits.

[0035] A computer-readable storage medium, on which a computer program is stored, and the computer program executes the steps of the grade detection algorithm when being run by a processor.

[0036] The ore grade detection algorithm and system provided by the present invention pre-establish a detection model for ore grade. When performing detection, the target image of the ore to be detected is input into the detection model for ore grade detection, and the detection result of the ore grade is obtained according to the model output. The detection model in the solution of the present invention requires a small number of parameters, which is beneficial to network lightweight and practical deployment, and has a high accuracy for ore detection. Brief Description of the Drawings

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings according to these drawings without creative efforts.

[0038] Figure 1 It is a flowchart for constructing a detection model in an embodiment of the present invention;

[0039] Figure 2 It is a schematic diagram of the network structure of the detection model in an embodiment of the present invention;

[0040] Figure 3 It is a schematic diagram of a structure of the UniRepLKNet module in an embodiment of the present invention;

[0041] Figure 4 It is a schematic diagram of the PAFPN feature pyramid structure in an embodiment of the present invention;

[0042] Figure 5It is a flowchart of the grade detection algorithm in an embodiment of the present invention;

[0043] Figure 6 It is a schematic structural diagram of a grade detection system in an embodiment of the present invention;

[0044] Figure 7 It is a schematic structural diagram of a model construction module in an embodiment of the present invention. Specific embodiments

[0045] The following will describe the specific embodiments of the present invention in detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for the purpose of illustrating and explaining the present invention, and are not used to limit the present invention.

[0046] In order to enable those skilled in the art of this technology to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the scope of protection of the present invention.

[0047] Aiming at the problems that the detection model adopted in the existing ore detection algorithm has a large number of parameters and the accuracy is insufficient to meet the requirements of actual production, the embodiment of the present invention provides an ore grade detection algorithm system, which pre-establishes a detection model for ore grade. When performing detection, the target image of the ore to be detected is input into the detection model for ore grade detection, and the detection result of the ore grade is obtained according to the model output.

[0048] As Figure 1 shown, it is a flowchart of constructing a detection model in an embodiment of the present invention, including the following steps:

[0049] In step 101, ore images of different grades in different mine pits are collected.

[0050] Specifically, a high-speed camera installed above the production line conveyor belt can be used to take fixed-point and timed photos of the ore on each batch of conveyor belts to obtain ore images of different grades in different mine pits.

[0051] In step 102, grade feature annotation is performed on the ore images to obtain corresponding labels.

[0052] For example, the LabelImg tool can be used to annotate the ore grade features of the collected ore images to obtain labels corresponding one-to-one with the image samples, and the labels can be XML files.

[0053] In step 103, a sample data set is generated according to the ore images and the corresponding labels.

[0054] The samples in the sample dataset can be in the form of TXT files, and of course, they can also be in other forms. The embodiments of the present invention do not make any limitations in this regard.

[0055] In specific implementation, the image dataset can be divided into a training set (train), a validation set (val), and a test set (test) according to a ratio of 7:2:1, and the data of the three do not overlap. Among them, the training set is used to train the network, the validation set is used to adjust the hyperparameters (such as the learning rate) in the network, and the test set is used to test the performance of the network.

[0056] In addition, in order to ensure the quantity and diversity of training samples and avoid overfitting of the training results, the images in the sample dataset can also be subjected to data augmentation processing to obtain new images, so as to expand the quantity of sample data in the sample dataset. For example, perform any one or a combination of translation, flipping, rotation, adding noise, and scaling on the images in the sample dataset.

[0057] In step 104, determine the network structure of the detection model.

[0058] In the embodiments of the present invention, the detection model can adopt some existing networks, such as YOLOv8; or an improved network based on YOLOv8, which is called the WCP-YOLO network for the convenience of description.

[0059] To better understand the WCP-YOLO network in the embodiments of the present invention, the network structure of the existing YOLOv8 will be briefly described below.

[0060] YOLOv8 is an object detection algorithm based on the YOLO series. Its basic principle is to divide the input image into multiple grids, and each grid predicts multiple corresponding bounding boxes and their corresponding confidences, as well as the class probabilities corresponding to each bounding box. During prediction, multiply the multiple bounding boxes of each grid by their corresponding confidences and class probabilities to obtain the final score of each bounding box, and then perform screening according to the scores to obtain the final object detection result.

[0061] The network structure of YOLOv8 mainly consists of the following three parts:

[0062] Backbone (main network): used for image feature extraction, converting the image into a feature representation with rich semantic information;

[0063] Neck (connection part): is an intermediate layer used to fuse the features from the Backbone to enhance the feature representation ability;

[0064] Head (Task Head): It is the last layer of the model, and its structure varies according to different tasks.

[0065] Among them, the Backbone uses a series of convolutional and deconvolutional layers (such as consisting of 5 convolutional modules, 4 C2f modules, and one SPPF module) to extract features. At the same time, residual connections and bottleneck structures are also used to reduce the size of the network and improve performance. This part uses the C2f module as the basic building unit, which has fewer parameters and better feature extraction ability.

[0066] The function of the entire convolutional module is as follows:

[0067] 1) Downsampling: The convolutional layers in each convolutional module use convolutional kernels with a stride of 2 for downsampling operations to reduce the size of the feature map and increase the number of channels.

[0068] 2) Non-linear representation: A Batch Normalization layer and a ReLU activation function are added after each convolutional layer to enhance the non-linear representation ability of the model. Batch Normalization makes the neural network more stable during training by normalizing each mini-batch of data, allowing for a higher learning rate and reducing the dependence on the initialized weights. The basic idea of Batch Normalization is to normalize each mini-batch of data so that the mean of each feature is 0 and the variance is 1, and then adjust the data distribution through a learnable scaling factor and translation factor, making the neural network easier to train.

[0069] Among them, the Neck uses multi-scale feature fusion technology to fuse the feature maps from different stages of the Backbone to enhance the feature representation ability. The Neck part specifically includes an SPPF (Spatial Pyramid PoolingFast) module, a PAA (Probabilistic Anchor Assignment) module, and two PAN (Path Aggregation Network) modules. Among them, the SPPF module is used for pooling operations at different scales, stitching together feature maps of different scales to improve the detection ability for targets of different sizes; the PAA module is used to intelligently assign anchor boxes to optimize the selection of positive and negative samples and improve the training effect of the model; the PAN module is used for path aggregation of features at different levels, enhancing the expression ability of the feature map through bottom-up and top-down paths.

[0070] Among them, Head is responsible for the final object detection and classification tasks, including a detection head and a classification head. The detection head contains a series of convolutional layers and transposed convolutional layers for generating detection results; the classification head uses global average pooling to classify each feature map.

[0071] As Figure 2 shown, it is a schematic diagram of the network structure of the detection model in the embodiment of the present invention.

[0072] This detection model is based on an improved network based on YOLOv8, namely the WCP-YOLO network, which includes the following parts:

[0073] Backbone: Used for image feature extraction;

[0074] Neck: Further processes and fuses the features from the Backbone to improve the accuracy and robustness of object detection;

[0075] Head: Performs decoding.

[0076] Different from the existing YOLOv8, in the WCP-YOLO network, the Backbone uses the C2f_UniRepLKNet module as the backbone network. The C2f_UniRepLKNetBlock module is composed of the UniRepLKNet (universal perception large-kernel ConvNet) module and the C2f (Convolution to Feature) module, which can extract features of small objects. The UniRepLKNet module is a flexible feature extraction network that can ensure the adaptability of the extracted objects. At the same time, the combination of the UniRepLKNet module and the C2f module can better balance local information and global information, and this deep convolution has higher efficiency than ordinary convolution. The C2f module is a module that combines a convolutional neural network (CNN) and a fully connected neural network (FNN), which can give full play to the advantages of both. The CNN can effectively extract local features of images, while the FNN is good at learning global features. By combining the two, while retaining the local features of the image, global features are learned, improving the detection accuracy and speed.

[0077] In addition, in the Neck part, the PAFPN feature pyramid structure is used to replace the PAN hierarchical pyramid network structure, and an adaptive weight allocation mechanism is adopted, and the ASFF3 (Adaptive Spatial Feature Fusion) module is linked after the CBS (Conv-BatchNorm-Swish) module.

[0078] ASFF3 is an adaptive feature fusion algorithm that can more effectively utilize features of different scales. In the object detection network, low-level features are suitable for detecting small objects, high-level features are suitable for detecting large objects, and intermediate-level features are suitable for detecting medium-sized objects. ASFF3 obtains new fused features by assigning learnable weights to features of different layers and performing weighted summation. In the embodiments of the present invention, using the PAFPN feature pyramid structure can more fully consider the feature differences from different depth levels in the ore image, thereby avoiding insufficient feature fusion and preventing information loss.

[0079] The UniRepLKNetBlock module adopts a large-kernel CNN and can process data of multiple modalities. The unique advantage of large-kernel convolution is that it can obtain a large receptive field without relying on deep stacking, avoiding the problem of diminishing marginal returns caused by increasing depth.

[0080] For example, in a non-limiting embodiment, a structure of the UniRepLKNet module in the embodiments of the present invention is as Figure 3 shown.

[0081] Figure 3 In the example shown, the large kernel scale K = 9, the kernel sizes of the parallel convolutional layers k = (5, 5, 3, 3), the dilation rate r = (1, 2, 3, 4) are set, and 5 convolutional layers with BatchNorm (batch normalization) are reparameterized into a large-kernel convolutional layer with a kernel size of 9. The core idea of BatchNorm is to normalize the activation values of each small batch of data so that their mean is 0 and variance is 1.

[0082] As Figure 4 shown, it is a schematic diagram of the PAFPN feature pyramid structure in the embodiments of the present invention.

[0083] The PAFPN feature pyramid structure adopts an adaptive weight allocation mechanism and links the ASFF3 (AWS Security Finding Format) structure after the CBS (Convolutional Block with Shortcut) structure. By introducing the PAFPN feature fusion structure, the network feature fusion part can be improved in the following three aspects: low-level feature fusion, low-level feature alignment, and adaptive spatial fusion. Using the PAFPN feature pyramid structure can more fully consider the feature differences from different depth levels in the ore image, thereby avoiding insufficient feature fusion and preventing information loss.

[0084] In addition, in the Head, the traditional loss function C-IoU is replaced by the WIOU (Weighted Intersection over Union) loss function. Generally, in model training, geometric metrics such as distance and aspect ratio will exacerbate the penalty for low-quality sample data, resulting in a decline in the generalization ability of the model. The WIOU function takes into account the similarity of the aspect ratio and uses a dynamic non-monotonic mechanism to evaluate the quality of anchor boxes, enabling the model to pay more attention to anchor boxes of ordinary quality, thereby improving the object localization ability of the model.

[0085] Continue to refer to Figure 1 In step 105, a detection model is trained using the sample data set.

[0086] Through training, weight parameters suitable for ore grade detection are obtained, thereby obtaining the corresponding WCP-YOLOv8 model, that is, the detection model.

[0087] Using the above detection model, the flowchart of the grade detection algorithm provided by the embodiment of the present invention is as Figure 5 shown, including the following steps:

[0088] Step 501, obtain a target image of the ore to be detected.

[0089] For example, a high-speed camera is used to collect the ore on the conveyor belt to obtain the corresponding target image, and the target image can be represented by a TXT format file.

[0090] Step 502, input the target image into the pre-constructed detection model for ore grade detection, and obtain the detection result of the ore grade according to the model output.

[0091] The ore grade detection algorithm provided by the present invention pre-establishes a detection model for ore grade. When performing detection, the target image of the ore to be detected is input into the detection model for ore grade detection, and the detection result of the ore grade is obtained according to the model output. The detection model in the solution of the present invention requires fewer parameters, which is beneficial to network lightweight and practical deployment, and has a high accuracy for ore detection.

[0092] Correspondingly, the embodiment of the present invention also provides a grade detection system, as Figure 6 shown, which is a schematic structural diagram of the system.

[0093] The grade detection system 600 includes the following modules:

[0094] An image acquisition module 601, configured to acquire a target image of the ore to be detected;

[0095] The detection module 602 is configured to input the target image into a pre-constructed detection model 60 for ore grade detection, and obtain the detection result of the ore grade according to the model output; the network structure of the detection model adopts an improved network based on YOLOv8.

[0096] Among them, the detection model 60 can be pre-constructed by the corresponding detection module based on the ore images of different grades in different mine pits. The detection module can be a part of the ore grade detection algorithm system 600 of the present invention or independent of the ore grade detection algorithm system 600. The embodiments of the present invention do not make any limitations in this regard.

[0097] As Figure 7 shown, it is a schematic structural diagram of the detection module in an embodiment of the present invention.

[0098] The detection module 700 includes the following units:

[0099] The acquisition unit 701 is configured to acquire ore images of different grades in different mine pits;

[0100] The annotation unit 702 is configured to perform grade feature annotation on the ore image to obtain corresponding labels;

[0101] The sample set generation unit 703 is configured to generate a sample data set according to the ore image and the corresponding label;

[0102] The network structure determination unit 704 is configured to determine the network structure of the detection model; the network structure of the detection model can adopt an improved network based on YOLOv8, and can specifically refer to the description in the algorithm embodiment of the present invention above, which will not be elaborated here.

[0103] The training unit 705 is configured to train the detection model by using the sample data set.

[0104] In some embodiments, the acquisition unit 701 can use a high-speed camera installed above the production line conveyor belt to take fixed-point and timed shots of the ore on each batch of conveyor belts to obtain ore images of different grades in different mine pits.

[0105] In some embodiments, the detection module 700 may further include: an image processing unit, configured to perform data enhancement processing on the images in the sample data set to increase the number of sample data in the sample data set.

[0106] The specific implementation manners of the above-mentioned modules and units can refer to the description in the algorithm embodiment of the present invention above, which will not be elaborated here.

[0107] It should be noted that, for the foregoing algorithm embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0108] The present invention also provides a storage medium, which is a computer-readable storage medium, on which a computer program is stored. When the computer program runs, it can execute Figure 1 or Figure 5 some or all of the steps of the method shown in. The storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disc, etc. The storage medium may also include a non-volatile memory or a non-transitory memory, etc.

[0109] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable systems. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, a computer, a server, or a data provider to another website, a computer, a server, or a data provider in a wired or wireless manner.

[0110] The above embodiments of the present invention have been introduced in detail. Specific implementation manners have been used in this article to elaborate on the present invention. The description of the above embodiments is only used to help understand the algorithms and systems of the present invention. They are only some of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention. The content of this specification should not be construed as a limitation of the present invention. Therefore, any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A grade detection algorithm, characterized in that, The algorithm includes: Obtain a target image of the ore to be detected; Input the target image into a pre-constructed detection model for ore grade detection, and obtain the detection result of the ore grade according to the model output; the network structure of the detection model adopts an improved network based on YOLOv8.

2. The grade detection algorithm according to claim 1, characterized in that The algorithm further includes: constructing the detection model in the following manner: Collect ore images with different grades from different mine pits; Perform grade feature annotation on the ore images to obtain corresponding labels; Generate a sample data set according to the ore images and the corresponding labels; Determine the network structure of the detection model; Use the sample data set to train and obtain the detection model.

3. The grade detection algorithm according to claim 2, characterized in that The collecting of ore images with different grades from different mine pits includes: Use a high-speed camera installed above the production line conveyor belt to take fixed-point and timed photos of the ore on each batch of conveyor belts, and obtain ore images with different grades from different mine pits.

4. The grade detection algorithm according to claim 2, characterized in that, The label is a TXT file.

5. The grade detection algorithm according to claim 2, characterized in that, The algorithm further includes: Perform data augmentation processing on the images in the sample data set to expand the number of sample data in the sample data set.

6. The grade detection algorithm according to claim 5, wherein The performing of data augmentation processing on the images in the sample data set includes: Perform any one or a combination of translation, flipping, rotation, adding noise, and scaling on the images in the sample data set.

7. The grade detection algorithm according to claim 2, characterized in that The network structure of the detection model includes: a backbone network, a connection part, and a task head; The backbone network includes: a UniRepLKNet module and a C2f module; The connection part adopts a PAFPN feature pyramid structure; The WIOU loss function is adopted in the task head.

8. A grade detection system, characterized in that, The system includes: An image acquisition module for obtaining a target image of the ore to be detected; A detection module for inputting the target image into a pre-constructed detection model for ore grade detection, and obtaining the detection result of the ore grade according to the model output; the network structure of the detection model adopts an improved network based on YOLOv8.

9. The grade detection system according to claim 8, characterized in that The system further includes: a model construction module for pre-constructing the detection model; The model construction module includes: A collection unit for collecting ore images with different grades from different mine pits; A labeling unit for performing grade feature annotation on the ore images to obtain corresponding labels; A sample set generation unit for generating a sample data set according to the ore images and the corresponding labels; A network structure determination unit for determining the network structure of the detection model; A training unit for using the sample data set to train and obtain the detection model.

10. The grade detection system according to claim 9, wherein The collection unit is specifically used to use a high-speed camera installed above the production line conveyor belt to take fixed-point and timed photos of the ore on each batch of conveyor belts, and obtain ore images with different grades from different mine pits.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is run by a processor, it executes the steps of the grade detection algorithm according to any one of claims 1 to 7.