A method for removing blur of a graphite ore image based on deep learning
By using a GAN-based deblurring model and a Transformer module for multi-scale feature fusion, the blurring problem in graphite ore image acquisition environments was solved, improving the accuracy and efficiency of ore grade identification and reducing computational complexity.
Patent Information
- Application Number
- CN202510651841.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2045-05-20
AI Technical Summary
In the process of graphite ore mining, the image acquisition environment is complex, resulting in blurry images. Existing deep learning methods perform poorly in practical applications and are difficult to effectively process motion-blurred images, affecting the accuracy and efficiency of ore grade identification.
A deblurring model based on Generative Adversarial Networks (GANs) is adopted, which combines transfer learning and multi-scale feature fusion in the Transformer module, introduces ECA attention mechanism, replaces 7×7 convolution with multiple 3×3 convolutions, uses bilinear interpolation upsampling, and combines data augmentation and adversarial loss function to optimize the model training process and gradually improve the image deblurring capability.
It improves the clarity of graphite ore images, enhances the accuracy and efficiency of ore grade identification, reduces the risk of overfitting and computational complexity of the model, and is suitable for resource-constrained environments.
Smart Images

Figure CN120612253B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image recognition technology, specifically relating to a method for blur removal of graphite ore images based on deep learning. Background Technology
[0002] In the mining and processing of graphite ore, to improve the efficiency of ore blending and beneficiation, it is necessary to effectively distinguish the grade of newly mined graphite ore in a timely manner. There are two main traditional methods for detecting and identifying the carbon grade of graphite ore. The first is the traditional manual analysis method, where workers judge the approximate grade of the ore by visual observation and experience. This method is easily affected by subjective factors, leading to low accuracy. Furthermore, long-term exposure to this type of work may have adverse effects on workers' health. The second method uses high-frequency combustion-infrared absorption spectroscopy to determine the fixed carbon content in ore samples. While this method has higher accuracy, it requires investment in manpower, time, and equipment wear and tear. In recent years, with the rapid development of computer vision technology, large amounts of ore image data can be processed quickly using computer vision, enabling automated analysis and identification of ore grade.
[0003] In the process of using computer vision to analyze the grade of graphite ore, high-resolution imaging equipment is first used to photograph and sample the ore moving on the conveyor belt. However, under the complex lighting conditions and dusty environment of the production workshop, the acquired images are often of poor quality and blurry. Furthermore, due to the high cost of high-resolution cameras, companies cannot deploy them on a large scale. The shooting environment is often in a closed production workshop with dim lighting and high dust levels. The relative motion between the imaging equipment and the ore causes motion blur, which hinders subsequent segmentation and recognition. Therefore, finding an algorithm that can effectively handle motion-blurred images of ore is of great significance for subsequent research on accurate graphite ore grade identification and achieving efficient graphite ore grade classification. Summary of the Invention
[0004] According to a first aspect of the present invention, the present invention claims protection for a method for blur removal of graphite ore images based on deep learning, comprising:
[0005] S1, Construct and generate the first adversarial network model, and pre-train the first adversarial network model on the sample dataset;
[0006] S2, obtain the current model parameters of the pre-trained first adversarial network model, and save the current model parameters to a binary file;
[0007] S3, construct the first graphite ore image dataset, and divide the first graphite ore image dataset into a training set and a validation set;
[0008] S4, the training set is input into the first adversarial network model with the current model parameters for training and fine-tuning, to obtain the improved second adversarial network model;
[0009] S5, the second adversarial network model is trained using the second graphite ore image dataset, and the model parameters are initialized to obtain the third adversarial network model;
[0010] S6. Evaluate the third adversarial network model based on the performance metrics of the validation set, and obtain the trained graphite ore blur image removal model based on the evaluation results.
[0011] Furthermore, S1 also includes:
[0012] A blurred graphite ore image is used as the input image for the input layer, and multiple 3×3 convolutional layers are used to extract the initial features of the input image;
[0013] The discriminator integrates an ECA module to perform channel attention weighting on the initial features of the input image and uses dense residual blocks for feature learning and enhancement;
[0014] In the feature extraction and fusion stage, the Transformer module is introduced to enhance feature extraction and fusion capabilities and handle long-distance dependencies;
[0015] The Transformer module captures global features through a self-attention mechanism, and then applies the ECA module again to enhance the representation capability of the features;
[0016] The generator outputs a clear, deblurred image, which is then pre-trained on a sample dataset. The pre-trained model parameters are saved to a binary file.
[0017] Furthermore, S1 also includes:
[0018] In the generator, after each feature extraction and enhancement using a convolutional layer, ECA module, residual block, or Transformer module, bilinear interpolation is used to upsample the feature map, gradually increasing the resolution.
[0019] After multiple upsampling operations, the feature map has the same resolution as the input image, and the generator outputs a clear, deblurred image.
[0020] Adding activation and pooling layers enhances the model's expressiveness and reduces computation in the generator and discriminator.
[0021] Furthermore, when the discriminator integrates the ECA module to perform channel attention weighting on the initial features of the input image and uses dense residual blocks for feature learning and enhancement, it assigns a weight to each output channel of each convolutional layer. This weight is obtained through adaptive learning and represents the degree of influence of each channel on the final output. The discriminator also includes:
[0022] The ECA module performs global average pooling on the initial features of the input image to obtain the average value of each channel;
[0023] The attention weight of each channel is obtained based on the average value of each channel. One-dimensional convolution is used to model the pooled features and then normalize them.
[0024] The channel attention weights are applied to the original input graphite ore image to complete the weighting operation.
[0025] Furthermore, prior to S4, the procedure also includes:
[0026] Define the loss function, initial learning rate, number of training batches, maximum number of training iterations, learning rate adjustment strategy, and gradient descent-based parameter optimization strategy;
[0027] The Adam optimizer was chosen as the parameter optimization strategy based on gradient descent.
[0028] In the Adam optimizer, the parameters β1 = 0.9 and β2 = 0.99 are set, where β1 is the weight decay strategy of the first moment estimation, which adopts the weight decay rate and limits the size of the model weights by adding a penalty term proportional to the square of the weights to the loss function.
[0029] Furthermore, S4 also includes:
[0030] The graphite ore image dataset was divided into a training set and a validation set;
[0031] The first adversarial network model is trained using the training set as input, and data augmentation strategies are employed to improve the model's generalization ability.
[0032] The model is fine-tuned through adversarial training, including adversarial learning between the generator and the discriminator;
[0033] After fine-tuning, the improved second adversarial network model is obtained.
[0034] Furthermore, S4 also includes:
[0035] Data augmentation strategies include flipping, cropping, rotating, adjusting brightness and contrast, scaling, and erasing images;
[0036] Based on the discriminator's output probability for real images or output probability for generated images being close to 0.5, the training of the generator and discriminator is balanced, and the generator parameters are updated complementaryly.
[0037] The relative fuzzy loss function in the discriminator is expressed as:
[0038]
[0039] in, The relative blur loss function in the discriminator is used to enable the discriminator to learn to distinguish between real and generated images by minimizing the relative blur loss function.
[0040] x represents the real image, derived from the real data distribution p. data Sampling in (x), Let represent the expected average value for all real images x, D(x) represent the discriminator's output for real images, and represent the probability that the discriminator considers a real image to be real, (D(x)-0.5) 2 This represents the squared error, which measures the difference between the discriminator's output probability for the true image and the target value of 0.5.
[0041] z represents the noise input, from the noise distribution p z In the sampled image G(z), G(z) represents the image generated by the generator based on the noise z, and D(G(z)) represents the output of the discriminator on the generated image G(z), which is a probability value representing the probability that the discriminator considers the image G(z) to be real. Let G(z) represent the expected average value of all generated images; (D(G(z))-0.5) 2 The squared error represents the difference between the discriminator's output probability for the generated image and the target value of 0.5.
[0042] Furthermore, S5 also includes:
[0043] Training was performed using a graphite ore image dataset that was different from the graphite ore image dataset in the dataset mentioned above;
[0044] Initialize some model parameters and restart the training process;
[0045] The performance of the generator and discriminator is further optimized through adversarial training to obtain the third adversarial network model.
[0046] Furthermore, S6 also includes:
[0047] During model training, the validation set is used for real-time performance evaluation;
[0048] After each training cycle of the adversarial network model, the performance of the adversarial network model is immediately tested using a validation set;
[0049] The training status of the adversarial network model can be judged by observing whether the accuracy of the model on the validation set continues to improve and whether the loss function continues to decrease.
[0050] If the accuracy continues to rise or the loss function continues to fall, then continue training; otherwise, if these metrics do not follow the expected trend, then stop training.
[0051] The innovation of this invention compared to existing invention methods lies in:
[0052] (1) Using deep learning methods, the blurry image of graphite ore was eliminated, thereby improving the rapid and accurate identification of graphite ore grade; combined with the transfer learning theory to train the model, the pre-parameters trained were efficiently transferred and reused, which can reduce the risk of overfitting and training complexity of the model, and improve the processing performance of the model.
[0053] (2) The original 7×7 convolution is replaced with multiple 3×3 convolutions in the model to reduce the number of parameters and increase the nonlinearity of the network. This improvement can enhance the network's flexibility and learning ability while reducing computational cost. At the same time, bilinear interpolation is used instead of transposed convolution for upsampling to avoid the checkerboard effect. Bilinear interpolation is a smoother upsampling method that can reduce artifacts in the generated image.
[0054] (3) A Transformer module based on multi-scale feature fusion is introduced to enhance feature extraction and fusion capabilities. The Transformer module can better handle long-distance dependencies and improve feature representation capabilities. At the same time, dense residual blocks (RRDB) are used instead of traditional residual units. RRDB fully utilizes the feature information of each layer through dense connections, enhancing the network's ability to learn image details.
[0055] (4) The traditional channel attention mechanism is replaced with the ECA channel attention mechanism. The ECA module is integrated into the residual block of the generator, and the ECA module is applied at the end of each residual block to enhance channel attention. The ECA module can utilize channel information more efficiently and improve the expressive power of features.
[0056] (5) By employing a series of data augmentation techniques such as random cropping, flipping, rotating, distorting, adjusting brightness and contrast, scaling and erasing of images, combined with adversarial loss function and weight decay model training methods, the fitting process of the model can be accurately guided, and the generalization performance of the model can be significantly enhanced. Attached Figure Description
[0057] Figure 1 A schematic diagram illustrating the effect of eliminating motion blur in graphite ore using existing technology;
[0058] Figure 2 A flowchart illustrating a method for eliminating motion blur in graphite ore based on deep learning, as claimed in an embodiment of the present invention.
[0059] Figure 3 The diagram shows the DeblurGAN-ore model structure of a deep learning-based method for eliminating motion blur in graphite ore, as claimed in an embodiment of the present invention.
[0060] Figure 4 A schematic diagram of the ECA attention mechanism of a deep learning-based method for eliminating motion blur in graphite ore, as claimed in an embodiment of the present invention.
[0061] Figure 5 The diagram shows the working principle of a GAN network for a method of eliminating motion blur in graphite ore based on deep learning, as claimed in an embodiment of the present invention. Detailed Implementation
[0062] The technical solutions of the embodiments of this application 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 application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0063] The terms "first," "second," and "third" in this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. All directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of this application are only used to explain the relative positional relationships and movements between components in a specific orientation (as shown in the figures). If the specific orientation changes, the directional indications also change accordingly. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0064] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0065] Traditional methods for detecting and identifying the carbon grade of graphite ore require significant investment in manpower, time, and equipment wear and tear. Furthermore, the detection process is complex, has poor repeatability, and is time-consuming, typically taking several hours or more, making it difficult to meet the real-time sorting requirements of ore handling lines.
[0066] Another category primarily utilizes image analysis methods. While there are fewer achievements in this area, the rapid development of computer vision technology in recent years has enabled the rapid processing of large amounts of ore image data, achieving automated analysis and identification of ore grades. In the process of using computer vision to analyze graphite ore grades, a large number of surface morphology images of graphite ore are first collected, and each image is labeled with the corresponding ore grade, forming a sizable labeled image dataset. Then, artificial intelligence algorithms are trained on this dataset, and the trained model can automatically identify the specific grade of other unknown graphite ores. More specifically, when collecting graphite ore image datasets, the graphite ore is photographed completely from any random angle. The ore is then sent to a laboratory for chemical analysis to determine its carbon content, obtaining accurate grade classification and achieving a one-to-one correspondence between images and labels. However, when using high-resolution imaging equipment to photograph and sample ore moving on conveyor belts, the complex lighting conditions and harsh dust environment of the production workshop often result in poor image quality and blurry images. Furthermore, due to the high cost of high-resolution cameras, the shooting environment is in a closed production workshop with dim lighting and a lot of dust. The relative movement between the shooting equipment and the ore causes motion blur, which hinders the subsequent segmentation and recognition work.
[0067] Furthermore, high-resolution imaging equipment is relatively expensive, making it difficult for companies to equip themselves with such equipment on a large scale due to cost control considerations. In the enclosed production workshop, there is relative motion between the imaging equipment and the ore, resulting in motion blur in the images. Motion blur not only reduces image sharpness but also introduces additional difficulties for subsequent image segmentation and recognition, severely impacting the accuracy and efficiency of ore identification, and thus restricting the level of intelligence and automation of the entire production process. While existing deep learning-based deblurring methods have made significant progress in image restoration, they also have some limitations and drawbacks. For example, they are dependent on datasets; publicly available datasets do not match real-world scenarios, especially graphite ore datasets, which are particularly scarce. Most deep learning-based deblurring methods require training with pairs of blurred and sharp images, but these synthetic datasets often differ from real-world blurred images, leading to poor model performance in practical applications. Figure 1 This image illustrates the clear, blurred, and deblurred images of some graphite ores obtained using existing technologies. How to optimize blurred images of graphite ore samples using technical means to improve image acquisition quality and indirectly enhance the accuracy of artificial intelligence algorithms in identifying the grade of any graphite ore is a pressing technical problem that needs to be solved.
[0068] To address the aforementioned deficiencies or improvement needs of existing technologies, this invention provides a deep learning-based method for removing motion blur from graphite ore images. Before employing artificial intelligence algorithms to learn on image datasets, motion blur removal is performed on collected graphite ore images to improve data quality and enhance the accuracy of subsequent quality identification. This specially designed model consists of a Transformer based on multi-scale feature fusion, a ConvNeXt Block, a global mean pooling layer, a normalized linear layer, a residual network, and a SoftMax layer. Its working principle involves introducing a deblurring model based on a Generative Adversarial Network (GAN), and initializing the model parameters with pre-trained weights from DeblurGAN-ore through transfer learning. To further enhance the deblurring and highlight ore image details, the generator incorporates an ECA attention mechanism to improve the model's focus on key features and suppress irrelevant features, thereby improving network performance. The ECA module is integrated into either the generator or the discriminator. ECA is added after each convolutional block to enhance feature representation. During GAN training, the ECA module is automatically included in the forward propagation process of the generator and discriminator without requiring additional operations.
[0069] According to a first embodiment of the present invention, the present invention claims protection for a method for blur removal of graphite ore images based on deep learning, referring to... Figure 2 ,include:
[0070] S1, Construct and generate the first adversarial network model, and pre-train the first adversarial network model on the sample dataset;
[0071] S2, obtain the current model parameters of the pre-trained first adversarial network model, and save the current model parameters to a binary file;
[0072] S3, construct the first graphite ore image dataset, and divide the first graphite ore image dataset into a training set and a validation set;
[0073] S4, the training set is input into the first adversarial network model with the current model parameters for training and fine-tuning, to obtain the improved second adversarial network model;
[0074] S5, the second adversarial network model is trained using the second graphite ore image dataset, and the model parameters are initialized to obtain the third adversarial network model;
[0075] S6. Evaluate the third adversarial network model based on the performance metrics of the validation set, and obtain the trained graphite ore blur image removal model based on the evaluation results.
[0076] The pre-trained parameters of S1 form the basis for fine-tuning in S4, and the fine-tuned parameters of S4 form the basis for further training in S5. This stepwise optimization approach allows the model to gradually transition from general capabilities to task-specific optimization.
[0077] S1 is pre-trained using a publicly available dataset, while S4 and S5 use a graphite ore image dataset, but S5 may use a different batch of data or a further expanded dataset.
[0078] S1 is the initial training, S4 is the fine-tuning for a specific task, and S5 is the further optimization based on the fine-tuning. Each training session is closer to the final application scenario.
[0079] By using this phased training method, the model can gradually improve its ability to deblur graphite ore images, while avoiding the overfitting problem that may result from training directly on a specific dataset.
[0080] In this embodiment, a generative adversarial network is initially built for the task of deblurring graphite ore images.
[0081] Generative Adversarial Networks (GANs) are a highly effective choice for image deblurring, primarily due to their unique generative capabilities and adversarial training mechanism. They can generate high-quality, clear images that visually approximate reality. To improve deblurring performance, the improved DeblurGAN-ore network replaces the 7×7 convolutions in the generator with multiple 3×3 convolutions, reducing the number of parameters and increasing the network's nonlinearity. Simultaneously, bilinear interpolation is used instead of transposed convolutions for upsampling, avoiding the checkerboard effect. Therefore, the high-performing GAN network is chosen as the basic framework, mainly consisting of a generator and a discriminator. The generator extracts multi-scale features through a Feature Pyramid Network (FPN), and incorporates a Transformer model based on multi-scale feature fusion into the basic GAN network. Introducing a Transformer module into the generator enhances feature extraction and fusion capabilities. Furthermore, Residual-in-Residual Dense Blocks (RRDBs) are used instead of traditional residual units. RRDBs, through dense connections, fully utilize the feature information of each layer, enhancing the network's ability to learn image details. Feature learning and enhancement are performed using residual blocks, with an ECA module at the end of each residual block further enhancing channel attention. Finally, upsampling and convolutional layers restore the image to its original size, generating a sharp image.
[0082] Furthermore, S1 also includes:
[0083] A blurred graphite ore image is used as the input image for the input layer, and multiple 3×3 convolutional layers are used to extract the initial features of the input image;
[0084] The discriminator integrates an ECA module to perform channel attention weighting on the initial features of the input image and uses dense residual blocks for feature learning and enhancement;
[0085] In the feature extraction and fusion stage, the Transformer module is introduced to enhance feature extraction and fusion capabilities and handle long-distance dependencies;
[0086] The Transformer module captures global features through a self-attention mechanism, and then applies the ECA module again to enhance the representation capability of the features;
[0087] The generator outputs a clear, deblurred image, which is then pre-trained on a sample dataset. The pre-trained model parameters are saved to a binary file.
[0088] Furthermore, S1 also includes:
[0089] In the generator, after each feature extraction and enhancement using a convolutional layer, ECA module, residual block, or Transformer module, bilinear interpolation is used to upsample the feature map, gradually increasing the resolution.
[0090] After multiple upsampling operations, the feature map has the same resolution as the input image, and the generator outputs a clear, deblurred image.
[0091] Adding activation and pooling layers enhances the model's expressiveness and reduces computation in the generator and discriminator.
[0092] In this embodiment, the 7×7 convolution in the generator is replaced with multiple 3×3 convolutions to reduce the number of parameters, increase the nonlinearity of the network, improve the network's flexibility and learning ability, and reduce the amount of computation.
[0093] Bilinear interpolation is used instead of transposed convolution for upsampling to avoid the checkerboard effect, which causes artifacts in the generated image and affects image quality. Bilinear interpolation is a smoother upsampling method that can reduce artifacts in the generated image.
[0094] Residual-in-Residual Dense Blocks (RRDBs) are used instead of traditional residual units. RRDBs, through dense connections, fully utilize the feature information of each layer, enhancing the network's ability to learn image details and thus generating higher-quality images.
[0095] The improved DeblurGAN-ore model was trained on a public image dataset, primarily using pre-trained weights from the GoPro dataset. Transfer learning was used to introduce these pre-trained weights to initialize the model parameters. Since large datasets of minerals are relatively rare, the dataset used for this model training consisted of self-collected graphite ore images, with 3152 pairs (6304 images) of training images. Each pair contained one clear image and a corresponding blurred image. The larger the dataset, the better the pre-training performance of the model. Of course, after successful pre-training on a large dataset, this model already possesses good image deblurring capabilities; refer to... Figure 3 Here is a diagram of the DeblurGAN-ore model structure;
[0096] The parameter values of the pre-trained DeblurGAN-ore model are saved in a file for subsequent experiments on the graphite mineral image dataset.
[0097] We will continue to collect a batch of graphite ore images. Using high-resolution imaging equipment, we will acquire real-time images of graphite ore on a conveyor belt traveling at 1.4 m / s. We will then use artificial synthesis to simulate motion blur in real ore, generating blurred images corresponding to the sharp images to form image pairs for training. Images from multiple grades, angles, and lighting conditions will be included to expand the dataset, ensuring it is large enough and has broad coverage.
[0098] In the graphite mine image dataset, a training set and a validation set are divided. The training set is used to train the model's image deblurring ability and improve the model's generalization ability. The validation set is used to verify the model's performance and determine whether it is necessary to continue to improve the model or terminate training.
[0099] To enhance the real-time image deblurring performance of the model for real-time image processing on ore conveyor belts, the traditional channel attention mechanism is replaced with the ECA channel attention mechanism. Traditional channel attention mechanisms typically rely on fully connected layers or complex computations to learn channel weights, which are often computationally expensive and have high model complexity. To address the trade-off between performance and complexity, ECA proposes a one-dimensional convolution to replace the traditional fully connected layer, improving computational and parameter efficiency. Figure 5 ECA (Efficient Channel Attention) is an efficient channel attention mechanism used to enhance the feature representation capabilities of neural networks along the channel dimension. ECA adaptively weights the feature maps of each channel, allowing the network to focus more on features of important channels, thereby improving network performance. The key to ECA lies in introducing a lightweight attention mechanism to model the relationships between channels, thus enhancing the expressive power of features.
[0100] Furthermore, when the discriminator integrates the ECA module to perform channel attention weighting on the initial features of the input image and uses dense residual blocks for feature learning and enhancement, it assigns a weight to each output channel of each convolutional layer. This weight is obtained through adaptive learning and represents the degree of influence of each channel on the final output. The discriminator also includes:
[0101] The ECA module performs global average pooling on the initial features of the input image to obtain the average value of each channel;
[0102] The attention weight of each channel is obtained based on the average value of each channel. One-dimensional convolution is used to model the pooled features and then normalize them.
[0103] The channel attention weights are applied to the original input graphite ore image to complete the weighting operation.
[0104] In this embodiment, Global Average Pooling (GAP) averages the pixel values of all channels to obtain a scalar value for each channel, which serves as the feature representation for that channel. Assuming the input feature map size is H×WH×W (height and width), for each channel, GAP reduces its dimensionality to a scalar:
[0105]
[0106] Where, x ijc y represents the pixel value at position (i,j) of the input feature map, while y c It is the average value of the c-th channel;
[0107] The input to a one-dimensional convolution is the average value of each channel obtained through global average pooling (i.e., y). c The output is the attention weight for each channel. The kernel size is typically a hyperparameter, and its size does not change with the size of the input image. One-dimensional convolution is used to model the pooled features:
[0108]
[0109] The output obtained through convolution needs further normalization, typically using the sigmoid activation function to map the output values to the range [0,1]. This ensures that the resulting weights can be used as weighting coefficients between channels, allowing the model to adjust the contribution of each channel based on these weights.
[0110]
[0111] Where σ(·) represents the Sigmoid activation function, α c It is the attention weight of the c-th channel.
[0112] For each channel, the feature map of that channel is adjusted using corresponding weights. Adding the ECA module to each convolutional block in this network effectively enhances the network's feature representation capabilities. By adaptively weighting the feature maps of different channels, it helps the model focus more on key features, improving its ability to learn and capture important information. Simultaneously, the efficient design of ECA reduces computational overhead through one-dimensional convolution operations, improving computational efficiency, making it particularly suitable for resource-constrained environments. Furthermore, ECA enhances the network's robustness and generalization ability, helping the model maintain higher stability and accuracy when facing noise or data variations, thereby improving the overall network performance. In the generator of a GAN network, the ECA module can be used to enhance the feature representation of intermediate layers, resulting in generated images with richer textures and details. By focusing on more important channels, the generator can more effectively utilize its capacity to generate higher-quality images. Here, we mainly consider fusing the ECA module into the generator's residual blocks. At the end of each residual block, the ECA module is applied to strengthen channel attention, and finally, the result is added to the block's input. In this way, the feature map obtained after convolution will be adjusted according to the importance of each channel, allowing the model to focus more on features that are useful for the task and suppress irrelevant information.
[0113] Furthermore, prior to S4, the procedure also includes:
[0114] Define the loss function, initial learning rate, number of training batches, maximum number of training iterations, learning rate adjustment strategy, and gradient descent-based parameter optimization strategy;
[0115] The Adam optimizer was chosen as the parameter optimization strategy based on gradient descent.
[0116] In the Adam optimizer, the parameters β1 = 0.9 and β2 = 0.99 are set, where β1 is the weight decay strategy of the first moment estimation, which adopts the weight decay rate and limits the size of the model weights by adding a penalty term proportional to the square of the weights to the loss function.
[0117] In this embodiment, a GAN model is trained on a graphite ore image dataset. Before starting model training, the loss function and the initial learning rate are set to 1×10⁻⁶. -3This learning rate enables rapid model parameter updates in the early stages of training, accelerating model convergence. As training progresses, the learning rate may be dynamically adjusted according to the learning rate adjustment strategy to ensure that the model can optimize parameters more finely in later stages, avoiding premature local optima. The selection criteria include the number of training batches, maximum number of training iterations, learning rate adjustment strategy, and gradient descent-based parameter optimization strategy. Here, the Adam optimizer is chosen as the gradient descent-based parameter optimization strategy. The Adam optimizer combines the advantages of momentum and adaptive learning rate adjustment, effectively accelerating the training process and improving model convergence performance. In the Adam optimizer, parameters β1 = 0.9 and β2 = 0.99 are set. Here, β1 is the decay rate of the first moment estimate, used to calculate the moving average of the gradient; β2 is the decay rate of the second moment estimate, used to calculate the moving average of the squared gradient. These parameter settings allow the Adam optimizer to adaptively adjust the learning rate during training while maintaining the stability of gradient updates. The weight decay strategy uses a weight decay rate w = 0.9. Weight decay is a regularization technique that limits the size of model weights by adding a penalty term proportional to the square of the weights to the loss function. This helps prevent overfitting and improves the model's generalization ability.
[0118] Furthermore, S4 also includes:
[0119] S4 further includes:
[0120] The graphite ore image dataset was divided into a training set and a validation set;
[0121] The first adversarial network model is trained using the training set as input, and data augmentation strategies are employed to improve the model's generalization ability.
[0122] The model is fine-tuned through adversarial training, including adversarial learning between the generator and the discriminator;
[0123] After fine-tuning, the improved second adversarial network model is obtained.
[0124] Data augmentation strategies include flipping, cropping, rotating, adjusting brightness and contrast, scaling, and erasing images;
[0125] Based on the discriminator's output probability for real images or output probability for generated images being close to 0.5, the training of the generator and discriminator is balanced, and the generator parameters are updated complementaryly.
[0126] The relative fuzzy loss function in the discriminator is expressed as:
[0127]
[0128] in, The relative blur loss function in the discriminator is used to enable the discriminator to learn to distinguish between real and generated images by minimizing the relative blur loss function.
[0129] x represents the real image, derived from the real data distribution p. data Sampling in (x), Let represent the expected average value for all real images x, D(x) represent the discriminator's output for real images, and represent the probability that the discriminator considers a real image to be real, (D(x)-0.5) 2 This represents the squared error, which measures the difference between the discriminator's output probability for the true image and the target value of 0.5.
[0130] z represents the noise input, from the noise distribution p z In the sampled image G(z), G(z) represents the image generated by the generator based on the noise z, and D(G(z)) represents the output of the discriminator on the generated image G(z), which is a probability value representing the probability that the discriminator considers the image G(z) to be real. Let G(z) represent the expected average value of all generated images; (D(G(z))-0.5) 2 The squared error represents the difference between the discriminator's output probability for the generated image and the target value of 0.5; (refer to...) Figure 4 This is a diagram illustrating the working principle of a GAN network.
[0131] The S5 also includes:
[0132] Training was performed using a graphite ore image dataset that was different from the graphite ore image dataset in the dataset mentioned above;
[0133] Initialize some model parameters and restart the training process;
[0134] The performance of the generator and discriminator is further optimized through adversarial training to obtain the third adversarial network model.
[0135] Furthermore, S6 also includes:
[0136] During model training, the validation set is used for real-time performance evaluation;
[0137] After each training cycle of the adversarial network model, the performance of the adversarial network model is immediately tested using a validation set;
[0138] The training status of the adversarial network model can be judged by observing whether the accuracy of the model on the validation set continues to improve and whether the loss function continues to decrease.
[0139] If the accuracy continues to rise or the loss function continues to fall, then continue training; otherwise, if these metrics do not follow the expected trend, then stop training.
[0140] In this embodiment, after the GAN artificial intelligence model is trained, inputting a graphite ore image with poor image quality into the model will result in a clear image with improved image quality. This enables real-time deblurring of ore images, effectively solving the problem of blurred graphite ore images, improving image quality and the accuracy of graphite ore grade identification, and providing technical support for subsequent real-time identification of graphite ore grades.
[0141] The following is a specific example:
[0142] Taking the blurring caused by graphite ore on a conveyor belt moving at a speed of 1.4 m / s as an example, the main steps of this invention are as follows:
[0143] The basic GAN model is built using Python 3.10 programming language and PyTorch 2.0.1 deep learning framework. The backbone network consists of Inception-ResNet-v2 and Mobi leNe. The former provides the highest accuracy, while the latter significantly reduces model parameters and computational cost while maintaining high deblurring quality.
[0144] The improved DeblurGAN-ore model was pre-trained on the GOPRO dataset, achieving a peak signal-to-noise ratio (PSNR) of around 28 and a structural similarity index (SSIM) of around 0.8 on the validation set. During training, the image pixels were standardized, and the mean and standard deviation were calculated based on the pixel values of all image samples in the training set.
[0145] Save the parameters of the generator and discriminator of the pre-trained DeblurGAN-ore model to a binary file.
[0146] Collect graphite ore images under different lighting conditions, with varying grades, and at different movement speeds to ensure a sufficiently large dataset, forming a graphite ore image dataset of a certain scale. Collect graphite ore images, including blurred images and their corresponding sharp images (if available), to form a graphite ore image dataset of a certain scale. For each blurred graphite ore image, perform appropriate preprocessing methods, such as cropping the background pixel area of the image as much as possible, to improve the efficiency and accuracy of model recognition. Finally, scale the shortest side of the image to 256 pixels.
[0147] The collected graphite ore image dataset was divided into training and testing sets in a 7:3 ratio.
[0148] The saved parameters are loaded into the generator and discriminator of the DeblurGAN-ore model. Then, all samples of the graphite ore blurred image dataset are sequentially processed in the DeblurGAN-ore model, and the model is fine-tuned as needed.
[0149] The DeblurGAN-ore model was trained on a dataset of collected graphite mineral images. The loss function chosen was an adversarial loss function combined with a relative blur loss function. The initial learning rate was set to 1×10⁻⁶. -3 The number of training batches was set to 32, and the maximum number of training iterations was set to 200 training set cycles. An adaptive learning rate decay loss strategy was used for learning rate adjustment. This strategy dynamically adjusts the learning rate based on performance metrics (such as the loss function value) during training to improve training efficiency and model performance. The Adam optimizer was selected for parameter optimization, with β1 = 0.9, β2 = 0.99, and a weight decay rate w = 0.9. For data augmentation, operations such as flipping, cropping, rotating, and adjusting brightness and contrast were performed on the collected data images to simulate sample data collected under different environments, thereby enhancing the diversity of data types.
[0150] After each training cycle, the model uses a validation set to evaluate the trends in its accuracy and loss function. Training continues as long as accuracy continues to improve or the loss function continues to decrease; otherwise, training stops if these metrics no longer improve.
[0151] After training, a model for removing blur from graphite ore images can be obtained. Its performance evaluation metrics, such as peak signal-to-noise ratio (PSNR) of around 35 and structural similarity index (SSIM) of around 0.95, are achieved.
[0152] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0153] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units. The above are merely embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made based on the description and drawings of this application, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
[0154] The specific embodiments of the invention have been described in detail above, but they are only examples, and this application is not limited to the specific embodiments described above. For those skilled in the art, any equivalent modifications or substitutions to the invention are also within the scope of this application. Therefore, all equivalent changes, modifications, and improvements made without departing from the spirit and principles of this application should be covered within the scope of this application.
[0155] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0156] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units. The above are merely embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made based on the description and drawings of this application, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
[0157] The specific embodiments of the invention have been described in detail above, but they are only examples, and this application is not limited to the specific embodiments described above. For those skilled in the art, any equivalent modifications or substitutions to the invention are also within the scope of this application. Therefore, all equivalent changes, modifications, and improvements made without departing from the spirit and principles of this application should be covered within the scope of this application.
Claims
1. A method for blur removal of graphite ore images based on deep learning, characterized in that, include: S1, Construct and generate the first adversarial network model, and pre-train the first adversarial network model on the sample dataset; S2, obtain the current model parameters of the pre-trained first adversarial network model, and save the current model parameters to a binary file; S3, construct the first graphite ore image dataset, and divide the first graphite ore image dataset into a training set and a validation set; S4, the training set is input into the first adversarial network model with the current model parameters for training and fine-tuning, to obtain the improved second adversarial network model; S5, the second adversarial network model is trained using the second graphite ore image dataset, and the model parameters are initialized to obtain the third adversarial network model; S6. Evaluate the third adversarial network model based on the performance metrics of the validation set, and obtain the trained graphite ore blurred image removal model based on the evaluation results. S1 further includes: A blurred graphite ore image is used as the input image for the input layer, and multiple 3×3 convolutional layers are used to extract the initial features of the input image; The discriminator integrates an ECA module to perform channel attention weighting on the initial features of the input image and uses dense residual blocks for feature learning and enhancement; In the feature extraction and fusion stage, the Transformer module is introduced to enhance feature extraction and fusion capabilities and handle long-distance dependencies; The Transformer module captures global features through a self-attention mechanism, and then applies the ECA module again to enhance the representation capability of the features; The generator outputs a clear, deblurred image, which is then pre-trained on a sample dataset. The pre-trained model parameters are saved to a binary file.
2. The method for blur removal of graphite ore images based on deep learning according to claim 1, characterized in that, S1 further includes: In the generator, after each feature extraction and enhancement using a convolutional layer, ECA module, residual block, or Transformer module, bilinear interpolation is used to upsample the feature map, gradually increasing the resolution. After multiple upsampling operations, the feature map has the same resolution as the input image, and the generator outputs a clear, deblurred image. Adding activation and pooling layers enhances the model's expressiveness and reduces computation in the generator and discriminator.
3. The method for blur removal of graphite ore images based on deep learning according to claim 2, characterized in that, When the discriminator integrates the ECA module to perform channel attention weighting on the initial features of the input image and uses dense residual blocks for feature learning and enhancement, it assigns a weight to each output channel of each convolutional layer. This weight is obtained through adaptive learning and represents the degree of influence of each channel on the final output. It also includes: The ECA module performs global average pooling on the initial features of the input image to obtain the average value of each channel; The attention weight of each channel is obtained based on the average value of each channel. One-dimensional convolution is used to model the pooled features and then normalize them. The channel attention weights are applied to the original input graphite ore image to complete the weighting operation.
4. The method for blur removal of graphite ore images based on deep learning according to claim 2, characterized in that, Before S4 is performed, the following is also included: Define the loss function, initial learning rate, number of training batches, maximum number of training iterations, learning rate adjustment strategy, and gradient descent-based parameter optimization strategy; The Adam optimizer was chosen as the parameter optimization strategy based on gradient descent. In the Adam optimizer, set parameters ,in, It is a decay weight decay strategy based on first-order moment estimation. It is the decay rate estimated by the second moment, using the weight decay rate, which limits the size of the model weights by adding a penalty term proportional to the square of the weights to the loss function.
5. The method for blur removal of graphite ore images based on deep learning according to claim 2, characterized in that, S4 further includes: The first adversarial network model is trained using the training set as input, and data augmentation strategies are employed to improve the model's generalization ability. The model is fine-tuned through adversarial training, including adversarial learning between the generator and the discriminator; After fine-tuning, the improved second adversarial network model is obtained.
6. The method for blur removal of graphite ore images based on deep learning according to claim 2, characterized in that, S4 further includes: Data augmentation strategies include flipping, cropping, rotating, adjusting brightness and contrast, scaling, and erasing images; Based on the discriminator's output probability for real images or output probability for generated images being close to 0.5, the training of the generator and discriminator is balanced, and the generator parameters are updated complementaryly. The relative fuzzy loss function in the discriminator is expressed as: in, The relative blur loss function in the discriminator is used to enable the discriminator to learn to distinguish between real and generated images by minimizing the relative blur loss function. Representing real images, based on real data distribution Mid-sampling, This represents all real images. The expected average value This represents the discriminator's output on the real image, indicating the probability that the discriminator considers the real image to be real. This represents the squared error, which measures the difference between the discriminator's output probability for the true image and the target value of 0.
5. Indicates noise input, from noise distribution Mid-sampling, The generator is based on noise. The generated image, This indicates that the discriminator evaluates the generated image. The output is a probability value, representing what the discriminator considers the image to be... It is the actual probability. This indicates that for all generated images The expected average; The squared error represents the difference between the discriminator's output probability for the generated image and the target value of 0.
5.
7. The method for blur removal of graphite ore images based on deep learning according to claim 6, characterized in that, The S5 also includes: The second graphite ore image dataset was used for training; Initialize some model parameters and restart the training process; The performance of the generator and discriminator is further optimized through adversarial training to obtain the third adversarial network model.
8. The method for blur removal of graphite ore images based on deep learning according to claim 2, characterized in that, S6 further includes: During model training, the validation set is used for real-time performance evaluation; After each training cycle of the adversarial network model, the performance of the adversarial network model is immediately tested using a validation set; The training status of the adversarial network model can be judged by observing whether the accuracy of the model on the validation set continues to improve and whether the loss function continues to decrease. If the accuracy continues to rise or the loss function continues to fall, then continue training; otherwise, if these metrics do not follow the expected trend, then stop training.
Citation Information
Patent Citations
Depth image deblurring method based on multi-scale fusion coding network
CN113129237A
Method of analysing mineralogical composition of crystalline rocks
RU2834385C1