Lithium mineral component detection method based on improved YOLOv8

By improving the YOLOv8 network, combined with the SPPF_LSKA pyramid structure and the LSKA attention mechanism, the problems of false detection and missed detection in lithium mineral composition detection are solved, and efficient and accurate identification of lithium mineral composition is achieved, which is suitable for real-time detection at industrial sites.

CN119495372APending Publication Date: 2025-02-21YICHUN JIANGLI LITHIUM BATTERY NEW ENERGY IND RES INST +1

Patent Information

Application Number
CN202411447071.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

The prior art is prone to causing mis-detection and missed detection in lithium mineral component detection, and the detection process is complex and time-consuming, and it relies on manual operations, which has problems of insufficient subjectivity and real-timeness.

Method used

Using the improved lithium mineral composition detection method of YOLOv8, the sample data set is constructed by collecting and processing microscopic images, and the SPPF_LSKA pyramid structure and LSKA attention mechanism are introduced into the YOLOv8 network, the convolution operation is optimized, and the training is combined with multiple loss functions. .

Benefits of technology

It realizes high-precision identification of lithium mica, feldspar and quartz in complex microscopic images, solves the problems of false detection and missed detection, improves the efficiency and accuracy of detection, and is suitable for real-time applications in industrial sites.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119495372A_ABST
    Figure CN119495372A_ABST
Patent Text Reader

Abstract

The invention discloses a lithium mineral component detection method based on improved YOLOv8, and belongs to the technical field of computer vision and mineral detection.The method comprises the steps that dry powder samples of various lithium mineral components are collected, the collected dry powder samples are shot under an optical microscope, and then the shot images are segmented and marked to obtain lithium mineral components; constructing a sample data set covering various lithium mineral components; the method comprises the following steps of: improving a YOLOv8 network to obtain an improved YOLOv8 network; training the improved YOLOv8 network on the basis of the sample data set; and the trained and improved YOLOv8 network is utilized to realize lithium mineral component detection. By adopting the scheme, the lithium mineral component detection effect and efficiency can be improved, and technical support is provided for intelligent detection of lithium ores.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer vision and mineral detection, and in particular to a lithium mineral component detection method based on improved YOLOv8. Background Art

[0002] As an important mineral resource in the current new energy industry, the detection and classification of lithium ore is crucial to industrial production. Traditional mineral detection methods rely on manual operations, such as manual observation, elemental analysis measurement or visual identification under a microscope. For example, CN118039008A, this method performs multi-point sampling of the collected lithium mineral samples, rotates the measurement points, and measures multiple elements in turn, and finally obtains the type and proportion of mineral components through mean calculation and intelligent data analysis. This method theoretically provides relatively accurate analysis results, uses physical and chemical analysis methods to perform systematic element measurements, and combines intelligent data processing and calculation to accurately identify mineral components to a certain extent, especially when the number of samples is limited. It has certain practicality. Another example is CN117816580A, which collects samples from the core according to certain indicators, obtains the content detection results of each element in each sample by formulating sample processing plans and element detection, and performs chemical tests on lithium content, and finally detects and classifies different components in lithium minerals through data training and model prediction. This method realizes the automation and intelligence of lithium ore sorting by combining element analysis, data training and real-time sorting system, and improves the sorting efficiency and accuracy to a certain extent. However, although the above method has certain scientificity and logic in the detection of lithium mineral components, it exposes many deficiencies in practical applications. First, the above methods rely on manual means including multi-point sampling, rotation measurement and traditional physical and chemical element measurement, which are complicated and time-consuming, and require multiple sample processing and data calculation to obtain the final result. Secondly, although the method itself adopts a more scientific detection method, the accuracy of its final result is still highly dependent on the experience of the operator. Any measurement error or data processing deviation may affect the final result, resulting in unstable and subjective analysis results. At the same time, due to the cumbersome detection process and poor real-time performance, the above method is more suitable for the fine analysis of small laboratory samples, and cannot meet the needs of rapid analysis and feedback in modern large-scale industrial production environments. In addition, when encountering subtle differences in mineral composition under microscopic environment (such as transparency, edge thickness, texture gloss, etc.), traditional methods are difficult to fully capture these characteristics, resulting in misjudgment or missed judgment.

