A method and system for detecting ore

By designing a neural network model in ore detection, combined with a multi-scale fusion network and a global attention mechanism, the problems of overlapping ore identification and poor real-time performance are solved, and high-accuracy and efficient ore detection is achieved.

CN118552957BActive Publication Date: 2024-10-15EAST CHINA JIAOTONG UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411018187.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-10-15
Estimated Expiration
2044-07-29

AI Technical Summary

Technical Problem

The existing technology cannot effectively identify overlapping ores and has poor real-time reasoning during ore detection, resulting in inaccurate injection valve strikes and difficulty in identifying overlapping ores.

Method used

An ore detection method is designed, using a neural network model, including a backbone network and a multi-scale fusion network, through a convolutional layer, a fusion moving inverted bottleneck convolutional layer, an efficient layer aggregation spatial pyramid pooling structure, a weighted bidirectional feature fusion structure and The global attention mechanism forms a bottom-up and top-down bidirectional feature fusion structure, optimizing the model structure to improve recognition accuracy and speed.

Benefits of technology

It effectively reduces the amount of parameters and calculations, improves the accuracy and speed of ore identification, can process more ore on most sorting machines with high real-time requirements, and improves the accuracy of identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118552957B_ABST
    Figure CN118552957B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for ore detection. The method improves the speed and accuracy of ore identification by designing a neural network model. The backbone network in the neural network model includes a convolution layer, 4 fused mobile inverted bottleneck convolution layers, 4 mobile inverted bottleneck convolution layers, and an efficient layer aggregation space pyramid pooling structure. The multi-scale fusion network consists of upsampling, a weighted bidirectional feature fusion structure, a C2f structure, a global attention mechanism, a convolution layer, and a detection head. Specifically, the model effectively reduces the amount of parameters and calculations; secondly, it combines the efficient layer aggregation space pyramid pooling structure to strengthen the feature extraction between different levels and improve the network recognition accuracy; finally, the path aggregation network module is optimized The model structure, the global attention mechanism and the weighted bidirectional feature pyramid network feature fusion mechanism are introduced to enhance the recognition ability of overlapping ore images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of ore detection, and in particular relates to an ore detection method and system. Background Art

[0002] Since the 21st century, cutting-edge technologies such as artificial intelligence (AI) algorithms have been widely used in the field of intelligent photoelectric beneficiation. Intelligent photoelectric beneficiation technologies, including XRF (surface radiation), XRT (transmission technology), laser induction, microwave technology, and single-sided image and double-sided image color sorting, have all been rapidly developed and applied in industry. Among them, XRT technology and image color sorting technology have been successfully applied to the pre-selection and discarding of non-ferrous metals, non-metals and coal due to their wide adaptability, and have become the mainstream solution for intelligent photoelectric beneficiation machines. The core of XRT technology and image color sorting technology lies in accurately detecting the position of ore in the image. Traditional ore detection solutions mainly use image processing technology to segment ore, including setting thresholds, clustering analysis and edge detection methods. However, the ore image on the belt has the following two typical characteristics: first, the adhesion of ore and the occlusion of dust and soil cause the edges of many ore in the image to be blurred or even disappear; second, the shapes and sizes of ore in the image are varied. These factors have brought severe challenges to the segmentation and detection of individual ore, and simple image processing technology can no longer meet the needs.

[0003] With the progress of computer vision research, target detection technology has become an important research direction. At present, many domestic and foreign mineral processing equipment manufacturers have introduced target detection technology into ore detection, which has effectively improved the accuracy of ore detection. However, under the massive ore data, the reasoning speed of target detection technology cannot meet the real-time performance of the current machine, resulting in the situation that the spray valve does not strike the ore accurately. In addition, if there is too much overlapping ore data in a single image, some overlapping ores cannot be distinguished well, and it is also possible that overlapping ores are identified as a single ore. Summary of the invention

[0004] Based on this, an embodiment of the present invention provides an ore detection method and system to solve the problem in the prior art that when the ore processing volume per unit time is too large, overlapping ores cannot be well identified and the real-time reasoning is poor.

[0005] A first aspect of an embodiment of the present invention provides a method for detecting an ore, the method comprising:

[0006] Acquire an original ore image, perform annotation processing on the original ore image to obtain an annotated image, and form a data set;

[0007] Dividing the data set into a training set, a test set, and a validation set according to a preset ratio;

[0008] Preprocess and normalize the labeled images in the training set, test set, and validation set to obtain the target labeled images;

[0009] Establishing a neural network model, and inputting the target annotated image into the neural network model for training, and measuring the performance of the neural network model by using accuracy, precision, recall and F1 score on the test set, and at the same time, using the model parameter amount, floating point calculation amount and average inference time of the neural network model on a single ore image as the measurement indicators of model complexity, so as to train and obtain the target neural network model;

