Metallic mineral polished section image mineral composition segmentation method based on improved yov8n

By improving the YOLOv8n model, the detection ability and feature extraction of small targets are enhanced, and the problems of low image segmentation accuracy and high misjudgment rate in the prior art are solved, and high precision segmentation of fine-grained minerals and optimization of computing resources are achieved.

CN119763107APending Publication Date: 2025-04-04KUNMING UNIV OF SCI & TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411716390.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The existing mineral light sheet image segmentation technology is difficult to achieve accurate segmentation of target minerals, especially when processing fine-grained minerals and images under different natural light, the segmentation accuracy is low and misjudgment is prone to occur.

Method used

By improving the YOLOv8n model, adding a small object detection layer and SCConv module, and introducing a ContextAggregation attention mechanism to enhance the detection capability and feature extraction of small objects.

Benefits of technology

The segmentation accuracy of fine-grained minerals in mineral light sheet images is significantly improved, the misjudgment and misjudgment rate is reduced, the average average accuracy value (Map@0.5) is improved by 6.75%, and the consumption of computing resources is greatly reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119763107A_ABST
    Figure CN119763107A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of process minerals, in particular to a metal mineral X-ray plate image mineral composition segmentation method based on improved yov8n, which comprises the following steps: S1, shooting a metal mineral X-ray plate image through a polarizing microscope, and accurately marking by using Label software; and S2, a small target detection layer and an SCConv module are added on the YOLOv8n, and a ContextAggregation attention mechanism is introduced at the same time, so that the detection capability and feature extraction of a small target can be enhanced. S3, performing multiple rounds of training by using an improved YOLOv8n model, adjusting a learning rate and refining training parameters, calling and outputting a trained weight file, and completing segmentation of mineral components of the metal mineral X-ray plate image; and S4, through performance comparison with other models, evaluating the model by using an average precision mean value (Map at 0.5) and an actual segmentation effect picture. The problems of common misrecognition and low average precision (Map at 0.5) during fine-particle-size mineral processing by a traditional segmentation method are effectively solved, and the Map at 0.5 of an improved model is improved by 6.75%.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of process minerals, and in particular to a method for segmenting mineral components of metal mineral light sheet images based on improved yolov8n. Background Art

[0002] Mineral optical slice segmentation and identification in process mineralogy can make it easier to quantify mineral types and particle size measurements, which is critical for understanding the composition, content and distribution of minerals. Accurately determining the types, contents and spatial distribution of minerals in ores provides a key basis for optimizing ore processing, metallurgical refining and beneficiation processes. The physical and chemical properties of different minerals directly affect the design of metallurgical processes. By accurately identifying the mineral composition, engineers can adjust the beneficiation and smelting processes to maximize metal recovery and improve resource utilization efficiency. In addition, mineral composition identification can also reveal the distribution patterns of minerals in ores, provide a scientific basis for deposit evaluation and resource development, and promote the development of the mining and metallurgical industries.

[0003] The measurement of metal mineral segmentation is currently mainly based on the method of analyzing mineral samples using a scanning electron microscope (SEM) combined with mineral liberation analysis (MLA). This method can be time-consuming and cumbersome, and scanning electron microscopes are expensive instruments with high purchase and maintenance costs. There is also the manual measurement of the particle size of metal minerals using a polarizing microscope. This method is for mineralogists to rely on manual observation and empirical judgment to identify and classify minerals, which is not only time-consuming but can also lead to subjective errors.