[0003] From the above, we can see that manual methods have obvious limitations: first, the accuracy of the detection process is affected by the subjective judgment of the operator, which is prone to misjudgment or missed judgment; second, manual detection efficiency is low and it is difficult to meet the needs of rapid and continuous detection in large-scale production environments; in addition, manual detection is highly dependent on the experience level of the operator. For inspectors with different levels of experience, the stability and consistency of the results are difficult to guarantee.

[0004] With the development of deep learning technology, target detection models such as the YOLO series have gradually been used in mineral component identification. However, in high-magnification microscopic environments, such as when detecting lithium ore components under a 300x optical microscope, the characteristic differences between different mineral components are often very subtle, making it difficult to accurately identify them through conventional YOLO target detection models, and there are still many challenges. For example, quartz appears transparent under a microscope, with a certain thickness at the edge and a glassy luster; feldspar appears opaque; and although lithium mica is also transparent, its edges are thinner and usually flaky. These features are difficult to distinguish significantly in microscopic images, which can easily lead to false detections and missed detections.

[0005] In view of the above-mentioned deficiencies in the existing technologies, it is particularly necessary to develop a more efficient, accurate and real-time method for detecting lithium mineral components. Summary of the invention

[0006] The present invention provides a lithium mineral component detection method based on improved YOLOv8 to solve the technical problems that the prior art easily causes false detection and missed detection.

[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0008] On the one hand, the present invention provides a lithium mineral component detection method based on improved YOLOv8, comprising:

[0009] Collect dry powder samples of various lithium mineral components, photograph the collected dry powder samples under an optical microscope, and then construct a sample data set covering various lithium mineral components by segmenting and annotating the photographed images; wherein the lithium mineral components include: quartz, feldspar and lithium mica;

[0010] Improve the YOLOv8 network to obtain an improved YOLOv8 network;

[0011] Training the improved YOLOv8 network based on the sample data set;

[0012] The trained improved YOLOv8 network is used to detect lithium mineral components.

[0013] Furthermore, dry powder samples of various lithium mineral components are collected, and the collected dry powder samples are photographed under an optical microscope, and then the photographed images are segmented and annotated to construct a sample data set covering various lithium mineral components, including:

[0014] Dry powder samples of various lithium mineral components were collected at industrial sites after being ground and dried on the production line. The collected dry powder samples were placed under a 300x optical microscope for photography. Through the fine imaging technology of the microscope, microscopic images with the morphology, texture and edge characteristics of the mineral samples were obtained through multiple photography.

[0015] The preset image segmentation algorithm is used to process the microscopic images, and the segmentation of various mineral components in the mineral sample images is initially achieved. Then all the segmented sub-images are processed through edge detection, cropping and filling. The samples are adjusted to a size suitable for training, and irrelevant background information is removed. At the same time, filling is performed to unify the image ratio. Finally, a sample data set containing three samples of feldspar, quartz and lithium mica is constructed.

[0016] Furthermore, the improvement of the YOLOv8 network includes:

[0017] The Backbone network part of the YOLOv8 network uses a hierarchical structure consisting of ghost shuffle convolution and feature fusion modules to extract efficient and multi-scale image features.

[0018] Furthermore, the improvement of the YOLOv8 network includes:

[0019] The SPPF_LSKA pyramid structure is introduced into the YOLOv8 network. The feature maps extracted by convolution and C2f modules of layers 0-8 of the YOLOv8 network are input into the SPPF_LSKA pyramid structure. The SPPF_LSKA pyramid structure is used to realize multi-scale feature fusion, and the LSKA attention mechanism is introduced.

[0020] Furthermore, the improvement of the YOLOv8 network also includes:

[0021] In the PAN network of the Neck part of the YOLOv8 network, the convolution operations of the 16th and 19th layers are replaced with GSConv modules, and the C2f modules of the 18th and 21st layers are replaced with VoVGSCSP modules.

[0022] Furthermore, the improved YOLOv8 network is trained based on the sample data set, including:

[0023] Build a YOLOv8 network;

[0024] Pre-train the YOLOv8 network on the large-scale object detection dataset COCO;

[0025] Use a preset data annotation tool to manually annotate the sample data set in the YOLO target detection data format, and automatically divide it into a training set, a validation set, and a test set according to a preset ratio;

[0026] Reload the weight parameters of the pre-trained YOLOv8 network to provide optimized initial conditions for the improved YOLOv8 network; then train the improved YOLOv8 network on the training set. During the training process, continuously monitor the model performance through the validation set. After each training cycle, immediately evaluate the performance of the model on the validation set to observe the changes in accuracy and the dynamics of the loss value. If the accuracy continues to improve and the loss value continues to decrease, continue training; if there is a reversal trend, stop training;

