Ore type identification method and system based on deep learning model

By combining the DenseNet model with the channel attention mechanism, and applying label smoothing and the AdamW optimizer, the problem of low efficiency in traditional ore identification methods is solved, and high-precision and robust automated ore identification is achieved.

CN121121341APending Publication Date: 2025-12-12GUANGZHOU UNIVERSITY +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511182492.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-22
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Traditional ore identification methods are inefficient and have poor accuracy. Existing technologies cannot meet the needs of modern mines for ore identification. The technical problem that existing technologies cannot solve is that they cannot achieve automated real-time classification in the field of ore identification.

Method used

The DenseNet model and channel attention mechanism are used to enhance the extraction capability of high-dimensional space features. Label smoothing, mixed precision training and AdamW optimizer are used to improve training efficiency and generalization performance. A master-slave dual classifier is designed to reduce the risk of misclassification.

Benefits of technology

A high-precision and robust ore identification system has been developed, enabling automated real-time classification in industrial settings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121121341A_ABST
    Figure CN121121341A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an ore type identification method and system based on a deep learning model, and the method comprises the steps: collecting a plurality of ore images, unifying the sizes of the collected images, constructing an ore image data set, and dividing the ore image data set into a training set and a test set; preprocessing the ore image, including cutting, overturning, color enhancement and standardization processing of the image to obtain an input tensor; a channel attention module is embedded by taking DenseNet161 as a backbone, high-dimensional spatial features are reserved, and a main classifier and an auxiliary classifier are arranged at the tail end in parallel to construct an ore recognition model; based on the training set, label smoothing, mixing precision training and an AdamW optimizer are adopted to carry out end-to-end training on the ore recognition model, and the model is verified through the test set; and inputting a to-be-identified ore image into the trained model, outputting a category probability by the main classifier, and taking the category corresponding to the maximum value as an identification result.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present document relates to the technical field of ore identification, and particularly relates to a kind of ore kind identification method and system based on deep learning model. BACKGROUND

[0002] China is rich in mineral resources, with the sustained growth of demand for mineral resources with industrial development, efficient identification and accurate classification of ore become the key link of resource development and utilization. There are more than 1700 kinds of ore, covering metal ore, non-metallic ore, energy ore and other categories, traditional manual identification relies on the experience of geology experts, there are problems such as low efficiency and subjective bias, which is difficult to meet the large-scale demand of modern mining and laboratory fields for ore identification. While laboratory chemical analysis has high accuracy, but the cost of single sample detection is more than 500 yuan, and the cycle is as long as 24-72 hours, which cannot support real-time decision-making in mining site.

[0003] In recent years, ore identification technology based on image analysis has gradually emerged, which realizes automatic classification by extracting visual features such as ore surface texture, color and crystal structure. Traditional algorithms rely on manually designed feature descriptors, and the representation ability of traditional algorithms for fine-grained features such as quartz-feldspar intergrowth structure in granite and layered stripes of hematite is insufficient. In addition, problems such as image blur caused by sudden changes in light and equipment vibration in open-pit mine make the recognition accuracy of traditional methods fluctuate by more than 18%.

[0004] The breakthrough of deep learning technology provides a new direction for ore identification. The DenseNet161 model proposed in 2017 has a dense connection mechanism, and has stood out in the fields of fault detection, medical diagnosis and image classification, which proves the feasibility of DenseNet161 in ore image identification and classification tasks. Convolutional neural network can learn to extract features in images during training to improve recognition accuracy, but in specific fields, there may be problems such as neural network degradation, long training time and unsuitable network structure. The application of DenseNet161 to ore identification tasks needs to be improved. SUMMARY

[0005] One or more embodiments of the present specification provide an ore kind identification method based on deep learning model, comprising:

[0006] S1, collect multiple ore images, unify the image size after collecting, and construct an ore image dataset, and divide the ore image dataset into a training set and a test set;

[0007] S2, pre-process the ore image, including image cropping, flipping, color enhancement and standardization, and obtain an input tensor;

[0008] S3, taking DenseNet161 as the backbone, embedding a channel attention module, retaining high-dimensional spatial features, and setting a main classifier and an auxiliary classifier in parallel at the end to construct an ore recognition model;

[0009] S4, based on the training set, using label smoothing, mixed precision training and AdamW optimizer to train the ore recognition model end to end, and verifying the model through the test set;

