BGF-YOLO: Deep Learning for Mineral Classification Using Hyperspectral Imaging

Research Article
Open access

BGF-YOLO: Deep Learning for Mineral Classification Using Hyperspectral Imaging

Zhebin Yu 1* , Xiaojun Qi 2 , Ang Li 3 , Jialin Wei 4 , Wei Liu 5 , Wei Su 6 , Zongfa Li 7
  • 1 China National Gold Group Geology Co., Ltd., Liuyin Park South Street, Dongcheng District, Beijing, China    
  • 2 China National Gold Group Geology Co., Ltd., Liuyin Park South Street, Dongcheng District, Beijing, China    
  • 3 China National Gold Group Geology Co., Ltd., Liuyin Park South Street, Dongcheng District, Beijing, China    
  • 4 China National Gold Group Geology Co., Ltd., Liuyin Park South Street, Dongcheng District, Beijing, China    
  • 5 China National Gold Group Geology Co., Ltd., Liuyin Park South Street, Dongcheng District, Beijing, China    
  • 6 China National Gold Group Geology Co., Ltd., Liuyin Park South Street, Dongcheng District, Beijing, China    
  • 7 China National Gold Group Geology Co., Ltd., Liuyin Park South Street, Dongcheng District, Beijing, China    
  • *corresponding author slm0718m@163.com
ACE Vol.173
ISSN (Print): 2755-273X
ISSN (Online): 2755-2721
ISBN (Print): 978-1-80590-231-7
ISBN (Online): 978-1-80590-232-4

Abstract

The rising resource demands in emerging economies have intensified resource nationalism in mineral-rich countries, necessitating more efficient mineral processing technologies for declining ore grades. This study presents BGF-YOLO, a novel deep learning model enhanced from YOLOv8, designed to optimize mineral beneficiation by accurately identifying mineral species and grain sizes using hyperspectral imaging. The system utilizes hyperspectral data spanning 66 spectral bands (400–1000 nm) and processes large datasets through advanced feature fusion and attention mechanisms. BGF-YOLO integrates a Generalized Feature Pyramid Network (GFPN), Dual-Level Routing Attention (DLRA), and an additional detection head to improve multi-scale feature detection and reduce redundant information. Evaluated on a dataset of 4,975 samples across five mineral classes, the model achieved an overall accuracy of 91.9%, with Galena and Hematite large particles attaining 94.9% and 100.0% accuracy, respectively. Comparative analysis showed that BGF-YOLO outperforms the baseline YOLOv8 by approximately 5% in accuracy. These results demonstrate the potential of combining hyperspectral imaging with advanced deep learning architectures to enhance the precision and efficiency of mineral classification and grain size determination in beneficiation processes.

Keywords:

Hyperspectral Imaging, Deep Learning, BGF-YOLO, Mineral Classification, Grain Size Identification, Feature Pyramid Network, Attention Mechanism

Yu,Z.;Qi,X.;Li,A.;Wei,J.;Liu,W.;Su,W.;Li,Z. (2025). BGF-YOLO: Deep Learning for Mineral Classification Using Hyperspectral Imaging. Applied and Computational Engineering,173,1-7.
Export citation

1. Introduction

The increasing resource demand in emerging economies has led to the rise of resource nationalism in mineral-rich countries, driving the need for more efficient resource development [1]. As ore grades decline over time, improving mineral processing technology for low-grade ores becomes essential. Rock classification plays a crucial role in this process. The envisioned system aims to assist in mineral beneficiation by identifying mineral species and grain sizes after rough sorting, thus optimizing operations. The system helps in the detailed size determination of sorted ores and can also inform blasting operations to avoid dilution of mineral grade [2].

Geometallurgy and process mineralogy, which involve thorough characterization of ore mineralogy, are key to optimizing metallurgical flowsheets. These fields have evolved to incorporate machine learning to build better beneficiation processes [3]. In this context, a new approach was developed by combining hyperspectral imaging and deep learning, which we call "pre-mineral processing." This system analyzes spectral data from visible to near-infrared light (400–1000 nm) to identify mineral species and grain sizes, providing essential data for subsequent beneficiation stages [4].

Deep learning, particularly Convolutional Neural Networks (CNN), excels in handling large datasets and automatically extracting features from hyperspectral images, such as wavelength peaks and slopes characteristic of different minerals [5]. In this study, minerals like chalcopyrite, galena, and hematite were selected for classification experiments, including grain size identification [6]. The system demonstrated its potential not only for classifying mineral types (sulfides and oxides) but also for identifying grain sizes, thus improving the efficiency of mineral processing [7].

2. BGF-YOLO network for metal mineral recognition

2.1. BGF-YOLO model

图片
Figure 1: Improved BGF-YOLO model structure