[0004] After studying the mineral image segmentation method, it was found that some current image segmentation technologies, such as threshold-based segmentation, region-based segmentation, edge-based segmentation, and clustering algorithm-based segmentation, are often difficult to achieve effective segmentation of target minerals alone, with low segmentation accuracy, and it is difficult to obtain a complete mineral outline. In addition, the detection effect of fine-grained minerals is poor, and the segmentation accuracy of pictures taken under different natural light is not high. When segmenting minerals with high color similarity, misjudgment may occur, and a marking box cannot be provided to mark the type of mineral. There is also a segmentation method based on the Mask-RCNN algorithm. Although this method can segment some metal mineral light sheet images, due to the fine and mixed mineral particle size of the actual metal mineral light sheet image, this results in a large number of small target particles with small pixels in the image, so the Mask-RCNN algorithm cannot complete the segmentation of small targets. The present invention finds that the mineral component segmentation method of metal mineral light sheet images based on the improved yolov8n can effectively achieve accurate segmentation of target minerals and even fine-grained minerals in metal mineral light sheet images. Summary of the invention

[0005] The purpose of the present invention is to provide a method for mineral component segmentation of metal mineral light sheet images based on improved yolov8n, so as to achieve effective segmentation of fine-grained minerals in metal mineral light sheet images.

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

[0007] A method for segmenting mineral components of metal mineral light sheet images based on improved yolov8n, comprising the following steps:

[0008] S1: Metal mineral light sheet images are captured using a polarizing microscope, accurately annotated using Labelme software, and data enhancement is used to improve the diversity of the dataset.

[0009] S2: Add a small target detection layer and SCConv module to YOLOv8n, and introduce the ContextAggregation attention mechanism to enhance the detection ability and feature extraction of small targets.

[0010] S3: Use the improved YOLOv8n model for multiple rounds of training, adjust the learning rate and refine the training parameters, call the output trained weight file, and complete the segmentation of the mineral components of the metal mineral light sheet image.

[0011] S4: The model is evaluated by comparing its performance with other models using the mean average precision (Map@0.5) and the actual segmentation effect map.

[0012] Furthermore, the step S1 includes the following sub-steps:

[0013] S1.1: Finely grind and polish the metal mineral to make a metal mineral light sheet, which is then photographed and saved under a polarizing microscope to obtain a metal mineral light sheet image.

[0014] S1.2: It is necessary to use labelme software to annotate mineral images based on the color, texture, correlation and other characteristics of different minerals.

[0015] S1.3: Data enhancement is performed on the annotated mineral images. The enhancement methods include horizontal flipping, random translation and scaling. The dataset is divided into training set (train), test set (test) and validation set (val) in a ratio of 7:2:1.

[0016] Furthermore, the improved method of YOLOv8n in step S2 includes:

[0017] Add a small target detection layer that replaces the c2f module with c2f_ScConv. This can not only better complete small target detection and segmentation, but also relatively reduce the computational cost, reduce redundant features and enhance the ability of feature representation.

[0018] Add a small object detection layer with a detection feature map size of 160×160 to detect small objects larger than 4×4.

[0019] The ContextAggregation attention mechanism is added to the c2f module and c2f_ScConv module of the Neck network of yolov8n. ContextAggregation aggregates context information at different positions in the feature map so that each feature point can perceive a wider area. It is used to enhance the detection capability of small targets and the feature refinement network, thereby enhancing the flexibility and processing capability of the model.

[0020] Furthermore, SCConv consists of two components: spatial reconstruction unit (SRU) and channel reconstruction unit (CRU). SRU suppresses spatial redundancy through a separation-reconstruction method, while CRU adopts a segmentation-conversion-fusion strategy to reduce channel redundancy.

[0021] Furthermore, step S3 specifically includes: setting the input size of the model to 640×640, and training according to the number of samples per batch as 4 and the number of multilinear processes as 8. The learning rate starts from 0.02 and is trained for multiple rounds to reach 0.01 to ensure that the model converges after multiple rounds of optimization; after the training is completed, the best.pt file generated by the model is called to segment the metal mineral light sheet image.

[0022] Furthermore, the step S4 specifically includes: the effect of the improved model needs to be carefully evaluated and compared. Through the performance experimental comparison of multiple models, including the original YOLOv8n model, the model with only the attention mechanism added (yolov8_c), the model with only the small target detection layer added (yolov8_s), and the comprehensively improved yolov8_o model.