[0010] Acquire an ore image to be identified, input the ore image to be identified into the target neural network model, and obtain an identification result;

[0011] The neural network model includes a backbone network and a multi-scale fusion network connected to the backbone network, wherein the backbone network includes a convolution layer, four fused mobile inverted bottleneck convolution layers, four mobile inverted bottleneck convolution layers, and an efficient layer aggregation spatial pyramid pooling structure, and the multi-scale fusion network is composed of upsampling, a weighted bidirectional feature fusion structure, a C2f structure, a global attention mechanism, a convolution layer, and a detection head, forming a bottom-up and top-down bidirectional feature fusion structure;

[0012] Among them, the third fused moving inverted bottleneck convolution layer and the first moving inverted bottleneck convolution layer in the backbone network are respectively connected to the corresponding weighted bidirectional feature fusion structure in the bottom-up feature fusion structure of the multi-scale fusion network, and the efficient layer aggregation spatial pyramid pooling structure is respectively connected to the upsampling in the bottom-up feature fusion structure of the multi-scale fusion network and the weighted bidirectional feature fusion structure in the top-down feature fusion structure;

[0013] The three detection heads are respectively connected with the specific global attention mechanism and C2f structure in the top-down feature fusion structure.

[0014] Furthermore, the bottom-up feature fusion structure of the multi-scale fusion network includes a first upsampling, a first weighted bidirectional feature fusion structure, a first C2f structure, a first global attention mechanism, a second upsampling, a second weighted bidirectional feature fusion structure and a second C2f structure connected in sequence;

[0015] Among them, the efficient layer aggregation spatial pyramid pooling structure is connected to the first upsampling, the first moving inverted bottleneck convolution layer is connected to the first weighted bidirectional feature fusion structure, and the third fused moving inverted bottleneck convolution layer is connected to the second weighted bidirectional feature fusion structure.

[0016] Furthermore, the top-down feature fusion structure of the multi-scale fusion network includes a second global attention mechanism connected to the second C2f structure, and a convolution layer, a third weighted bidirectional feature fusion structure, a third global attention mechanism, a third C2f structure, a fourth global attention mechanism, a fourth weighted bidirectional feature fusion structure and a fourth C2f structure sequentially connected to the second global attention mechanism;

[0017] Among them, the second global attention mechanism, the third C2f structure and the fourth C2f structure are respectively connected to the detection head.

[0018] Furthermore, the weighted bidirectional feature fusion structure is a three-layer structure of path aggregation, each layer includes original nodes, intermediate nodes and output nodes connected in sequence, wherein an additional channel is established between the original nodes and the output nodes in each layer, and a connection relationship is established between the intermediate nodes and the output nodes between layers, but the path directions are opposite.

[0019] Furthermore, the fused mobile inverted bottleneck convolution layer includes a 3x3 convolution layer, a SE module, and a 1x1 projection convolution layer connected in sequence, wherein the input of the fused mobile inverted bottleneck convolution layer is directly added to the output of the fused mobile inverted bottleneck convolution layer through a residual connection.

[0020] Furthermore, the moving inverted bottleneck convolution layer includes a 1x1 expanded convolution layer, a 3x3 depth-separable convolution layer, a SE module, a 1x1 projection convolution layer and a Dropout layer, which are connected in sequence, wherein the input of the moving inverted bottleneck convolution layer is directly added to the output of the moving inverted bottleneck convolution layer through a residual connection.

[0021] Furthermore, an efficient layer-aggregated spatial pyramid pooling structure includes a first CBS module, a maximum pooling layer, a splicing layer and a second CBS module, wherein the output of the first CBS module is connected to the splicing layer on the one hand, and passes through three maximum pooling layers on the other hand, and the output of each maximum pooling layer is connected to the splicing layer, and the output end of the splicing layer is connected to the second CBS module.

[0022] A second aspect of the embodiments of the present invention provides an ore detection system, which is used to implement the ore detection method described in the first aspect. The system includes:

[0023] A labeling module is used to obtain an original ore image, label the original ore image, obtain a labeled image, and form a data set;

[0024] A partitioning module, used to divide the data set into a training set, a test set and a validation set according to a preset ratio;

[0025] An image processing module is used to preprocess and normalize the labeled images in the training set, test set, and validation set to obtain target labeled images;

[0026] A neural network model training module is used to establish a neural network model, input the target annotated image into the neural network model for training, and measure the performance of the neural network model by using accuracy, precision, recall and F1 score on the test set. At the same time, the model parameter amount, floating point calculation amount and average inference time of the neural network model on a single ore image are used as measurement indicators of model complexity to train and obtain the target neural network model;