[0010] S5, input the image of the ore to be identified into the trained model, output the class probability by the main classifier, and take the class corresponding to the maximum value as the recognition result.

[0011] Further, step S1 specifically comprises:

[0012] A variety of ore images are collected in an environment irradiated by natural light and fluorescent light using a self-shooting method;

[0013] The color, shape, streak, transparency, fracture and luster features in each ore image are analyzed;

[0014] The characteristic part of each mineral image is intercepted, and is uniformly compressed to 320*240 pixels, to construct a common mineral image dataset;

[0015] The first 80% of each ore image is divided into a training set, and the last 20% is divided into a test set.

[0016] Further, the ore image is preprocessed, including image cropping, flipping, color enhancement and standardization, and the input tensor is obtained by the following specific method:

[0017] The input image is randomly cropped to 224*224 pixels, and the scaling ratio is dynamically adjusted;

[0018] The image is horizontally mirrored with a probability of 50%, to enhance the direction invariance;

[0019] The image is color jittered to enhance, including random adjustment within the range of brightness ±0.4, random adjustment within the range of contrast ±0.4, random adjustment within the range of saturation ±0.4, and random offset adjustment within the range of hue ±0.2;

[0020] The image data is converted from PIL format or NumPy array to PyTorch tensor with shape 3*H*W, and the pixel value range is in the interval of 0-1;

[0021] The parameters are normalized using the ImageNet dataset statistics: the mean of the RGB channels is [0.485, 0.456, 0.406], and the standard deviation of the RGB channels is [0.229, 0.224, 0.225], and the specific function expression is as follows:

[0022]

[0023] Further, using DenseNet161 as the backbone, embedding the channel attention module, preserving high-dimensional spatial features, and setting the main classifier and auxiliary classifier in parallel at the end, the ore recognition model is constructed as follows:

[0024] After the DenseNet161 dense block, the SE attention module is inserted, which dynamically adjusts the channel weight to enhance the ore texture features;

[0025] On the basis of the original classifier, an auxiliary classifier is added to form a multi-task learning framework, which provides additional gradient signals to alleviate the gradient vanishing.

[0026] Further, after the DenseNet161 dense block, the SE attention module is inserted, which dynamically adjusts the channel weight to enhance the ore texture features, which specifically includes:

[0027] In the SEBlock class, the SE attention module is configured through Squeeze and Excitation;

[0028] The Squeeze operation is designed to compress the input feature map to a spatial dimension of 1x1, preserving the channel information. The pooling within the module becomes (16, 2208, 1, 1), and the flattened output is (16, 2208);

[0029] The Excitation operation is designed to generate channel weights through dimension reduction, activation, dimension increase, and normalization;

[0030] The channel number channels = 2208 is configured, corresponding to the output channel number of the last feature layer of DenseNet161; the channel reduction factor reduction = 16 controls the complexity of the nonlinear transformation within the module;

[0031] The SE attention module is inserted after the feature extraction of the model, and the channel weight is generated by averaging the feature map within the SE module. The final output is the channel-by-channel product of the original feature map and the weight vector. Thus, the model's attention to important features of ore images is enhanced.

[0032] Further, on the basis of the original classifier, an auxiliary classifier is added to form a multi-task learning framework, which specifically includes:

[0033] Two fully connected classifiers are set in parallel at the end of the feature extraction network. The main classifier inherits from the original DenseNet161 structure, and the auxiliary classifier adds an independent branch.

[0034] The auxiliary classifier runs in parallel with the main classifier: they share a feature extraction layer but train parameters independently. The flattened features processed by the SE module, with the same number of classes as the main classifier output, are used for auxiliary supervision. The two classifiers share the same feature extraction backbone network, receiving a 2208×7×7 feature map output from the SE module as a common input.

[0035] The original single classifier is replaced with a dual classifier as a new fully connected layer, with an input dimension of 2208×7×7=108416 and an output dimension consistent with the number of classes.

[0036] Define the loss fusion formula: total loss = main classification loss + 0.4 × auxiliary classification loss. Forward propagation returns the bi-classification result.

[0037] Furthermore, during end-to-end training of the ore identification model:

[0038] The optimizer of the original DenseNet161 model was readjusted, replacing SGD with AdamW. The AdamW weight decay and gradient update function expressions are as follows:

[0039]

[0040] Set the AdamW optimizer parameters: L2 regularization coefficient weight_decay = 0.0001; model parameters to be optimized: model.parameters(); learning rate lr = 0.000112.

[0041] During the training phase, the optimizer is called. Before each backpropagation, the previous gradients are cleared using optimizer.zero_grad(), and the parameters are updated using scaler.step(optimizer).

[0042] This specification provides one or more embodiments of a mineral type identification system based on a deep learning model, including:

[0043] Image acquisition module: used to acquire images of various ores, and after standardizing the size of the acquired images, construct an ores image dataset, and divide the ores image dataset into training set and test set;

[0044] Image processing module: used to preprocess the ore image, including cropping, flipping, color enhancement and normalization of the image to obtain the input tensor;

[0045] Model building module: This module is used to build a mineral recognition model by embedding a channel attention module with DenseNet161 as the backbone, preserving high-dimensional spatial features, and setting up a main classifier and an auxiliary classifier in parallel at the end.

[0046] Model training module: used to perform end-to-end training of the ore identification model based on the training set, using label smoothing, mixed precision training and AdamW optimizer, and to verify the model through a test set;

[0047] Category recognition module: This module takes the image of the ore to be recognized as input into the trained model, and the main classifier outputs the category probability. The category corresponding to the maximum value is taken as the recognition result.

[0048] This specification provides one or more embodiments of an electronic device, including:

[0049] Processor; and,

[0050] A memory is configured to store computer-executable instructions, which, when executed, cause the processor to implement the steps of the above-described method for identifying ore types based on a deep learning model.

[0051] This specification provides one or more embodiments of a storage medium for storing computer-executable instructions that, when executed, implement the steps of the above-described method for identifying ore types based on a deep learning model.

[0052] By employing the embodiments of this invention, the preprocessing strategy of uniform size and data augmentation effectively expands the sample diversity. The combination of DenseNet161 and channel attention mechanism enhances the extraction capability of high-dimensional spatial features, enabling the model to accurately capture subtle differences in ores. The collaborative application of label smoothing, mixed precision training, and AdamW optimizer significantly improves training efficiency and generalization performance. At the same time, the design of a master-slave dual classifier further reduces the risk of misclassification. Ultimately, an end-to-end high-precision and robust ores identification system is achieved, which can be seamlessly deployed in industrial scenarios to realize automated real-time classification.

[0053] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0054] To more clearly illustrate the technical solutions in one or more embodiments of this specification or in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0055] Figure 1 A flowchart illustrating a method for identifying ore types based on a deep learning model, provided for one or more embodiments of this specification;

[0056] Figure 2 A flowchart illustrating the neural network training and testing process for a deep learning-based ore type identification method provided in one or more embodiments of this specification.

[0057] Figure 3 A schematic diagram of the SE attention module architecture for a mineral type identification method based on a deep learning model provided in one or more embodiments of this specification;

[0058] Figure 4 A schematic diagram illustrating the composition of a deep learning model-based ore type identification system provided in one or more embodiments of this specification;

[0059] Figure 5 This is a schematic diagram of the structure of an electronic device provided for one or more embodiments of this specification. Detailed Implementation

[0060] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of this document.

[0061] Method Implementation Examples

[0062] According to embodiments of the present invention, a method for identifying ore types based on a deep learning model is provided. Figure 1 A flowchart illustrating a method for identifying ore types based on a deep learning model, provided for one or more embodiments of this specification. Figure 2 A flowchart illustrating the neural network training and testing process for a deep learning-based ore type identification method provided in one or more embodiments of this specification, combined with... Figure 1 andFigure 2 As shown, the ore type identification method based on a deep learning model according to an embodiment of the present invention specifically includes:

[0063] S1. Collect various ore images, standardize the size of the collected images to construct an ore image dataset, and divide the ore image dataset into a training set and a test set.

[0064] Multiple mineral images were acquired using autonomous shooting methods under natural light and fluorescent lighting. The color, shape, streak, transparency, fracture, and luster characteristics of each mineral image were analyzed. The prominent features of each mineral image were extracted and uniformly compressed to a pixel size of 320*240 to construct a common mineral image dataset.