[0023] Beneficial effects of the present invention:

[0024] The present invention applies image processing technology to the identification work based on polarizing microscope in the field of process mineralogy. Compared with the traditional mineral identification method based on polarizing microscope, this method not only saves more time than the traditional identification method, but also makes the identification result more reliable compared with the influence of human factors. At the same time, it provides a reliable prerequisite for the subsequent automation of embedded particle size measurement in process mineralogy. Based on this method, it is only necessary to calculate the mask area obtained by the algorithm to obtain the mineral content, which is much more efficient than traditional manual measurement. When targeting fine-grained mineral images, the test time can be shortened from several hours to a few seconds compared with traditional methods.

[0025] Based on the YOLOv8n model, the present invention significantly improves the segmentation accuracy by introducing a small target detection layer and a ContextAggregation attention mechanism. Specifically, the common misidentification and low average accuracy (Map@0.5) problems of traditional segmentation methods when dealing with fine-grained minerals have been effectively solved by the present invention, and the Map@0.5 of the improved model has been improved by 6.75%. This improvement is due to the fact that the ContextAggregation attention mechanism aggregates contextual information at different locations during the feature extraction process, giving feature points a wider range of perception capabilities, thereby significantly improving the accurate identification and segmentation accuracy of mineral types and reducing misjudgments and missed judgments.

[0026] The improved YOLOv8n model shows excellent performance in small target detection. The added small target detection layer enables the model to effectively process small target particles larger than 4×4, which is achieved by setting the new detection layer feature map to 160×160. Combined with the SCConv module, this configuration not only improves the ability to detect and segment tiny mineral particles, but also reduces computational redundancy. The SCConv module suppresses spatial and channel redundancy through the separation-reconstruction and segmentation-conversion-fusion strategies of the spatial reconstruction unit (SRU) and the channel reconstruction unit (CRU), respectively, to optimize computational efficiency and improve the feature representation capability of small targets.

[0027] The ContextAggregation attention mechanism plays a key role in feature aggregation. By adding this mechanism after the c2f module and c2f_ScConv module of the Neck network, the detection capability and feature refinement of small targets are enhanced. The specific mechanism is that this mechanism aggregates context information at different locations, enabling each feature point to perceive a wider range of environments, thereby making up for the lack of information on small targets. This aggregation of context information can make small targets more prominent in complex backgrounds, improve the detection performance of fine-grained minerals, and enhance the flexibility and adaptability of the model under changing conditions.

[0028] Optimization of computing resources is another major advantage of the invention. By replacing the traditional c2f module with the c2f_ScConv module, efficient detection of small targets is achieved without significantly increasing the computing cost. The SCConv module reduces complexity and computing cost by reducing redundant features and optimizing feature representation, and provides enhanced feature aggregation capabilities. In addition, during the data processing stage, high-quality mineral light slices obtained through fine grinding and polishing are combined with precise Labelme annotation software, supplemented by a variety of data enhancement methods (such as horizontal flipping, random translation, and scaling), which effectively improves the data diversity and representativeness of model training, providing a strong data support and training foundation for the model.

[0029] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0031] Figure 1 This is a network structure diagram after the present invention is improved based on yolov8n;

[0032] Figure 2 This is a comparison case diagram of the segmentation detection results of the yolov8n model before improvement and the segmentation detection results of the yolov8_o model after improvement. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0034] Example 1

[0035] The method for segmenting mineral components of metal mineral light sheet images based on improved yolov8n described in this embodiment includes the following steps:

[0036] S1: Metal mineral light sheet images are captured using a polarizing microscope, accurately annotated using Labelme software, and data enhancement is used to improve the diversity of the dataset.

[0037] S2: Add a small target detection layer and SCConv module to YOLOv8n, and introduce the ContextAggregation attention mechanism to enhance the detection ability and feature extraction of small targets.