[0027] The input module is used to obtain the ore image to be identified, input the ore image to be identified into the target neural network model, and obtain the identification result.

[0028] A third aspect of an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the ore detection method provided in the first aspect is implemented.

[0029] A fourth aspect of an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the ore detection method provided in the first aspect when executing the program.

[0030] A method and system for detecting minerals provided in an embodiment of the present invention is designed to improve the speed and accuracy of mineral identification by designing a neural network model. The neural network model includes a backbone network and a multi-scale fusion network connected to the backbone network. The backbone network includes a convolution layer, 4 fused mobile inverted bottleneck convolution layers, 4 mobile inverted bottleneck convolution layers, and an efficient layer aggregation space pyramid pooling structure. The multi-scale fusion network is composed of upsampling, a weighted bidirectional feature fusion structure, a C2f structure, a global attention mechanism, a convolution layer, and a detection head, forming a bottom-up and top-down bidirectional feature fusion structure. Specifically, the model effectively reduces the amount of parameters and calculations; secondly, it combines the efficient layer aggregation space pyramid pooling structure to strengthen the feature extraction between different levels and improve the network recognition accuracy; finally, the path aggregation network module is optimized, and the model structure is introduced, and the global attention mechanism and the weighted bidirectional feature pyramid network feature fusion mechanism are introduced to enhance the recognition ability of overlapping mineral images. This allows the model to be deployed on most sorting machines with high real-time requirements and large ore processing volumes, so that a larger amount of ore can be processed per unit time and the recognition accuracy is higher. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A schematic diagram of the implementation process of an ore detection method provided in the first embodiment of the present invention;

[0032] Figure 2 This is a schematic diagram of the Mosaic data enhancement process;

[0033] Figure 3 A schematic diagram of the structure of the backbone network;

[0034] Figure 4 It is a schematic diagram of the structure of the multi-scale fusion network;

[0035] Figure 5 It is a schematic diagram of the weighted bidirectional feature fusion structure;

[0036] Figure 6 This is a schematic diagram of the structure of the fused mobile inverted bottleneck convolution layer;

[0037] Figure 7 This is a schematic diagram of the structure of the mobile inverted bottleneck convolution layer;

[0038] Figure 8 It is a schematic diagram of the structure of efficient layer aggregation spatial pyramid pooling structure;

[0039] Fig. 9 Schematic diagram of the structure of the global attention mechanism;

[0040] Fig.10 This is a schematic diagram of the structure of the channel attention mechanism;

[0041] Fig.11 Schematic diagram of the structure of the spatial attention mechanism;

[0042] Fig.12 It is a structural diagram of the neural network model;

[0043] Fig.13 A structural block diagram of an ore detection system provided in Embodiment 2 of the present invention;

[0044] Fig.14 This is a structural block diagram of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0045] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0046] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.

[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0048] Embodiment 1

[0049] See also Figure 1 , is a schematic diagram of an implementation flow of an ore detection method provided in Embodiment 1 of the present invention, wherein the ore detection method specifically includes steps S01 to S05.

[0050] Step S01, obtaining an original ore image, annotating the original ore image to obtain an annotated image, and forming a data set.

[0051] Among them, labeled images can be obtained by manual labeling and form a data set.

[0052] Step S02: divide the data set into a training set, a test set and a validation set according to a preset ratio.

[0053] In this embodiment, the data set is divided into a training set, a test set, and a validation set in a ratio of 7:2:1.

[0054] Step S03, preprocessing and normalizing the annotated images in the training set, the test set, and the validation set, respectively, to obtain target annotated images.

[0055] Specifically, the labeled images in the training set, test set, and validation set were subjected to preprocessing operations such as mosaic image enhancement, random erasing, and color disturbance, and all images were normalized to a size of 2560×2560 according to the input requirements.

[0056] It should be noted that Mosaic image enhancement refers to the process of stitching four images into a new training image to improve the robustness and generalization ability of the model. This method randomly crops and arranges the original images, fuses them together, and generates new images with more objects and complex backgrounds, effectively increasing the diversity and richness of the training data. Mosaic enhancement not only helps reduce overfitting, but also allows the model to better cope with different scales, perspectives, and environmental changes, thereby improving the accuracy and efficiency of object detection. Please refer to Figure 2 , which is a schematic diagram of the Mosaic data enhancement process.

[0057] In addition, random erasing is a data enhancement technique used to enhance the robustness and generalization ability of deep learning models. The specific implementation steps include: first, randomly select a rectangular area on the training image; then, determine the size and position of the rectangular area according to preset parameters; finally, set the pixel value of the area to a random value or zero. By creating a situation where local information is missing on the image, the model can learn under conditions of incomplete information, thereby improving its adaptability and performance in a variety of environments. This technology has a significant effect in tasks such as image classification and object detection, and helps the model better handle diverse and complex image data.