[0065] The dataset contains images covering 100 classes, including opal, iron ore, and quartz, with approximately 100 images per class, totaling 9734 images. The first 80% of images for each ore class are used as the training set, and the last 20% as the test set. The training and test set images are stored in two separate folders: `train` and `test`. Each ore class has its own directory named as follows: `class_directory_number_ore_name`, e.g., `class_001_milk quartz`. Images within each ore directory are named as follows: `directory_number_image_number.jpg`, e.g., `001_001.jpg`.

[0066] S2. Preprocess the ore image, including cropping, flipping, color enhancement and normalization, to obtain the input tensor.

[0067] First, the input image is randomly scaled and cropped to 224×224 pixels, with the scaling ratio dynamically adjusted. Then, the image is randomly horizontally mirrored with a 50% probability to enhance orientation invariance. Color dithering enhancement is applied, including random adjustments within ±0.4 ranges for brightness, contrast, saturation, and hue, and random offset adjustments within ±0.2 ranges. The image data is converted from PIL format or NumPy arrays to PyTorch tensors of shape 3×H×W, with pixel values ​​ranging from 0 to 1. Normalization is performed using ImageNet dataset statistical parameters: the mean RGB channels are [0.485, 0.456, 0.406], and the standard deviation RGB channels are [0.229, 0.224, 0.225]. The specific function expression is as follows:

[0068]

[0069] S3. Using DenseNet161 as the backbone, a channel attention module is embedded to retain high-dimensional spatial features, and a main classifier and an auxiliary classifier are set in parallel at the end to build a mineral recognition model.

[0070] An SE attention module is inserted after the dense blocks of DenseNet161 to dynamically adjust the channel weights and enhance the mineral texture features; for example... Figure 3 As shown, specifically:

[0071] Configure the SE attention module in the SEBlock class using Squeeze and Excitation;

[0072] The Squeeze operation is designed to compress the input feature map to a 1×1 spatial dimension while preserving channel information. It is then pooled within the module to become (16,2208,1,1), flattened to (16,2208), and finally output.

[0073] The Excitation operation is designed to generate channel weights through dimensionality reduction, activation, dimensionality increase, and normalization.

[0074] Configure the number of channels to 2208, which corresponds to the number of output channels of the last feature layer of DenseNet161; the channel reduction coefficient is 16, which controls the complexity of the nonlinear transformation within the module.

[0075] After feature extraction, the SE attention module is inserted into the model. Within the SE module, average pooling is performed on the feature map to generate channel weights. The final output is the channel-wise product of the original feature map and the weight vector. This enhances the model's focus on important features of ore images.

[0076] An auxiliary classifier is added to the original classifier to form a multi-task learning framework. The auxiliary classifier provides additional gradient signals, mitigating gradient vanishing. Specifically, this includes:

[0077] Two fully connected classifiers are set in parallel at the end of the feature extraction network. The main classifier inherits from the original DenseNet161 structure, and the auxiliary classifier adds an independent branch.

[0078] The auxiliary classifier runs in parallel with the main classifier, sharing the feature extraction layer but training parameters independently. It uses flattened features processed by the SE module and outputs the same number of classes as the main classifier for auxiliary supervision. The two classifiers share the same feature extraction backbone network and receive the 2208×7×7 feature map output by the SE module as a common input.

[0079] The original single classifier is replaced with a dual classifier as a new fully connected layer, with an input dimension of 2208×7×7=108416 and an output dimension consistent with the number of classes.

[0080] Define the loss fusion formula: total loss = main classification loss + 0.4 × auxiliary classification loss. Forward propagation returns the bi-classification result.

[0081] The feature processing method is improved by removing the global average pooling layer before the original DenseNet161 classifier and replacing it with direct flattening of high-dimensional features. A feature preservation mechanism is established to maintain the spatial dimension of the final feature map at 7×7. Tensor flattening is performed at the classifier input stage to convert the four-dimensional feature map into a two-dimensional matrix. The dimensionality transformation formula is as follows:

[0082]

[0083] Reconstruct the fully connected layer of the main classifier, adapt the input dimension to the flattened features, construct the auxiliary classifier branch, and share the same flattened feature input.

[0084] S4. Based on the training set, the ore identification model is trained end-to-end using label smoothing, mixed precision training, and the AdamW optimizer, and the model is validated using a test set.