[0027] After obtaining the trained improved YOLOv8 network, its performance is tested on the test set. First, the confidence filter is performed on the model prediction results to screen out the effective detection results with high confidence. Then, the non-maximum suppression algorithm is used to eliminate overlapping detection boxes and potential false detection boxes to further improve the accuracy of detection. Finally, the processed feature map is mapped back to the original scale to generate the final detection result.

[0028] The finally trained improved YOLOv8 network is deployed on smart equipment for lithium mineral composition detection.

[0029] Furthermore, when training the improved YOLOv8 network, the regression loss of the model consists of CIoU Loss and DFL Loss, and the classification loss of the model uses VFL Loss.

[0030] On the other hand, the present invention further provides an electronic device, comprising a processor and a memory; wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the above method.

[0031] In yet another aspect, the present invention further provides a computer-readable storage medium, wherein at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement the above method.

[0032] The beneficial effects brought about by the technical solution provided by the present invention include at least:

[0033] (1) Multi-scale feature fusion: This paper introduces the SPPF_LSKA pyramid structure and LSKA attention mechanism, which significantly improves the model's feature extraction and recognition capabilities in complex microscopic images, especially in the multi-scale feature fusion under different receptive fields;

[0034] (2) Lightweight design: Through the application of GSConv and VoVGSCSP modules, the present invention optimizes the convolution operation, reduces the number of model parameters and computational complexity, and ensures efficient real-time detection performance;

[0035] (3) Combination of high precision and high real-time performance: This paper combines multiple loss functions (CIoU Loss, DFL Loss, VFL Loss) and an improved feature extraction mechanism to balance the detection accuracy and model robustness, thereby improving the performance of the model in real-time applications;

[0036] (4) Adaptability to complex microscopic environments: In view of the subtle differences in lithium mineral components in microscopic images, the improved YOLOv8 model of the present invention can more accurately distinguish lithium mica, feldspar and quartz under complex backgrounds, solving the problems of false detection and missed detection in traditional detection methods;

[0037] (5) Industrial application deployment: The final model proposed in the present invention can be deployed on intelligent equipment for evaluating the flotation effect of lithium mica ore, realizing real-time industrial on-site detection and improving the efficiency of lithium mineral component identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0039] Figure 1 It is a schematic diagram of the execution flow of the lithium mineral component detection method based on the improved YOLOv8 provided in an embodiment of the present invention;

[0040] Figure 2 It is a technical solution diagram of a lithium mineral component detection method based on improved YOLOv8 provided in an embodiment of the present invention;

[0041] Figure 3 It is a YOLOv8s_original network structure diagram provided by an embodiment of the present invention;

[0042] Figure 4 It is a structural diagram of the SPPF_LSKA module provided in an embodiment of the present invention;

[0043] Figure 5 is a structural diagram of a GSConv module provided in an embodiment of the present invention;

[0044] Figure 6 1 is a structural diagram of a VoVGSCSP module provided by an embodiment of the present invention;

[0045] Figure 7 is a schematic diagram of performing pre-processing operations such as segmentation on a sample taken under a 300x optical microscope provided by an embodiment of the present invention;

[0046] Figure 8 is a schematic diagram of a portion of a data set provided by an embodiment of the present invention;

[0047] Fig. 9 is a PR curve diagram provided by an embodiment of the present invention;

[0048] Fig.10 It is a system block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0050] First of all, it should be noted that in the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "exemplarily" is intended to present the concept in a concrete way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.

[0051] First embodiment

[0052] This embodiment provides a lithium mineral component detection method based on improved YOLOv8, which is used to efficiently identify the main components of lithium ore, including lithium mica, quartz and feldspar. The method can be implemented by an electronic device, which can be a terminal or a server. The execution process of the method is as follows Figure 1 As shown, the following steps are included:

[0053] S1, collecting dry powder samples of various lithium mineral components, photographing the collected dry powder samples under an optical microscope, and then constructing a sample data set covering various lithium mineral components by segmenting and annotating the photographed images; wherein the lithium mineral components include: quartz, feldspar and lithium mica;

[0054] S2, improve the YOLOv8 network to obtain an improved YOLOv8 network;

[0055] S3, training the improved YOLOv8 network based on the sample data set;

[0056] S4, uses the trained improved YOLOv8 network to detect lithium mineral composition.