[0038] S3: Use the improved YOLOv8n model for multiple rounds of training, adjust the learning rate and refine the training parameters, call the output trained weight file, and complete the segmentation of the mineral components of the metal mineral light sheet image.

[0039] S4: The model is evaluated by comparing its performance with other models using the mean average precision (Map@0.5) and the actual segmentation effect map.

[0040] In this embodiment, step S1 includes the following sub-steps:

[0041] S1.1: Finely grind and polish the metal mineral to make a metal mineral light sheet, which is then photographed and saved under a polarizing microscope to obtain a metal mineral light sheet image.

[0042] S1.2: It is necessary to use labelme software to annotate mineral images based on the color, texture, correlation and other characteristics of different minerals.

[0043] S1.3: Data enhancement is performed on the annotated mineral images. The enhancement methods include horizontal flipping, random translation and scaling. The dataset is divided into training set (train), test set (test) and validation set (val) in a ratio of 7:2:1.

[0044] In this embodiment, the improved method of YOLOv8n in step S2 includes:

[0045] Add a small target detection layer that replaces the c2f module with c2f_ScConv. This can not only better complete small target detection and segmentation, but also relatively reduce the computational cost, reduce redundant features and enhance the ability of feature representation.

[0046] Add a small object detection layer with a detection feature map size of 160×160 to detect small objects larger than 4×4.

[0047] The ContextAggregation attention mechanism is added after the c2f module and c2f_ScConv module of the Neck network of yolov8n. ContextAggregation aggregates context information at different positions in the feature map so that each feature point can perceive a wider area. It is used to enhance the detection capability of small targets and the feature refinement network, thereby enhancing the flexibility and processing capability of the model.

[0048] In this embodiment, SCConv includes two components: spatial reconstruction unit (SRU) and channel reconstruction unit (CRU). SRU suppresses spatial redundancy through a separation-reconstruction method, while CRU adopts a segmentation-conversion-fusion strategy to reduce channel redundancy.

[0049] In this embodiment, step S3 specifically includes: setting the input size of the model to 640×640, and training according to the number of samples per batch as 4 and the number of multilinear processes as 8. The learning rate starts from 0.02 and is trained for multiple rounds to reach 0.01 to ensure that the model converges after multiple rounds of optimization; after the training is completed, the best.pt file generated by the model is called to segment the metal mineral light sheet image.

[0050] In this embodiment, step S4 specifically includes: the effect of the improved model needs to be carefully evaluated and compared. Through the performance experimental comparison of multiple models, including the original YOLOv8n model, the model with only the attention mechanism added (yolov8_c), the model with only the small target detection layer added (yolov8_s), and the comprehensively improved yolov8_o model.

[0051] Example 2

[0052] This embodiment relies on the equipment and mineral light sheets of the Central Laboratory of Yunnan Bureau of Geology and Mineral Exploration and Development and Kunming University of Science and Technology to obtain mineral light sheet images, and uses PyCharm Community Edition 2020.1.3x64 software to write programs, in which the programming language is Python 3.9, the CUDA version is 11.3, the GPU is RTX 4060, the computer has a Core i7 processor, and the memory is 16G.

[0053] Combine the following Figure 1 , 2 Further explanation:

[0054] Finely grind and polish the metal minerals to make metal mineral slices, which are then photographed and saved under a polarizing microscope to form metal mineral slice images. It is necessary to annotate the mineral images using labelme software based on the color, texture, correlation and other characteristics of different minerals. Then, data enhancement is performed on the annotated mineral images, and the enhancement methods include horizontal flipping, random translation and scaling. The data set is divided into training set (train), test set (test) and validation set (val) in a ratio of 7:2:1.

[0055] Improve the network structure of yolov8n algorithm, such as Figure 1 shown, including:

[0056] Adding a small target detection layer that replaces the c2f module with c2f_ScConv can not only better complete the small target detection and segmentation, but also relatively reduce the computational cost, reduce redundant features and enhance the ability of feature representation. The non-metallic mineral light sheet image as a whole contains a large number of small target particles. The traditional yolov8n is relatively difficult to detect the particle points of these small targets. Therefore, the invention adds a small target detection layer with a detection feature map size of 160×160 in yolov8 for detecting small targets larger than 4×4. Among them, the original detection head of yolov8n is 3, which corresponds to the detection feature map size of 80×80 for detecting targets larger than 8×8, the corresponding detection feature map size of 40×40 for detecting targets larger than 16×16, and the corresponding detection feature map size of 20×20 for detecting targets larger than 32×32. In order to reduce the increase in computational cost caused by adding a small target detection layer, the present invention replaces the C2f module corresponding to the added small target detection head with a c2f_ScConv module that integrates the SCConv module, which can significantly reduce the complexity and computational cost while enhancing the ability of feature representation. Among them, SCConv includes two components: spatial reconstruction unit (SRU) and channel reconstruction unit (CRU). SRU suppresses spatial redundancy through a separation-reconstruction method, while CRU adopts a segmentation-conversion-fusion strategy to reduce channel redundancy.

[0057] The ContextAggregation attention mechanism is added after the c2f module and c2f_ScConv module of the Neck network of yolov8n to enhance the detection ability of small targets and the feature refinement network, which enhances the flexibility and processing ability of the model. ContextAggregation aggregates the context information of different positions in the feature map so that each feature point can perceive a wider area. This is particularly useful for the detection of small targets, because small targets have less information, and context aggregation can make up for the lack of their features, making small targets more prominent in complex backgrounds, thereby improving the model's detection performance for fine-grained minerals.

[0058] Comparison of detection effects before and after the improved yolov8n model of the present invention Figure 2 As shown. This experiment uses a self-made dataset, in which the input size of the model is set to 640×640, the number of samples per batch (batchsize) is 4, the multilinear process (workers) is set to 8, the learning rate (lr0) is set to 0.02, the final learning rate (lrf) is 0.01, and a total of 350 rounds of model training are performed to obtain the converged model weights. The average precision mean (Map@0.5) before and after the improvement of the yolov8n model is compared with the actual segmentation effect diagram for model evaluation.

[0059] In order to reflect the changes in the average precision mean (Map@0.5) obtained by training the data set before and after the improvement of each network of yolov8n, the present invention experimentally compares the precision (Precision), recall (Recall), and average precision mean (Map@0.5) obtained by training the data set under the same environment by four models: yolov8n, yolov8n model with only attention mechanism added (yolov8_c), yolov8n model with only improved small target detection layer added (yolov8_s), and our final yolov8n model with improved small target detection layer and attention mechanism added (yolov8_o). The experimental results are shown in Table 1.

[0060] Table 1

[0061]

[0062] According to the analysis in Table 1, the improved yolov8_o algorithm has improved the accuracy by 2.35%, the recall by 6.74%, and the mAP@0.5 by 6.75% compared with the original algorithm. As can be seen from the table, the improved yolov8_o algorithm has improved the performance compared with the original algorithm and other algorithms in the ablation experiment.

[0063] In order to reflect the application comparison of the yolov8n model before and after improvement, this embodiment randomly selected 3 images for testing, and called the weight files trained by the yolov8n and improved yolov8_o models for segmentation testing respectively. The comparison results are shown in Figure 2 As shown in Figure 2, a, b, and c are segmented images mainly composed of magnetite (May), chalcopyrite (Ccp), and pyrrhotite (Po), respectively, and the corresponding number of isolations for a single image segmentation is shown in Table 2. Figure 2 As can be clearly seen from Table 2, the improved yolov8_o algorithm has a higher segmentation accuracy in mineral segmentation of metal mineral light sheet images, especially solving the problem of insufficient segmentation ability of the original yolov8 algorithm in small target fine-grained minerals.