In this study, hyperspectral imaging technology was used to acquire image data of ore samples containing 66 high-resolution spectral bands. These hyperspectral data form a data cube, which is stored in 512 pixels in the vertical direction, 512 pixels in the horizontal direction, and 204 pixels in depth, corresponding to spectral data at different wavelengths (400 -- 1000 nm). In order to improve the learning accuracy and generalization ability of the deep learning model, we perform the following preprocessing steps on the hyperspectral data: 1) Pixel partition and data augmentation: The vertical and horizontal pixels are divided into 16 equal parts, and 256 data cubes with 32 pixels in vertical and 204 pixels in depth are generated for each image. This division not only increases the amount of data and improves the training effect of the model, but also helps to capture mineral characteristics at different spatial scales. 2) Wavelength Direction segmentation and standardization: In order to reduce the computational requirements required to classify spectral anomalies and avoid the noise or anomaly of individual pixels affecting the overall ability of convolutional neural network (CNN), we segment and standardize the hyperspectral data in the wavelength direction. Subsequently, the data of the 16 segmentations were averaged in each vertical and horizontal direction, resulting in one vertical and one horizontal pixel and 204 pixel depth data. 3)RGB image extraction and processing: RGB images can also be extracted separately from the data cube captured by the hyperspectral camera.

To enhance the accuracy and efficiency of mineral species and grain size identification, we propose a novel deep learning model named BGF-YOLO. This model builds upon YOLOv8 by incorporating a Generalized Feature Pyramid Network (GFPN), Dual-Level Routing Attention (DLRA), and an additional fourth detection head, significantly improving multi-scale feature fusion and object detection performance.

2.2. Feature Pyramid Network (FPN) and Generalized-Fpn (GFPN)

The Feature Pyramid Network (FPN) was initially introduced to address hierarchical feature fusion challenges in CNNs, effectively enhancing the model's ability to detect objects at various scales. The Generalized-FPN (GFPN) advances this concept by incorporating dense connections and "queen fusion" structures. Instead of traditional summation operations, GFPN employs concatenation for feature fusion, reducing information loss and generating more efficiently fused features. Additionally, GFPN enhances the model's capability to capture multi-scale mineral features through multi-level feature fusion.

In BGF-YOLO, we optimized YOLOv8’s FPN-PANet structure by integrating GFPN and Cross Stage Partial DenseNet (CSP) modules. This integration introduces skip connections, enabling information sharing across different spatial scales and non-adjacent semantic levels. Consequently, the neck architecture can simultaneously process high-level semantic information and low-level spatial details, improving adaptability to diverse mineral characteristics.

2.3. Dual-Level Routing Attention (DLRA)

图片
Figure 2: The structure of DLRA

To further enhance feature fusion and mitigate redundancy in YOLOv8's feature maps, we introduce the Dual-Level Routing Attention (DLRA) module within BGF-YOLO. DLRA is a dynamic, query-aware sparse attention mechanism that selects the most relevant key/value pairs for each query in a content-aware manner. The implementation process is as follows: 1) Feature Map Region Division: The input feature map is divided into multiple regions, and linear transformations are applied to generate queries, keys, and values. 2) Adjacency Matrix Construction: Based on the regional relationships between queries and keys, an adjacency matrix is constructed to form a directed graph, identifying specific key-value pair associations. 3) Multi-Head Self-Attention Mechanism: Utilizing a dual-level routing optimized multi-head self-attention mechanism, DLRA focuses on regions of the feature map that are relevant to mineral detection, thereby reducing redundant information and enhancing detection accuracy.

The DLRA module is integrated into the feature fusion process by placing it after convolution or upsampling modules. This positioning ensures that the model concentrates on specific regions post-feature extraction, thereby improving the identification of mineral species and grain sizes. Additionally, skip connections within CSP modules prevent information loss, ensuring effective utilization of underlying feature maps.

2.4. Multi-detection head structure

图片
Figure 3: The structure of CSP

YOLOv8 originally comprises three detection heads corresponding to feature map scales of 20×20, 40×40, and 80×80 pixels. However, these scales are insufficient for detecting larger grain sizes in mineral samples. To address this limitation, BGF-YOLO introduces an additional fourth detection head at a 160×160 pixel scale, aligning with the newly structured feature fusion network. This new detection head integrates shallow information from the first C2f (with skip connections) module of the input images through additional feature fusion networks, thereby enhancing the model’s ability to detect minerals of varying grain sizes.

The inclusion of the fourth detection head allows for the classification and localization of minerals with different grain sizes, facilitating progressive detection. This step-wise approach improves the model’s accuracy and robustness in complex mineral processing scenarios by enabling the model to first identify potential regions of interest and then refine its predictions through subsequent detection stages.

2.5. Training and evaluation