[0057] Specifically, the specific technical solution of the method of this embodiment is as follows: Figure 2 As shown, the implementation process is as follows:

[0058] (1) Preliminary construction of the YOLOv8 target detection network model. This network model has the advantages of efficient real-time performance, accurate feature extraction and automated processing, and can overcome the shortcomings of traditional lithium mineral detection methods. It consists of three basic modules: Backbone, Neck and Head. Backbone is responsible for multi-layer convolution operations to extract and encode the basic features of the image; Neck enhances the feature expression ability through multi-scale feature fusion to ensure the effective combination of information at different scales; Head is responsible for the final regression and classification tasks, converting the feature map into specific detection results. Specifically, the image is first sent to the Backbone feature extraction network for processing. The network structure contains multiple convolutional layers and their supporting operations, aiming to gradually extract key information from the image. The Backbone network corresponds to layers 0-9, and the features of the original image are gradually extracted and encoded through multi-layer convolution operations. The extracted feature map is then passed to the Neck part, where FPN (Feature Pyramid Network) and PAN (Path Aggregation Network) perform multi-scale feature fusion. FPN restores the size of the feature map through two upsampling operations, and splices these features with the 40×40 and 80×80 scale feature maps from the Backbone network in the channel dimension to retain detailed information at different scales. At the same time, the PAN network further extracts deeper feature information through two downsampling operations and fuses it with the feature maps of the same scale in the FPN network. Through this interaction between deep semantic information and shallow features, it ensures that the model can achieve fine feature extraction when processing complex images. Finally, the regression loss and classification loss are calculated in the Head part. The regression loss is composed of CIoU Loss (Complete Intersection Over Union Loss) and DFLLoss (Distributed Focal Loss), and the classification loss uses VFL Loss (Variable Weight Focal Loss). Complete Intersection Over Union Loss: , where IoU is the intersection over union of the predicted box and the true box, d is the distance between the center points of the predicted box and the true box, c is the diagonal distance of the minimum bounding rectangle, a is a function of v, and v is a correction factor used to further adjust the loss function and consider the shape and direction of the target box; Distributed focal loss: ,in Represents the probability distribution value of two adjacent bins in the distribution, represents the location of the target bounding box, They are respectively and The position value of the associated bin; variable weight focal loss: , where q is IoU, p is probability, represents the balance factor, is a hyperparameter of the adjustment factor. The loss function designed in this way can fully balance the detection accuracy and model robustness during model prediction. The prediction stage is performed on three feature map scales of 80×80, 40×40, and 20×20 to ensure that the location and category of the target object can be accurately detected at different scales. The target detection network is denoted as YOLOv8s_original, and its structure is as follows Figure 3 shown.

[0059] (2) In order to fully verify the superiority of the YOLOv8s_original model, we give priority to pre-training on the widely recognized large-scale target detection dataset COCO. This dataset contains 80 categories, covering targets of all scales from large to small. The data distribution is reasonable and rich, and it is widely used for evaluating and optimizing model performance. Using the COCO dataset for pre-training can not only provide high-quality initialization parameter settings for the pre-model, but also significantly improve the model's adaptability in complex environments, especially in the recognition of small targets in lithium mineral detection. Pre-training can ensure that the model has better detection accuracy and robustness, thereby greatly improving the performance of lithium mineral component detection.

[0060] (3) The pre-trained YOLOv8s_original model is saved as the pre-trained weight parameters of the subsequent improved model YOLOv8s_improved to speed up the convergence of the model. This process utilizes the learning results of the original pre-model on a large-scale dataset, providing a good initial condition for the improved model, enabling it to adapt to the feature distribution of specific tasks more quickly, reducing training time, and improving the accuracy and stability of the model in target detection.

[0061] (4) Obtain a number of feldspar, quartz, and lepidolite powders ground and dried on the production line at the industrial site, place the samples under a 300x optical microscope for high-precision photography. Through the microscope's fine imaging technology, multiple shots are taken to obtain high-definition microscopic images with information such as the morphology, texture, and edge features of the mineral samples.