[0085] Adjust the original label one-hot binary encoding, configure uniformly distributed label smoothing, change the probability of the correct class from 1 to 1-∈, and change the probability of other classes from 0 to ∈ / (K-1), where K is the number of classes. The function expression is:

[0086]

[0087] y one-hot = [0,0,…,1,…,0];

[0088] By adjusting the smoothing coefficient to ∈=0.1 by setting label_smoothing=0.1, label smoothing is applied to both the main classifier and the auxiliary classifier. When calculating the cross-entropy loss, the encoding of the true label is smoothed.

[0089] Mixed precision can be configured using the autocast() and GradScaler functions. autocast() automatically converts the precision of some simple operations to FP16, while keeping the precision of sensitive operations at FP32.

[0090] GradScaler is used to address gradient underflow / overflow issues caused by insufficient numerical range in FP16. This involves dynamically adjusting the scaling factor (growth_factor = 2.0); setting the scaling back factor (backoff_factor = 0.5) in case of gradient overflow; and increasing the scaling factor by the interval (growth_interval = 2000) when there is no overflow. The corresponding function expression is as follows:

[0091]

[0092] Where s is the dynamic scaling factor.

[0093] During the training and validation phases, the SE attention module, main classifier, auxiliary classifier, and DenseNet161 feature extraction layer, including convolutional layers, batch normalization layers, and activation functions, use mixed precision to cover all computational layers.

[0094] The optimizer of the original DenseNet161 model was readjusted, replacing SGD with AdamW. The AdamW weight decay and gradient update function expressions are as follows:

[0095]

[0096] Set the AdamW optimizer parameters: L2 regularization coefficient weight_decay = 0.0001; model parameters to be optimized: model.parameters(); learning rate lr = 0.000112.

[0097] During the training phase, the optimizer is called. Before each backpropagation, the previous gradients are cleared by optimizer.zero_grad(), and the parameters are updated by scaler.step(optimizer). After training is completed, the trained model weights are saved, and the accuracy and loss on the test set are calculated.

[0098] S5. Input the image of the ore to be identified into the trained model. The main classifier outputs the category probability, and the category corresponding to the maximum value is taken as the recognition result.

[0099] The beneficial effects of this invention are as follows:

[0100] By employing the embodiments of this invention, the preprocessing strategy of uniform size and data augmentation effectively expands the sample diversity. The combination of DenseNet161 and channel attention mechanism enhances the extraction capability of high-dimensional spatial features, enabling the model to accurately capture subtle differences in ores. The collaborative application of label smoothing, mixed precision training, and AdamW optimizer significantly improves training efficiency and generalization performance. At the same time, the design of a master-slave dual classifier further reduces the risk of misclassification. Ultimately, an end-to-end high-precision and robust ores identification system is achieved, which can be seamlessly deployed in industrial scenarios to realize automated real-time classification.

[0101] System Implementation Examples

[0102] According to embodiments of the present invention, a mineral type identification system based on a deep learning model is provided. Figure 4 A schematic diagram illustrating the composition of a deep learning model-based ore type identification system provided in one or more embodiments of this specification, as shown below. Figure 4 As shown, the ore type identification system based on a deep learning model according to an embodiment of the present invention specifically includes:

[0103] Image acquisition module 40: used to acquire various ore images, and after unifying the size of the acquired images, construct an ore image dataset, and divide the ore image dataset into a training set and a test set;

[0104] Image processing module 42: used to preprocess the ore image, including cropping, flipping, color enhancement and normalization of the image to obtain an input tensor;

[0105] Model building module 44: Used to build a mineral recognition model with DenseNet161 as the backbone, embedding a channel attention module, preserving high-dimensional spatial features, and setting a main classifier and an auxiliary classifier in parallel at the end.

[0106] Model training module 46: is used to perform end-to-end training of the ore identification model based on the training set, using label smoothing, mixed precision training and AdamW optimizer, and to verify the model through a test set;

[0107] Category recognition module 48: It is used to input the image of the ore to be recognized into the trained model, and the main classifier outputs the category probability. The category corresponding to the maximum value is taken as the recognition result.

[0108] The embodiments of the present invention are system embodiments corresponding to the above method embodiments. The specific operation of each module can be understood by referring to the description of the method embodiments, and will not be repeated here.

[0109] Device Example 1