We employed transfer learning to construct the BGF-YOLO network, initializing it with pre-trained weights from the YOLOv8 architecture. The final learning layer and classification layer were replaced to accommodate the new hyperspectral image dataset, followed by retraining. The training dataset is divided into training, validation, and testing subsets, as detailed in Table 2. To accelerate data processing and ensure diversity and representativeness in each training sample, both RGB images and hyperspectral data were segmented into 16×16×3 pixel and 32-pixel segments, respectively.

During model training, we utilized the standard cross-entropy loss function and the Adam optimizer, setting appropriate learning rates and batch sizes to ensure model convergence and generalization. Hyperparameter tuning was conducted using the validation set to prevent overfitting. Finally, the performance of BGF-YOLO was evaluated on the test set, demonstrating its superior performance in mineral species and grain size identification tasks. Evaluation metrics included accuracy, recall, F1 score, and mean Average Precision (mAP) to comprehensively assess the model’s detection efficacy.

3. Experiment

To assess the effectiveness of the proposed BGF-YOLO model, we conducted experiments using a hyperspectral dataset containing 4,975 samples across five mineral classes: Galena, Chalcopyrite, Hematite with large particles, Hematite with small particles, and Hematite with very small particles. The dataset was divided into training (3,978 samples), validation (498 samples), and testing (501 samples) subsets, as detailed in Table 1, to ensure comprehensive model training and unbiased evaluation.

Table 1: Hyperspectral dataset distribution

Hyperspectral Data 1×1×204 Pixels

Training Data

Validation Data

Test Data

Total

Galena

792

96

97

985

Chalcopyrite

781

95

97

973

Hematite large particles

765

93

93

951

Hematite small particles

817

110

109

1036

Hematite very small particles

823

104

105

1032

Each hyperspectral image, originally sized at 512×512 pixels with 204 spectral bands, was partitioned into 16 segments, resulting in 256 data cubes per image (32×32 pixels with 204 bands each). This segmentation increased data volume and captured mineral features at various spatial scales. We applied data augmentation techniques such as rotation and flipping to enhance model robustness. Additionally, spectral data were standardized to reduce noise, and complementary RGB images were extracted to provide spatial context. The BGF-YOLO model extends YOLOv8 by integrating a Generalized Feature Pyramid Network (GFPN) for enhanced multi-scale feature fusion, a Dual-Level Routing Attention (DLRA) module to focus on relevant features, and an additional detection head at a 160×160 pixel scale to better detect larger grain sizes. These enhancements collectively improve the model’s ability to accurately classify mineral species and determine grain sizes. We employed transfer learning by initializing BGF-YOLO with pre-trained YOLOv8 weights, replacing the final layers to suit the hyperspectral dataset. Training utilized the Adam optimizer with a learning rate of 0.0035 over 300 epochs, incorporating early stopping based on validation loss to prevent overfitting. Hyperparameter tuning and data augmentation were applied to optimize model performance and generalization. The model’s performance was evaluated using accuracy, recall, F1 score, and mean Average Precision (mAP). Table 2 summarizes the prediction accuracies on the test set, where BGF-YOLO achieved an overall accuracy of 91.9%, outperforming the baseline YOLOv8 by approximately 5%.

Table 2: Prediction of deep learning results

Hyperspectral Data 1×1×204 Pixels

Prediction

Galena

94.9%

Chalcopyrite

85.3%

Hematite large particles

100.0%

Hematite small particles

85.4%

Hematite very small particles

88.9%

Total

91.9%

BGF-YOLO demonstrated exceptional performance, particularly in classifying Hematite with large particles (100.0% accuracy) and Galena (94.9% accuracy). The slightly lower accuracies for Chalcopyrite and Hematite with smaller particles (85.3%–88.9%) indicate potential areas for improvement, possibly through enhanced feature extraction or additional data augmentation. The integration of GFPN and DLRA significantly contributed to the model’s superior performance by improving multi-scale feature detection and reducing redundant information.

4. Conclusion

This study introduced BGF-YOLO, an enhanced deep learning model based on YOLOv8, designed for accurate classification of mineral species and grain size identification using hyperspectral imaging. By integrating a Generalized Feature Pyramid Network (GFPN), Dual-Level Routing Attention (DLRA), and an additional detection head, BGF-YOLO effectively improves multi-scale feature detection and reduces information redundancy.

Experimental results showed that BGF-YOLO achieved an overall accuracy of 91.9% on 4,975 samples across five mineral classes, outperforming the baseline YOLOv8 by approximately 5%. The model excelled in classifying Hematite with large particles (100.0%) and Galena (94.9%), demonstrating its superior feature fusion and attention mechanisms. However, accuracies for Chalcopyrite and Hematite with smaller particles were slightly lower, indicating areas for improvement.