[0062] (5) Use image segmentation algorithms to process microscopic images and initially achieve accurate segmentation of various mineral components in ore sample images. Such algorithms automatically identify and extract the boundaries of different minerals in microscopic images and generate independent sub-images. After segmentation, these sub-images basically retain important information such as morphology, texture, and edge features in the original microscopic images, ensuring that the mineral features after segmentation are highly consistent with their performance in the original image. All segmented sub-images are then processed through data preprocessing steps such as edge detection, cropping, and filling. The samples are adjusted to a size suitable for training, irrelevant background information is removed, and appropriate filling is performed to unify the image ratio. Finally, a high-quality image dataset of three samples, feldspar, quartz, and lithium mica, is constructed.

[0063] (6) Use data annotation tools to manually annotate the three types of data sets in YOLO target detection data format, and automatically divide the training set and validation set into appropriate proportions to ensure the reasonable distribution of the data set and the generalization ability of the model. In the process of automatic random division, the diversity and representativeness of the samples are retained to improve the accuracy and stability of the model in practical applications.

[0064] (7) Build the YOLOv8s_improved model. In order to better cope with the complex microscopic image environment, enhance the model's ability to extract features of different scales of lithium minerals, effectively distinguish the differences in mineral components such as lithium mica, feldspar, quartz, etc., and ensure the lightweight and real-time performance of the model, the present invention proposes an improved YOLOv8 model for the microscopic environment, which mainly makes the following improvements: First, the feature maps extracted by the convolution and C2f modules of layers 0-8 are input into the SPPF_LSKA pyramid structure to achieve efficient fusion and extraction of multi-scale features. Its structure is as follows: Figure 4As shown in the figure. In this structure, the initial feature map x1 is generated by convolution, and then the maximum pooling operation is performed on x1 to obtain the feature map y1, and the same two-step pooling operation is repeated in sequence to obtain the feature maps y2 and y3, so as to capture the key features under different receptive fields, and splice these features in the channel dimension to ensure the effective fusion of features of different scales. Secondly, in order to further enhance the discriminative ability of the model, especially when distinguishing the shape, texture and edge features of mineral components, the LSKA (Large Scale Kernel Attention) attention mechanism is specially introduced to improve the recognition accuracy of the model by accurately extracting key features, and reduce the spatial dimension through 1×1 convolution operation, simplify the calculation complexity, and retain sufficient feature information to support the efficient execution of subsequent classification and detection tasks. In addition, in the PAN network of the Neck part, the convolution operations of the 16th and 19th layers are replaced by the GSConv (Grouped ShuffleConvolution) module, and the C2f modules of the 18th and 21st layers are replaced by the VoVGSCSP module. The GSConv module first performs a standard convolution operation on the input feature map, and then divides it into two parallel paths, one for performing a depthwise separable convolution and the other for keeping it as it is. The processed features are concatenated in the channel dimension, and the information generated by the channel-intensive convolution operation is infiltrated into all parts of all the information generated by the DSC (depthwise separable convolution) through shuffling. Shuffling is a uniform mixing strategy that allows the feature information extracted by the channel-intensive convolution to be evenly exchanged on different channels and completely mixed into the depthwise separable convolution. While reducing the number of model parameters, it also reduces redundant information and simplifies frequent multiplication operations. Its structure is as follows: Figure 5 The VoVGSCSP module adopts a lightweight GSBottleneck structure, further enriches the feature representation through parallel branch design, and reduces the spatial dimension through 1×1 convolution. Its structure is as follows Figure 6 As shown in the figure. In this structure, the input feature map a is first divided into two parallel branches, the first branch generates output a1 through convolution operation, and then a1 is processed by GSBottleneck to obtain output b1. At the same time, the second branch also generates output a2 through convolution. Next, b1 and a2 are spliced ​​and interacted in the channel dimension to fuse the feature information of the two branches. Finally, the spatial dimension is reduced through 1×1 convolution operation, thereby simplifying the computational complexity of the model while retaining rich feature information. This design effectively enhances the feature extraction capability of the model and ensures the lightweight and high efficiency of the model.

[0065] (8) Reload the weight parameters of the YOLOv8s_original model in step 3 to provide optimized initial conditions for the YOLOv8s_improved model, accelerate the model convergence speed, and ensure higher efficiency and stability in subsequent training.

[0066] (9) Train the YOLOv8s_improved network model on all datasets. Before training begins, it is necessary to plan the number of samples to be processed in each batch (batch size), set the initial learning rate (learning rate), and select an appropriate gradient descent-based optimization algorithm.

[0067] (10) During the training process, continuously monitor the model performance through the validation set. After each training cycle, immediately evaluate the performance of the model on the validation set, focusing on the changes in accuracy and the dynamics of the loss value. If the accuracy continues to improve and the loss value continues to decrease, continue training; if a reversal trend occurs, immediately consider stopping training to prevent overfitting and waste of resources.