[0058] Step S04, establish a neural network model, and input the target annotated image into the neural network model for training, and measure the performance of the neural network model by using accuracy, precision, recall and F1 score on the test set. At the same time, use the model parameter amount, floating-point calculation amount and the average inference time of the neural network model on a single ore image as the measurement indicators of model complexity to train and obtain the target neural network model.

[0059] Specifically, the neural network model includes a backbone network and a multi-scale fusion network connected to the backbone network. The backbone network includes a convolution layer, four fused mobile inverted bottleneck convolution layers, four mobile inverted bottleneck convolution layers, and an efficient layer aggregation spatial pyramid pooling structure. The multi-scale fusion network consists of upsampling, a weighted bidirectional feature fusion structure, a C2f structure, a global attention mechanism, a convolution layer, and a detection head, forming a bottom-up and top-down bidirectional feature fusion structure.

[0060] Among them, the third fused moving inverted bottleneck convolution layer and the first moving inverted bottleneck convolution layer in the backbone network are respectively connected to the corresponding weighted bidirectional feature fusion structure in the bottom-up feature fusion structure of the multi-scale fusion network, and the efficient layer aggregation spatial pyramid pooling structure is respectively connected to the upsampling in the bottom-up feature fusion structure of the multi-scale fusion network and the weighted bidirectional feature fusion structure in the top-down feature fusion structure;

[0061] The three detection heads are respectively connected with the specific global attention mechanism and C2f structure in the top-down feature fusion structure.

[0062] See also Figure 3 , which is a schematic diagram of the backbone network structure, wherein the ore image with an input of 2560×2560×3 is subjected to a convolution operation with a convolution kernel size of 3×3 and a stride of 2 to obtain a feature matrix of 1280×1280×32; the feature matrix of 1280×1280×32 outputted from the first part is input into a fused moving inverted bottleneck convolution layer stacked 4 times, and finally a feature matrix of 160×160×96 is obtained; the obtained feature matrix of 160×160×96 is input into a moving inverted bottleneck convolution layer stacked 4 times to obtain a feature matrix of 80×80×320; the obtained 80×80×320 is concatenated after three global maximum pooling layers in the efficient layer aggregation spatial pyramid pooling structure to obtain a feature matrix of 80×80×1280.

[0063] See also Figure 4 , is a schematic diagram of the structure of the multi-scale fusion network. This structure fuses the input multi-scale features through bidirectional (bottom-up and top-down) features, which can combine low-resolution semantic information while maintaining high-resolution information. The weighted operation enhances key features and weakens redundant information by giving higher weights to important features. And the C2f structure is used to extract rich feature representations. The features extracted from C2f are processed by the global attention mechanism to capture the global context information in the image, and the important feature areas are highlighted by weighting, suppressing unimportant background information. This makes the structure more accurate and robust when processing overlapping ore images.

[0064] In this embodiment, the bottom-up feature fusion structure of the multi-scale fusion network includes a first upsampling, a first weighted bidirectional feature fusion structure, a first C2f structure, a first global attention mechanism, a second upsampling, a second weighted bidirectional feature fusion structure, and a second C2f structure connected in sequence;

[0065] Among them, the efficient layer aggregation spatial pyramid pooling structure is connected to the first upsampling, the first moving inverted bottleneck convolution layer is connected to the first weighted bidirectional feature fusion structure, and the third fused moving inverted bottleneck convolution layer is connected to the second weighted bidirectional feature fusion structure.

[0066] In addition, the top-down feature fusion structure of the multi-scale fusion network includes a second global attention mechanism connected to the second C2f structure, and a convolution layer, a third weighted bidirectional feature fusion structure, a third global attention mechanism, a third C2f structure, a fourth global attention mechanism, a fourth weighted bidirectional feature fusion structure and a fourth C2f structure sequentially connected to the second global attention mechanism;

[0067] Among them, the second global attention mechanism, the third C2f structure and the fourth C2f structure are respectively connected to the detection head.

[0068] It should be noted that the weighted bidirectional feature fusion structure is a three-layer structure of path aggregation, each layer includes original nodes, intermediate nodes and output nodes connected in sequence, where an additional channel is established between the original nodes and the output nodes in each layer, and the intermediate nodes and output nodes between layers are connected, but the path direction is opposite. Figure 5 , is a schematic diagram of the weighted bidirectional feature fusion structure, where from top to bottom, the intermediate nodes of P6, P5 and P4 are connected in sequence, and from bottom to top, the output nodes of P4, P5 and P6 are connected in sequence. In addition, fast normalization fusion is used, which directly divides the weight by the sum of all weights for normalization, and normalizes the weight to [0,1], which improves the calculation speed. The fusion formula is:

[0069] ;

[0070] Among them, Out represents the result of weighted feature fusion, w i represents the weight and w i ≥ 0, ε represents a small value, which is used to prevent the denominator of the formula from being zero. i represents the input features. The weighted bidirectional feature pyramid can effectively fuse the information of feature maps at different levels. Figure 5 Taking the P6 layer as an example, the formula is as follows:

[0071] ;

[0072] ;

[0073] in, , , , and Expressed as weights, the role of Resize is to ensure that the size of feature maps is consistent before feature fusion. It is the intermediate node of P6 layer. The intermediate node of P6 layer passes through the input node of P6 layer. And the input node of the P7 layer It can be calculated. is the output node of the P6 layer, which is calculated based on the input nodes, intermediate nodes of the P6 layer, and the output nodes of the P5 layer.

[0074] Furthermore, the fused mobile inverted bottleneck convolution layer is an improved convolution module in the MobileNet series of networks (such as MobileNetV3), which enhances feature extraction and fusion capabilities through 3x3 convolution layers, SE modules, and 1x1 projection convolution layers. The structure of the fused mobile inverted bottleneck convolution layer is as follows: Figure 6 As shown in the figure. First, the number of channels is increased through a 3x3 convolutional layer, followed by batch normalization and SiLU activation function to stabilize training and introduce nonlinearity. The following SE module adaptively adjusts the weight of each channel through global average pooling and fully connected layers to enhance the feature relationship between channels. After that, a 1x1 projection convolution layer restores the number of channels to the original number. Finally, the input is directly added to the output through a residual connection to improve information flow and alleviate the gradient vanishing problem. The overall design aims to significantly improve the feature representation capability and performance of the model while maintaining low computational cost.

[0075] Furthermore, the moving inverted bottleneck convolution layer includes a 1x1 dilated convolution layer, a 3x3 depthwise separable convolution layer, an SE module, a 1x1 projection convolution layer, and a Dropout layer connected in sequence, wherein the input of the moving inverted bottleneck convolution layer is directly added to the output of the moving inverted bottleneck convolution layer through a residual connection. Figure 7 , is a schematic diagram of the structure of the mobile inverted bottleneck convolution layer, in which a 1x1 extended convolution layer is used to expand the number of channels, and then batch normalization and SiLU activation functions are used to stabilize training and introduce nonlinearity. Next, a 3x3 depth-separable convolution layer is performed to extract spatial features, and batch normalization and SiLU activation functions are used again. Next, the feature relationship between channels is enhanced through the SE module. After that, a 1x1 projection convolution layer is used to restore the number of channels, and the Dropout layer is used to reduce overfitting. Finally, the input is directly added to the output through a residual connection to maintain the transmission of information and the flow of gradients. This module is designed to extract features efficiently while reducing the amount of computation and parameters.

[0076] The efficient layer aggregation spatial pyramid pooling structure includes a first CBS module, a maximum pooling layer, a splicing layer and a second CBS module, wherein the output of the first CBS module is connected to the splicing layer on the one hand, and passes through three maximum pooling layers on the other hand, and the output of each maximum pooling layer is connected to the splicing layer, and the output of the splicing layer is connected to the second CBS module. Figure 8, is a structural diagram of the efficient layer aggregation spatial pyramid pooling structure. First, the CBS (convolution, batch normalization, SiLU activation function) module is used to extract preliminary features and stabilize training. Then, the input feature map passes through three consecutive maximum pooling layers. Each pooling reduces the spatial size of the feature map and gradually extracts important spatial information. Next, these pooled feature maps of different scales are merged in the splicing layer, combining multi-scale information to improve feature expression capabilities. Finally, another CBS module performs further convolution processing on the spliced ​​feature map to generate a higher-level feature map. The whole process aims to enhance the recognition ability of the model through multi-scale feature extraction and fusion. The main purpose of designing an efficient layer aggregation network is to solve the problem that the convergence of deep models will gradually deteriorate when performing model scaling.

[0077] In this embodiment, the global attention mechanism is a new attention module after the convolutional block attention module. It is a module that combines the channel attention mechanism and the spatial attention mechanism. The structural diagram of the global attention mechanism is as follows: Fig. 9 As shown, the structural diagram of the channel attention mechanism is as follows Fig.10 As shown, the structural diagram of the spatial attention mechanism is as follows Fig.11 As shown in the figure, the global attention mechanism can reduce information dispersion and amplify the interactive features of the global dimension. By introducing the global attention mechanism, the model can better understand the overlapping information in the image, thereby achieving accurate ore detection under overlapping conditions.