Future work will focus on advanced feature extraction, enhanced data augmentation, and incorporating additional data modalities to boost performance for challenging classes. Additionally, optimizing BGF-YOLO for real-time industrial deployment could enhance its practical applicability.

In summary, BGF-YOLO represents a significant advancement in leveraging deep learning and hyperspectral imaging for mineral beneficiation. Its accurate classification capabilities provide valuable insights for optimizing mineral processing operations, addressing challenges of declining ore grades and resource nationalism in emerging economies. The integration of advanced deep learning architectures with hyperspectral data processing paves the way for more efficient and precise mineral classification systems, contributing to sustainable and effective resource development.


References

[1]. Sun Y, Ortiz J. An ai-based system utilizing iot-enabled ambient sensors and llms for complex activity tracking [J]. arXiv preprint arXiv: 2407.02606, 2024.

[2]. Kang M, Ting C M, Ting F F, et al. Bgf-yolo: Enhanced yolov8 with multiscale attentional feature fusion for brain tumor detection [C]//International Conference on Medical Image Computing and Computer-Assisted Intervention. Cham: Springer Nature Switzerland, 2024: 35-45.

[3]. Dumont J A, Lemos Gazire M, Robben C. Sensor-based ore sorting methodology investigation applied to gold ores [J]. Procemin Geomet, 2017.

[4]. Liu C, Li M, Zhang Y, et al. An enhanced rock mineral recognition method integrating a deep learning model and clustering algorithm [J]. Minerals, 2019, 9(9): 516.

[5]. Zhang W, Sun W, Hu Y, et al. Selective flotation of pyrite from galena using chitosan with different molecular weights [J]. Minerals, 2019, 9(9): 549.

[6]. Y. Liu, Z. Zhang, X. Liu, L. Wang, and X. Xia, ‘‘Ore image classification based on small deep learning model: Evaluation and optimization of model depth, model structure and data size, ’’ Minerals Eng., 2021, Art. no. 107020, doi: 10.1016/j.mineng.2021.107020.

[7]. Wu B, Cai Z, Wu W, et al. AoI-aware resource management for smart health via deep reinforcement learning [J]. IEEE Access, 2023.


Cite this article

Yu,Z.;Qi,X.;Li,A.;Wei,J.;Liu,W.;Su,W.;Li,Z. (2025). BGF-YOLO: Deep Learning for Mineral Classification Using Hyperspectral Imaging. Applied and Computational Engineering,173,1-7.

Data availability

The datasets used and/or analyzed during the current study will be available from the authors upon reasonable request.

Disclaimer/Publisher's Note

The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of EWA Publishing and/or the editor(s). EWA Publishing and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

About volume

Volume title: Proceedings of the 7th International Conference on Computing and Data Science

ISBN:978-1-80590-231-7(Print) / 978-1-80590-232-4(Online)
Editor:Marwan Omar
Conference website: https://2025.confcds.org/
Conference date: 25 September 2025
Series: Applied and Computational Engineering
Volume number: Vol.173
ISSN:2755-2721(Print) / 2755-273X(Online)

© 2024 by the author(s). Licensee EWA Publishing, Oxford, UK. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license. Authors who publish this series agree to the following terms:
1. Authors retain copyright and grant the series right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this series.
2. Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the series's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this series.
3. Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See Open access policy for details).

References

[1]. Sun Y, Ortiz J. An ai-based system utilizing iot-enabled ambient sensors and llms for complex activity tracking [J]. arXiv preprint arXiv: 2407.02606, 2024.

[2]. Kang M, Ting C M, Ting F F, et al. Bgf-yolo: Enhanced yolov8 with multiscale attentional feature fusion for brain tumor detection [C]//International Conference on Medical Image Computing and Computer-Assisted Intervention. Cham: Springer Nature Switzerland, 2024: 35-45.

[3]. Dumont J A, Lemos Gazire M, Robben C. Sensor-based ore sorting methodology investigation applied to gold ores [J]. Procemin Geomet, 2017.

[4]. Liu C, Li M, Zhang Y, et al. An enhanced rock mineral recognition method integrating a deep learning model and clustering algorithm [J]. Minerals, 2019, 9(9): 516.

[5]. Zhang W, Sun W, Hu Y, et al. Selective flotation of pyrite from galena using chitosan with different molecular weights [J]. Minerals, 2019, 9(9): 549.

[6]. Y. Liu, Z. Zhang, X. Liu, L. Wang, and X. Xia, ‘‘Ore image classification based on small deep learning model: Evaluation and optimization of model depth, model structure and data size, ’’ Minerals Eng., 2021, Art. no. 107020, doi: 10.1016/j.mineng.2021.107020.

[7]. Wu B, Cai Z, Wu W, et al. AoI-aware resource management for smart health via deep reinforcement learning [J]. IEEE Access, 2023.