[0068] (11) The trained YOLOv8s_improved model is obtained and its performance is tested on the test set. First, the confidence filter is performed on the model prediction results to screen out the effective detection results with high confidence. Then, the non-maximum suppression (NMS) algorithm is used to eliminate overlapping detection boxes and potential false detection boxes to further improve the detection accuracy. Finally, the processed feature map is mapped back to the original scale to generate the final detection result.

[0069] (12) The finally trained detection model is deployed on the intelligent equipment for evaluating the flotation effect of lithium mica ore, so that it can process the microscopic image data from the site in real time.

[0070] In summary, after collecting a batch of dry powder samples of various components of lithium minerals (including quartz, feldspar, and lithium mica) at the industrial site, this embodiment is finely photographed under a 300x optical microscope to obtain high-definition microscopic images. By segmenting and annotating these images, a large-scale, high-quality data set covering three types of components is constructed. An improved network model is used to learn on the image data set. Specifically, in the model design and improvement, the Backbone network uses a hierarchical structure consisting of ghost shuffle convolution and feature fusion modules to extract efficient and multi-scale image features. By introducing a multi-scale feature fusion network (FPN-PAN) and combining feature pyramids and attention mechanisms, the model's ability to identify mineral components under complex microscopic images is enhanced. The specific SPPF_LSKA module captures important features in different receptive fields through maximum pooling operations and large-scale kernel attention mechanisms, and realizes accurate distinction between components such as lithium mica, feldspar and quartz. In addition, this model further optimizes the convolution operation through the GSConv and VoVGSCSP modules, reduces the amount of calculation, and realizes full exchange of feature information through the channel shuffle strategy, ensuring the real-time and high efficiency of the model. Through the above improvements, the YOLOv8 network structure of the present invention is significantly optimized in multi-scale feature extraction and fusion, application of attention mechanism, lightweight design and efficient loss calculation, making its performance in lithium mineral component detection more accurate and efficient, and suitable for real-time applications in industrial sites.

[0071] Below, the implementation process of the method of the present invention is described by taking a specific example of identifying the main components in lithium minerals. The present invention is mainly aimed at three types of minerals: quartz, feldspar and lepidolite, and the implementation steps are as follows:

[0072] 1. Based on Python 3.8.19 programming language and Pytorch 1.12.1 deep learning framework Figure 3 In the YOLOv8s_original model shown, the number of output categories is set to 3.

[0073] 2. Pre-train the YOLOv8_original model on the COCO dataset, so that the mAP@0.5 index of the model on the validation set reaches more than 65%.

[0074] 3. Save the pre-trained YOLOv8s_original model as the initial weights for the subsequent improved model.

[0075] 4. Obtain feldspar, quartz, and lithium mica powder samples from the industrial site after grinding and drying on the production line, place them under a 300x optical microscope for high-precision photography, and obtain several microscopic image samples.

[0076] 5. Preprocess the samples from step 4, using the Segment Anything (SAM) image segmentation algorithm and edge detection, cropping, and padding steps to uniformly adjust the samples to a standard size (400x400 pixels), such as Figure 7 As shown in Figure 2, this process obtains several sub-images and constructs a high-quality image dataset of three samples: feldspar, quartz, and lepidolite. Figure 8 shown.

[0077] 6. Use the LabelImg tool to manually annotate the data set in step 5 in the YOLO target detection format, and automatically divide the training set and the validation set into a ratio of 8:2.

[0078] 7. Improve the existing YOLOv8 network, adopt the SPPF_LSKA pyramid structure to realize multi-scale feature fusion, and introduce the LSKA attention mechanism. Figure 2 The convolution operations of layers 16 and 19 are replaced with GSConv modules, and the C2f modules of layers 18 and 21 are replaced with VoVGSCSP modules. On this basis, the YOLOv8s_improved model is built.

[0079] 8. Load the pre-trained parameters obtained in step 3 into YOLOv8s_improved, and use the complete data set to train the model. The batch size is set to 16, the initial learning rate (lr) is set to 0.01, the number of training rounds (epochs) is set to 300, and the optimizer uses SGD (stochastic gradient descent) with momentum term. The regression loss is calculated by CIoU Loss and DFL Loss, and the classification loss is calculated by VFL Loss. The test is performed using part of the pre-processed lithium mineral composition data set. The weight parameters are gradually optimized to improve the recognition accuracy and real-time performance of the model in complex microscopic images. After each training cycle, the accuracy of the model and the trend of the loss function are tested on the validation set to ensure continuous optimization of the model.