[0064] Table 2

[0065]

[0066] The preferred embodiments of the present invention disclosed above are only used to help illustrate the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A method for mineral component segmentation of metal mineral light sheet images based on improved yolov8n, characterized in that: The following steps are involved: S1: Take metal mineral light sheet images using a polarizing microscope, use Labelme software to accurately annotate them, and improve the diversity of the dataset through data enhancement; S2: Add a small target detection layer and SCConv module to YOLOv8n, and introduce the ContextAggregation attention mechanism to enhance the detection capability and feature extraction of small targets; S3: Use the improved YOLOv8n model to perform multiple rounds of training, adjust the learning rate and refine the training parameters, call the output trained weight file, and complete the segmentation of the mineral components of the metal mineral light sheet image; S4: The model is evaluated by comparing its performance with other models using the mean average precision Map@0.5 and the actual segmentation effect map.

2. The method for segmenting mineral components of metal mineral light sheet images based on improved yolov8n as claimed in claim 1, characterized in that: The step S1 comprises the following sub-steps: S1.1: Finely grind and polish the metal mineral to make a metal mineral light sheet, which is then photographed and saved under a polarizing microscope to obtain a metal mineral light sheet image; S1.2: It is necessary to use labelme software to annotate mineral images based on the color, texture, and correlation characteristics of different minerals; S1.3: Data enhancement is performed on the annotated mineral images. The enhancement methods include horizontal flipping, random translation and scaling. The dataset is divided into training set, test set and validation set in a ratio of 7:2:

1.

3. The method for segmenting mineral components of metal mineral light sheet images based on improved yolov8n as claimed in claim 1, characterized in that: The improved method of YOLOv8n in step S2 includes: Add a small target detection layer that replaces the c2f module with c2f_ScConv. On the basis of better completing small target detection and segmentation, it can also relatively reduce the computational cost, reduce redundant features and enhance the ability of feature representation; Add a small target detection layer with a detection feature map size of 160×160 to detect small targets larger than 4×4; The ContextAggregation attention mechanism is added to the c2f module and c2f_ScConv module of the Neck network of yolov8n. ContextAggregation aggregates context information at different positions in the feature map so that each feature point can perceive a wider area. It is used to enhance the detection capability of small targets and the feature refinement network, thereby enhancing the flexibility and processing capability of the model.

4. The method for segmenting mineral components of metal mineral light sheet images based on improved yolov8n as claimed in claim 3, characterized in that: SCConv consists of two components: the spatial reconstruction unit SRU and the channel reconstruction unit CRU; SRU suppresses spatial redundancy through a separation-reconstruction method, while CRU adopts a segmentation-conversion-fusion strategy to reduce channel redundancy.

5. The method for segmenting mineral components of metal mineral light sheet images based on improved yolov8n as claimed in claim 1, characterized in that: The step S3 specifically includes: setting the input size of the model to 640×640, and training according to the number of samples per batch being 4 and the number of multilinear processes being 8; starting the learning rate from 0.02, and performing multiple rounds of training to reach 0.01, to ensure that the model converges after multiple rounds of optimization; after the training is completed, calling the best.pt file generated by the model to segment the metal mineral light sheet image.

6. The method for segmenting mineral components of metal mineral light sheet images based on improved yolov8n as claimed in claim 1, characterized in that: The step S4 specifically includes: a detailed evaluation and comparison is required for the effect of the improved model; a performance experimental comparison of multiple models, including the original YOLOv8n model, the model yolov8_c with only the attention mechanism added, the model yolov8_s with only the small target detection layer added, and the comprehensively improved yolov8_o model.

Citation Information

Cited By

  • Ancient building wood member deterioration evaluation method based on microscopic structure image quantitative analysis

    CN120668662A

  • Data processing method and device based on image recognition and cone crusher

    CN121438298A