[0078] The global attention mechanism is constructed by giving a feature map F 1 , , after two independent attention submodules, the original feature map is first corrected by the channel attention mechanism module to obtain the intermediate state F 2 , and then corrected again by the spatial attention mechanism module to obtain the final feature map F 3 , the specific formula is as follows:

[0079] ;

[0080] ;

[0081] Among them, M c and M s are the channel attention map and the spatial attention map respectively, and ⨂ represents the multiplication calculation of the element method.

[0082] In the step of measuring the performance of the neural network model by using accuracy, precision, recall and F1 score on the test set, the formula used is:

[0083] ;

[0084] ;

[0085] ;

[0086] ;

[0087] Among them, Accuracy represents the accuracy rate, Precision represents the precision rate, Recall represents the recall rate, F1 represents the F1 score (F1-score), TP represents the number of correctly detected positive samples, TN represents the number of correctly identified negative samples, FP represents that negative samples are identified as positive samples, and FN represents that positive samples are identified as negative samples.

[0088] See also Fig.12 , is a schematic diagram of the structure of the neural network model. The network structure improves the ability of feature extraction and multi-scale target detection by integrating the mobile inverted bottleneck residual convolution layer, C2f module, weighted bidirectional feature fusion and global attention mechanism. These improvements enable the network to significantly improve the detection performance while maintaining high efficiency, especially in the ore image overlapping scene and multi-scale target detection tasks.

[0089] Step S05, obtaining an ore image to be identified, inputting the ore image to be identified into the target neural network model, and obtaining a recognition result.

[0090] In summary, the ore detection method in the above embodiment of the present invention is designed to improve the speed and accuracy of ore identification by designing a neural network model. The neural network model includes a backbone network and a multi-scale fusion network connected to the backbone network. The backbone network includes a convolution layer, 4 fused mobile inverted bottleneck convolution layers, 4 mobile inverted bottleneck convolution layers, and an efficient layer aggregation space pyramid pooling structure. The multi-scale fusion network consists of upsampling, weighted bidirectional feature fusion structure, C2f structure, global attention mechanism, convolution layer and detection head, forming a bottom-up and top-down bidirectional feature fusion structure. Specifically, the model effectively reduces the amount of parameters and calculations; secondly, combined with the efficient layer aggregation space pyramid pooling structure, the feature extraction between different levels is strengthened, and the network recognition accuracy is improved; finally, the path aggregation network module is optimized The model structure, the global attention mechanism and the weighted bidirectional feature pyramid network feature fusion mechanism are introduced to enhance the recognition ability of overlapping ore images. This allows the model to be deployed on most sorting machines with high real-time requirements and large ore processing volumes, so that a larger amount of ore can be processed per unit time and the recognition accuracy is higher.

[0091] Embodiment 2

[0092] See also Fig.13 , Fig.13 : is a structural block diagram of an ore detection system 200 provided in the second embodiment of the present invention. The ore detection system 200 includes: a labeling module 21, a division module 22, an image processing module 23, a neural network model training module 24 and an input module 25, wherein:

[0093] The labeling module 21 is used to obtain the original ore image, label the original ore image, obtain the labeled image, and form a data set;

[0094] A division module 22 is used to divide the data set into a training set, a test set and a validation set according to a preset ratio;

[0095] The image processing module 23 is used to pre-process and normalize the labeled images in the training set, the test set and the validation set to obtain the target labeled images;

[0096] A neural network model training module 24 is used to establish a neural network model, input the target annotated image into the neural network model for training, and measure the performance of the neural network model by using accuracy, precision, recall and F1 score on the test set. At the same time, the model parameter amount, floating-point calculation amount and average inference time of the neural network model on a single ore image are used as indicators of model complexity to train and obtain a target neural network model. The neural network model includes a backbone network and a multi-scale fusion network connected to the backbone network. The backbone network includes a convolution layer, 4 fused mobile inverted bottleneck convolution layers, 4 mobile inverted bottleneck convolution layers and an efficient layer aggregation spatial pyramid pooling structure. The multi-scale fusion network consists of upsampling, a weighted bidirectional feature fusion structure, a C2f structure, a global attention mechanism, a convolution layer and a detection head to form a bottom-up and top-down bidirectional feature fusion structure.

[0097] Among them, the third fused moving inverted bottleneck convolution layer and the first moving inverted bottleneck convolution layer in the backbone network are respectively connected to the corresponding weighted bidirectional feature fusion structure in the bottom-up feature fusion structure of the multi-scale fusion network, and the efficient layer aggregation spatial pyramid pooling structure is respectively connected to the upsampling in the bottom-up feature fusion structure of the multi-scale fusion network and the weighted bidirectional feature fusion structure in the top-down feature fusion structure;