[0080] 9. After training, the final model is obtained. The average accuracy of the model under mAP@0.5 reaches 95%. The PR curve is plotted as follows: Fig. 9 As shown, it has good accuracy and robustness, and realizes high-accuracy real-time detection and identification of quartz, feldspar and lithium mica in lithium minerals.

[0081] Second embodiment

[0082] This embodiment provides an electronic device, such as Fig.10As shown, the electronic device includes: a processor and a memory; wherein the processor and the memory can be connected via a communication bus; the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method of the first embodiment. In addition, the electronic device may also include a transceiver, the processor and the transceiver can be connected via a communication bus, and the transceiver is used to communicate with other devices.

[0083] Next, combine Fig.10 The following is a detailed introduction to the various components of the electronic device:

[0084] Among them, the processor is the control center of the electronic device, and the electronic device may include multiple processors, each of which may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here may be a processor or a general term for multiple processing elements. For example, the processor is one or more central processing units (CPUs), or other general-purpose processors, application specific integrated circuits (ASICs), or one or more integrated circuits configured to implement an embodiment of the present invention, such as one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (field programmable gate arrays, FPGAs), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor may execute various functions of the electronic device by running or executing software programs stored in the memory and calling data stored in the memory.

[0085] In a specific implementation, as an embodiment, the processor may include one or more CPUs, such as Fig.10 The CPU0 and CPU1 shown in the figure are, of course, only exemplary.

[0086] The memory is used to store the software program for executing the solution of the present invention, and the execution is controlled by the processor. The specific implementation method can refer to the above method embodiment and will not be repeated here.

[0087] Optionally, the memory may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may be integrated with the processor or exist independently and accessed through the interface circuit ( Fig.10 The processor is coupled to the processor (not shown), which is not specifically limited in this embodiment of the present invention.

[0088] The transceiver may include a receiver and a transmitter ( Fig.10 The receiver is used to implement the receiving function, and the transmitter is used to implement the sending function. The transceiver can be integrated with the processor or exist independently and communicate with the electronic device through the interface circuit ( Fig.10 (not shown) is coupled to the processor, which is not specifically limited in this embodiment of the present invention.

[0089] In addition, it should be noted that Fig.10 The structure of the electronic device shown in the figure does not constitute a limitation on the device, and the actual device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In addition, the technical effects achieved by the electronic device when executing the method of the first embodiment above can refer to the technical effects described in the first embodiment above, so they are not repeated here.

[0090] Third embodiment

[0091] This embodiment provides a computer-readable storage medium, which stores at least one instruction, and the instruction is loaded and executed by a processor to implement the method of the first embodiment. The computer-readable storage medium may be a ROM, a random access memory, a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc. The instructions stored therein may be loaded by a processor in a terminal to execute the method.

[0092] In addition, it should be noted that the present invention can be provided as a method, an apparatus or a computer program product. Therefore, the embodiment of the present invention can be in the form of a full or partial hardware embodiment, a full or partial software embodiment or an embodiment combining software and hardware. Moreover, when implemented using software, the embodiment of the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. 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 process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. 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 one website, computer, server or data center to another website, computer, server or data center by wired (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center containing one or more available media sets. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium. The semiconductor medium may be a solid state drive.

[0093] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0094] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, so that a series of operation steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0095] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements. In addition, the term "and / or" is only an association relationship describing the associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone, wherein A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding. "At least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or plural.

[0096] In addition, it can be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0097] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0098] In several embodiments provided by the present invention, it should be understood that the disclosed equipment, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of functional modules / units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The unit described as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.

[0099] If the method is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0100] Finally, it should be noted that the above is only a preferred embodiment of the present invention. It should be pointed out that although the preferred embodiment of the present invention has been described, for ordinary technicians in this technical field, once the basic creative concept of the present invention is known, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the protection scope of the present invention. Therefore, the attached claims are intended to be interpreted as including the preferred embodiment and all changes and modifications that fall within the scope of the embodiments of the present invention.

Claims