[0110] This invention provides an electronic device, such as... Figure 5 As shown, it includes: a memory 50, a processor 52, and a computer program stored in the memory 50 and executable on the processor 52. When the computer program is executed by the processor 52, it performs the following method steps:

[0111] S1. Collect various ore images, standardize the size of the collected images to construct an ore image dataset, and divide the ore image dataset into a training set and a test set;

[0112] S2. Preprocess the ore image, including cropping, flipping, color enhancement and normalization, to obtain the input tensor;

[0113] S3. Using DenseNet161 as the backbone, embedding a channel attention module to retain high-dimensional spatial features, and setting a main classifier and an auxiliary classifier in parallel at the end to build a mineral recognition model.

[0114] S4. Based on the training set, the ore identification model is trained end-to-end using label smoothing, mixed precision training, and AdamW optimizer, and the model is validated using a test set.

[0115] S5. Input the image of the ore to be identified into the trained model. The main classifier outputs the category probability, and the category corresponding to the maximum value is taken as the recognition result.

[0116] Device Example 2

[0117] This invention provides a computer-readable storage medium storing an information transmission implementation program. When executed by a processor 52, the program performs the following method steps:

[0118] S1. Collect various ore images, standardize the size of the collected images to construct an ore image dataset, and divide the ore image dataset into a training set and a test set;

[0119] S2. Preprocess the ore image, including cropping, flipping, color enhancement and normalization, to obtain the input tensor;

[0120] S3. Using DenseNet161 as the backbone, embedding a channel attention module to retain high-dimensional spatial features, and setting a main classifier and an auxiliary classifier in parallel at the end to build a mineral recognition model.

[0121] S4. Based on the training set, the ore identification model is trained end-to-end using label smoothing, mixed precision training, and AdamW optimizer, and the model is validated using a test set.

[0122] S5. Input the image of the ore to be identified into the trained model. The main classifier outputs the category probability, and the category corresponding to the maximum value is taken as the recognition result.

[0123] The computer-readable storage media described in this embodiment include, but are not limited to, ROM, RAM, disk, or optical disk.