[0098] The three detection heads are respectively connected to the specific global attention mechanism and C2f structure in the top-down feature fusion structure;

[0099] The bottom-up feature fusion structure of the multi-scale fusion network includes a first upsampling, a first weighted bidirectional feature fusion structure, a first C2f structure, a first global attention mechanism, a second upsampling, a second weighted bidirectional feature fusion structure and a second C2f structure connected in sequence;

[0100] The efficient layer aggregation spatial pyramid pooling structure is connected to the first upsampling layer, the first moving inverted bottleneck convolution layer is connected to the first weighted bidirectional feature fusion structure, and the third fused moving inverted bottleneck convolution layer is connected to the second weighted bidirectional feature fusion structure;

[0101] The top-down feature fusion structure of the multi-scale fusion network includes a second global attention mechanism connected to the second C2f structure, and a convolution layer, a third weighted bidirectional feature fusion structure, a third global attention mechanism, a third C2f structure, a fourth global attention mechanism, a fourth weighted bidirectional feature fusion structure and a fourth C2f structure sequentially connected to the second global attention mechanism;

[0102] Wherein, the second global attention mechanism, the third C2f structure and the fourth C2f structure are respectively connected to the detection head;

[0103] The weighted bidirectional feature fusion structure is a three-layer structure of path aggregation. Each layer includes original nodes, intermediate nodes, and output nodes that are connected in sequence. An additional channel is established between the original nodes and the output nodes in each layer, and the intermediate nodes and output nodes between layers are connected, but the path directions are opposite.

[0104] The fused mobile inverted bottleneck convolution layer includes a 3x3 convolution layer, an SE module, and a 1x1 projection convolution layer connected in sequence, wherein the input of the fused mobile inverted bottleneck convolution layer is directly added to the output of the fused mobile inverted bottleneck convolution layer through a residual connection;

[0105] The moving inverted bottleneck convolution layer includes a 1x1 dilated convolution layer, a 3x3 depth-separable convolution layer, an SE module, a 1x1 projection convolution layer, and a Dropout layer connected in sequence, wherein the input of the moving inverted bottleneck convolution layer is directly added to the output of the moving inverted bottleneck convolution layer through a residual connection;

[0106] The efficient layer aggregation spatial pyramid pooling structure includes a first CBS module, a maximum pooling layer, a splicing layer and a second CBS module, wherein the output of the first CBS module is connected to the splicing layer on the one hand, and passes through three maximum pooling layers on the other hand, and the output of each maximum pooling layer is connected to the splicing layer, and the output end of the splicing layer is connected to the second CBS module;

[0107] The input module 25 is used to obtain the ore image to be identified, and input the ore image to be identified into the target neural network model to obtain the identification result.

[0108] Embodiment 3

[0109] Another aspect of the present invention provides an electronic device, see Fig.14 , shown is an electronic device in Embodiment 3 of the present invention, comprising a memory 20, a processor 10, and a computer program 30 stored in the memory and executable on the processor, wherein the processor 10 implements the above-mentioned ore detection method when executing the computer program 30.

[0110] In some embodiments, the processor 10 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 20, such as executing access restriction programs.

[0111] Among them, the memory 20 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 20 can be an internal storage unit of an electronic device, such as a hard disk of the electronic device. In other embodiments, the memory 20 can also be an external storage device of an electronic device, such as a plug-in hard disk equipped on the electronic device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Further, the memory 20 can also include both an internal storage unit of the electronic device and an external storage device. The memory 20 can not only be used to store application software and various types of data of the electronic device, but also can be used to temporarily store data that has been output or is to be output.

[0112] It should be pointed out that Fig.14 The structure shown does not constitute a limitation on the electronic device. In other embodiments, the electronic device may include fewer or more components than those shown in the figure, or combine certain components, or arrange the components differently.

[0113] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the ore detection method as described above is implemented.

[0114] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0115] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0116] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0117] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0118] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention patent shall be subject to the attached claims.

Claims