1. A lithium mineral component detection method based on improved YOLOv8, characterized in that: include: Collect dry powder samples of various lithium mineral components, photograph the collected dry powder samples under an optical microscope, and then construct a sample data set covering various lithium mineral components by segmenting and annotating the photographed images; wherein the lithium mineral components include: quartz, feldspar and lithium mica; Improve the YOLOv8 network to obtain an improved YOLOv8 network; Training the improved YOLOv8 network based on the sample data set; The trained improved YOLOv8 network is used to detect lithium mineral components.

2. The lithium mineral component detection method based on improved YOLOv8 according to claim 1, characterized in that: The dry powder samples of various lithium mineral components are collected, and the collected dry powder samples are photographed under an optical microscope, and then the photographed images are segmented and annotated to construct a sample data set covering various lithium mineral components, including: Dry powder samples of various lithium mineral components were collected at industrial sites after being ground and dried on the production line. The collected dry powder samples were placed under a 300x optical microscope for photography. Through the fine imaging technology of the microscope, microscopic images with the morphology, texture and edge characteristics of the mineral samples were obtained through multiple photography. The preset image segmentation algorithm is used to process the microscopic images, and the segmentation of various mineral components in the mineral sample images is initially achieved. Then all the segmented sub-images are processed through edge detection, cropping and filling. The samples are adjusted to a size suitable for training, and irrelevant background information is removed. At the same time, filling is performed to unify the image ratio. Finally, a sample data set containing three samples of feldspar, quartz and lithium mica is constructed.

3. The lithium mineral component detection method based on improved YOLOv8 according to claim 1, characterized in that: The improvements to the YOLOv8 network include: The Backbone network part of the YOLOv8 network uses a hierarchical structure consisting of ghost shuffle convolution and feature fusion modules to extract efficient and multi-scale image features.

4. The lithium mineral component detection method based on improved YOLOv8 according to claim 1, characterized in that: The improvements to the YOLOv8 network include: The SPPF_LSKA pyramid structure is introduced into the YOLOv8 network. The feature maps extracted by convolution and C2f modules of layers 0-8 of the YOLOv8 network are input into the SPPF_LSKA pyramid structure. The SPPF_LSKA pyramid structure is used to realize multi-scale feature fusion, and the LSKA attention mechanism is introduced.

5. The lithium mineral component detection method based on improved YOLOv8 according to claim 4, characterized in that: The improvement of the YOLOv8 network also includes: In the PAN network of the Neck part of the YOLOv8 network, the convolution operations of the 16th and 19th layers are replaced with GSConv modules, and the C2f modules of the 18th and 21st layers are replaced with VoVGSCSP modules.

6. The lithium mineral component detection method based on improved YOLOv8 according to claim 1, characterized in that: The improved YOLOv8 network is trained based on the sample data set, including: Build a YOLOv8 network; Pre-train the YOLOv8 network on the large-scale object detection dataset COCO; Use a preset data annotation tool to manually annotate the sample data set in the YOLO target detection data format, and automatically divide it into a training set, a validation set, and a test set according to a preset ratio; Reload the weight parameters of the pre-trained YOLOv8 network to provide optimized initial conditions for the improved YOLOv8 network; then train the improved YOLOv8 network on the training set. During the training process, continuously monitor the model performance through the validation set. After each training cycle, immediately evaluate the performance of the model on the validation set to observe the changes in accuracy and the dynamics of the loss value. If the accuracy continues to improve and the loss value continues to decrease, continue training; if there is a reversal trend, stop training; After obtaining the trained improved YOLOv8 network, its performance is tested on the test set. First, the confidence filter is performed on the model prediction results to screen out the effective detection results with high confidence. Then, the non-maximum suppression algorithm is used to eliminate overlapping detection boxes and potential false detection boxes to further improve the accuracy of detection. Finally, the processed feature map is mapped back to the original scale to generate the final detection result. The finally trained improved YOLOv8 network is deployed on smart equipment for lithium mineral composition detection.

7. The lithium mineral component detection method based on improved YOLOv8 according to claim 6, characterized in that: When training the improved YOLOv8 network, the regression loss of the model consists of CIoU Loss and DFL Loss, and the classification loss of the model uses VFL Loss.

Citation Information

Patent Citations

  • Intelligent sorting and processing method and device for clay lithium ore

    CN117816580A

  • Intelligent analysis and determination method and device for minerals in clay lithium ore

    CN118039008A

Cited By

  • Raw ore classification method, device and equipment

    CN120107693A

  • Graphite ore image segmentation method based on improved YOLO11-seg model

    CN120782783A