[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for identifying ore types based on a deep learning model, characterized in that, include: S1. Collect various ore images, standardize the size of the collected images to construct an ore image dataset, and divide the ore image dataset into a training set and a test set; S2. Preprocess the ore image, including cropping, flipping, color enhancement and normalization, to obtain the input tensor; S3. Using DenseNet161 as the backbone, embedding a channel attention module to retain high-dimensional spatial features, and setting a main classifier and an auxiliary classifier in parallel at the end to build a mineral recognition model. S4. Based on the training set, the ore identification model is trained end-to-end using label smoothing, mixed precision training, and AdamW optimizer, and the model is validated using a test set. S5. Input the image of the ore to be identified into the trained model. The main classifier outputs the category probability, and the category corresponding to the maximum value is taken as the recognition result.

2. The method according to claim 1, characterized in that, Step S1 specifically includes: Images of various minerals were captured using autonomous shooting methods in environments with natural light and fluorescent lighting. The color, shape, streak, transparency, fracture, and luster characteristics of each ore image were analyzed. Extract the prominent features of each mineral image and compress them uniformly to a pixel size of 320*240 to construct a common mineral image dataset; The first 80% of the images for each type of ore were assigned to the training set, and the last 20% were assigned to the test set.

3. The method according to claim 1, characterized in that, The ore image is preprocessed, including image cropping, flipping, color enhancement, and normalization, to obtain the input tensor. The specific method is as follows: The input image is randomly cropped to 224×224 pixels, and the scaling ratio is dynamically adjusted. The image is horizontally mirrored with a 50% probability to enhance orientation invariance; Color dithering enhancement is applied to the image, including random adjustment of brightness within ±0.4, random adjustment of contrast within ±0.4, random adjustment of saturation within ±0.4, and random offset adjustment of hue within ±0.

2. Convert image data from PIL format or NumPy array to a PyTorch tensor of shape 3×H×W, with pixel values ​​ranging from 0 to 1. Normalization was performed using statistical parameters from the ImageNet dataset: the RGB channels of the mean were [0.485, 0.456, 0.406], and the RGB channels of the standard deviation were [0.229, 0.224, 0.225]. The specific function expression is as follows:

4. The method according to claim 1, characterized in that, Using DenseNet161 as the backbone, embedding a channel attention module to preserve high-dimensional spatial features, and setting a main classifier and an auxiliary classifier in parallel at the end, the specific method for constructing the ore recognition model is as follows: An SE attention module is inserted after the dense blocks of DenseNet161 to enhance mineral texture features through dynamic adjustment of channel weights; An auxiliary classifier is added to the original classifier to form a multi-task learning framework. The auxiliary classifier provides additional gradient signals to alleviate gradient vanishing.

5. The method according to claim 4, characterized in that, Inserting an SE attention module after the dense blocks of DenseNet161, and dynamically adjusting the channel weights to enhance mineral texture features, specifically includes: Configure the SE attention module in the SEBlock class using Squeeze and Excitation; The Squeeze operation is designed to compress the input feature map to a 1×1 spatial dimension while preserving channel information. Within the module, pooling transforms it into (16, 2208, 1, 1), which is then flattened into (16, 2208) before the final output. The Excitation operation is designed to generate channel weights through dimensionality reduction, activation, dimensionality increase, and normalization. Configure the number of channels to 2208, which corresponds to the number of output channels of the last feature layer of DenseNet161; the channel reduction coefficient is 16, which controls the complexity of the nonlinear transformation within the module. After feature extraction, the SE attention module is inserted into the model. Within the SE module, average pooling is performed on the feature map to generate channel weights. The final output is the channel-wise product of the original feature map and the weight vector. This enhances the model's focus on important features of ore images.

6. The method according to claim 4, characterized in that, The multi-task learning framework is formed by adding an auxiliary classifier to the original classifier, specifically including: Two fully connected classifiers are set in parallel at the end of the feature extraction network. The main classifier inherits from the original DenseNet161 structure, and the auxiliary classifier adds an independent branch. The auxiliary classifier runs in parallel with the main classifier: they share the feature extraction layer but train parameters independently; the flattened features processed by the SE module have the same number of classes as the output of the main classifier and are used for auxiliary supervision; the two classifiers share the same feature extraction backbone network and receive the 2208×7×7 feature map output by the SE module as a common input; The original single classifier is replaced with a dual classifier as a new fully connected layer, with an input dimension of 2208×7×7=108416 and an output dimension consistent with the number of classes. Define the loss fusion formula: total loss = main classification loss + 0.4 × auxiliary classification loss. Forward propagation returns the bi-classification result.

7. The method according to claim 1, characterized in that, When performing end-to-end training on the ore identification model: The optimizer of the original DenseNet161 model was readjusted, replacing SGD with AdamW. The AdamW weight decay and gradient update function expressions are as follows: Set the AdamW optimizer parameters: L2 regularization coefficient weight_decay = 0.0001; model parameters to be optimized: model.parameters(); learning rate lr = 0.000112. During the training phase, the optimizer is called. Before each backpropagation, the previous gradients are cleared using optimizer.zero_grad(), and the parameters are updated using scaler.step(optimizer).

8. A mineral type identification system based on a deep learning model, characterized in that, include: Image acquisition module: used to acquire images of various ores, and after standardizing the size of the acquired images, construct an ores image dataset, and divide the ores image dataset into training set and test set; Image processing module: used to preprocess the ore image, including cropping, flipping, color enhancement and normalization of the image to obtain the input tensor; Model building module: This module is used to build a mineral recognition model by embedding a channel attention module with DenseNet161 as the backbone, preserving high-dimensional spatial features, and setting up a main classifier and an auxiliary classifier in parallel at the end. Model training module: used to perform end-to-end training of the ore identification model based on the training set, using label smoothing, mixed precision training and AdamW optimizer, and to verify the model through a test set; Category recognition module: This module takes the image of the ore to be recognized as input into the trained model, and the main classifier outputs the category probability. The category corresponding to the maximum value is taken as the recognition result.

9. An electronic device, characterized in that, include: processor; as well as, A memory configured to store computer-executable instructions, which, when executed, cause the processor to implement the steps of the mineral type identification method based on a deep learning model as described in any one of claims 1 to 7.

10. A storage medium, characterized in that, Used to store computer-executable instructions, which, when executed, implement the steps of the ore type identification method based on a deep learning model as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Mineral image classification method and device, equipment and storage medium

    CN121861384A