1. A method for detecting ore, It is characterized in that The method comprises: Acquire an original ore image, perform annotation processing on the original ore image to obtain an annotated image, and form a data set; Dividing the data set into a training set, a test set, and a validation set according to a preset ratio; Preprocess and normalize the labeled images in the training set, test set, and validation set to obtain the target labeled images; Establishing a neural network model, and inputting the target annotated image into the neural network model for training, and measuring the performance of the neural network model by using accuracy, precision, recall and F1 score on the test set, and at the same time, using the model parameter amount, floating point calculation amount and average inference time of the neural network model on a single ore image as the measurement indicators of model complexity, so as to train and obtain the target neural network model; Acquire an ore image to be identified, input the ore image to be identified into the target neural network model, and obtain an identification result; The neural network model includes a backbone network and a multi-scale fusion network connected to the backbone network, wherein the backbone network includes a convolution layer, four fused mobile inverted bottleneck convolution layers, four mobile inverted bottleneck convolution layers, and an efficient layer aggregation spatial pyramid pooling structure, and the multi-scale fusion network is composed of upsampling, a weighted bidirectional feature fusion structure, a C2f structure, a global attention mechanism, a convolution layer, and a detection head, forming a bottom-up and top-down bidirectional feature fusion structure; Among them, the third fused moving inverted bottleneck convolution layer and the first moving inverted bottleneck convolution layer in the backbone network are respectively connected to the corresponding weighted bidirectional feature fusion structure in the bottom-up feature fusion structure of the multi-scale fusion network, and the efficient layer aggregation spatial pyramid pooling structure is respectively connected to the upsampling in the bottom-up feature fusion structure of the multi-scale fusion network and the weighted bidirectional feature fusion structure in the top-down feature fusion structure; The three detection heads are respectively connected to the specific global attention mechanism and C2f structure in the top-down feature fusion structure; The bottom-up feature fusion structure of the multi-scale fusion network includes a first upsampling, a first weighted bidirectional feature fusion structure, a first C2f structure, a first global attention mechanism, a second upsampling, a second weighted bidirectional feature fusion structure and a second C2f structure connected in sequence; The efficient layer aggregation spatial pyramid pooling structure is connected to the first upsampling layer, the first moving inverted bottleneck convolution layer is connected to the first weighted bidirectional feature fusion structure, and the third fused moving inverted bottleneck convolution layer is connected to the second weighted bidirectional feature fusion structure; The top-down feature fusion structure of the multi-scale fusion network includes a second global attention mechanism connected to the second C2f structure, and a convolution layer, a third weighted bidirectional feature fusion structure, a third global attention mechanism, a third C2f structure, a fourth global attention mechanism, a fourth weighted bidirectional feature fusion structure and a fourth C2f structure sequentially connected to the second global attention mechanism; Wherein, the second global attention mechanism, the third C2f structure and the fourth C2f structure are respectively connected to the detection head; The fused mobile inverted bottleneck convolution layer includes a 3x3 convolution layer, an SE module, and a 1x1 projection convolution layer connected in sequence, wherein the input of the fused mobile inverted bottleneck convolution layer is directly added to the output of the fused mobile inverted bottleneck convolution layer through a residual connection; The efficient layer aggregation spatial pyramid pooling structure includes a first CBS module, a maximum pooling layer, a splicing layer and a second CBS module, wherein the output of the first CBS module is connected to the splicing layer on the one hand, and passes through three maximum pooling layers on the other hand, and the output of each maximum pooling layer is connected to the splicing layer, and the output end of the splicing layer is connected to the second CBS module.

2. The ore detection method according to claim 1, It is characterized in that The weighted bidirectional feature fusion structure is a three-layer structure of path aggregation, each layer includes original nodes, intermediate nodes and output nodes connected in sequence, wherein an additional channel is established between the original nodes and the output nodes in each layer, and a connection relationship is established between the intermediate nodes and the output nodes between layers, but the path direction is opposite.

3. The ore detection method according to claim 2, It is characterized in that The moving inverted bottleneck convolution layer includes a 1x1 dilated convolution layer, a 3x3 depth-separable convolution layer, an SE module, a 1x1 projection convolution layer, and a Dropout layer, which are connected in sequence, wherein the input of the moving inverted bottleneck convolution layer is directly added to the output of the moving inverted bottleneck convolution layer through a residual connection.

4. A mineral detection system, It is characterized in that Used to implement the ore detection method according to any one of claims 1 to 3, the system comprises: A labeling module is used to obtain an original ore image, label the original ore image, obtain a labeled image, and form a data set; A partitioning module, used to divide the data set into a training set, a test set and a validation set according to a preset ratio; An image processing module is used to preprocess and normalize the labeled images in the training set, test set, and validation set to obtain target labeled images; A neural network model training module is used to establish a neural network model, input the target annotated image into the neural network model for training, and measure the performance of the neural network model by using accuracy, precision, recall and F1 score on the test set. At the same time, the model parameter amount, floating point calculation amount and average inference time of the neural network model on a single ore image are used as measurement indicators of model complexity to train and obtain the target neural network model; The input module is used to obtain the ore image to be identified, input the ore image to be identified into the target neural network model, and obtain the identification result.

5. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the ore detection method according to any one of claims 1 to 3 is implemented.

6. An electronic device, It is characterized in that The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the ore detection method according to any one of claims 1 to 3 when executing the program.