Limestone granularity detection method and equipment based on YOLO-ADM and storage medium
By introducing the deformable attention mechanism DATTENTION and multi -scale characteristic fusion modules in the YOLOV8 framework, combined with the improved loss function MIOU, the problem of high granularity detection in the process of lime crushing and insufficient real -time detection capabilities have achieved efficient and accurate Limin -granularity detection.
Patent Information
- Application Number
- CN202411963167.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-01-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art has problems such as high difficulty in particle size detection during limestone crushing, high cost and insufficient real-time online detection capabilities, which limits its application in cement plant production.
Adopting the LiLO-ADM-based limestone granularity detection method, through the introduction of the deformable attention mechanism DATTENTION, multi-scale sequence feature fusion module SSFF and triple characteristics decoding module TFE in the YOLOV8 framework, combined with the improved loss function MIOU, the granularity of lime and stone particle size can be achieved Efficient testing.
It improves the accuracy and efficiency of limestone particle size detection, reduces implementation difficulty and cost, realizes real-time statistics and online detection of limestone particle size, and is suitable for the production environment of cement plants.
Smart Images

Figure CN119359735A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a limestone particle size detection method, device and storage medium based on YOLO-ADM. Background Art
[0002] Limestone crushing is a key link in the cement production process. It provides raw materials that meet the particle size requirements for cement production and has a direct impact on the quality and performance of cement. Due to the large variation in the particle size of limestone ore, it often causes crusher blockage and production accidents. It also causes extended crushing time, increased current and reduced output, resulting in energy waste and reduced efficiency, and also affects the safe production of enterprises.
[0003] In early research, the detection of limestone ore particle size relied on manual work, which not only required a lot of manpower and material resources, but also had low accuracy and efficiency, and could not meet the needs of ore use. With the continuous development and improvement of visual recognition algorithms, these technologies can be used to solve the problem of ore particle size recognition, and their recognition accuracy has exceeded that of humans in many aspects. Regarding the detection of raw ore particle size, early researchers mainly used methods such as U-Net
[71] 、PSPNet
[72] Semantic segmentation techniques such as sparse matrix and sparse matrix are used to analyze the particle size of ore. In recent research, scholars have also carried out improvements and innovations on algorithms.
[0004] Although some important progress has been made in the particle size detection of raw ore processing, there are still some shortcomings in these studies on particle size detection in the limestone crushing process of cement plants. First, existing studies rely on complex image processing technology, which increases the difficulty and cost of implementation. Secondly, some studies that can achieve real-time statistics and online detection of ore particle size often require the use of high-performance hardware or specialized analytical instruments, which to a certain extent limits their application in actual production. Therefore, particle size detection based on the limestone crushing process still needs more in-depth research and exploration. Summary of the invention
[0005] The present invention proposes a limestone particle size detection method, device and storage medium based on YOLO-ADM, which can solve at least one of the technical problems in the background technology.
[0006] To achieve the above object, the present invention adopts the following technical solutions: A limestone particle size detection method based on YOLO-ADM, performing the following steps by a computer device, S1. Collect limestone dataset.
[0007] During the whole day, pictures of limestone blocks under different lighting conditions are collected for different limestone discharge ports to create a limestone block dataset for the initial sample.
[0008] Further, step S1 comprises: S11, taking pictures of the limestone raw materials in real time according to the high-definition cameras installed at each limestone discharge port; S12, screening the limestone pictures obtained in step S11, selecting pictures under different lighting, different discharge ports, and different time periods, averaging the screened limestone data pictures in terms of categories, and eliminating pictures due to blur; S13, marking the screened limestone images, framing the target area where the limestone blocks of a certain size are located, that is, the position of the real frame, and then using the marked limestone images as the initial sample data set, wherein the limestone blocks of a certain size refer to the stones that can be seen from the face and can be screened out by the screen before entering the crusher; S2, divide the limestone block data set obtained in S1 into a training set, a validation set, and a test set according to a ratio of 7:2:1; S3, performing data enhancement operation on the training set samples in S2, expanding the samples to three times of the original size, wherein the data enhancement operation includes rotation, random cropping, and blurring, wherein the rotation includes 90° clockwise rotation, 90° counterclockwise rotation, and inversion, and the blurring is Gaussian blurring with a blurring radius of 3px; S4, integrating the deformable attention mechanism DAttention into the YOLOV8 backbone network; The specific operation of step S4 is as follows: S41, deformable attention mechanism DAttention obtains the query volume by the dot product weight matrix of the elements in the input image, and then dynamically moves the key K and value V to important positions based on a set of offsets based on the offset network. The offset network uses GELU (Gaussian Error Linear Unit) as a nonlinear activation function; S42, in the existing YOLOV8 backbone network, the input features enter the C2f module, which is first convolved and split, and is divided into two parts. One part is input to The output of each residual module leads to a branch for subsequent splicing operations, and the other part after the split operation is directly spliced with the output branches of these residual modules. Finally, feature extraction is completed through convolution operations, and the deformable attention module DAttention is inserted into the convolution module, and then the other part after the split operation is directly spliced with the output branches of these residual modules to obtain a new C2f-DAttention module; S43, replacing the C2f module on the upper layer of the backbone network SPPF module with the C2f-DAttention module obtained in S42; S5, integrate the multi-scale sequence feature fusion module SSFF and the triple feature decoding module TFE into the YOLOv8 neck network, and add them to S4 to obtain the YOLO-ADM network model; The specific operations of step S5 are as follows: S51. In the existing YOLOV8 network structure, the backbone network CSPDarkNet53 contains three effective branches P3, P4, and P5. These three effective branches are used as the multi-scale sequence feature fusion module SSFF, as follows: The SSFF module is designed based on the P3 feature map. First, the size of P4, P5 to P3 is adjusted through 1×1 convolution and nearest neighbor interpolation. Then, the dimension of each feature layer is increased from a three-dimensional tensor to a four-dimensional tensor (increasing the depth) using the unsqueeze method. Finally, it is stacked together and input into the 3D convolution channel to realize the combination of multi-scale features. In S52 and the backbone network CSPDarkNet53, the P3 and P4 layers are convolved to obtain large-size feature maps and medium-size feature maps. The SPPF layer is convolved to obtain a small-size feature map. The large-, medium-, and small-size feature maps are input into the TFE module for feature fusion, as follows: The TFE module first performs convolution on the large-size feature map, and then uses a hybrid structure of maximum pooling and average pooling for downsampling. For the small-size feature map, the convolution module is used to adjust the number of channels, and then the nearest neighbor interpolation method is used for upsampling. Finally, the three large, medium, and small-size feature maps of the same size are convolved once and concatenated in the channel dimension. The calculation formula is as follows:
[0009] Among them, F TEE Represents the feature map output by the TFE module. 1 , F m , F s Represents the feature maps of large, medium and small sizes respectively. TEE By F1 , F m , F s F TEE With F m The same resolution and the number of channels is F m three times; S6. Generate auxiliary bounding boxes based on the scale factor and design a new YOLO-ADM model loss function MioU by minimizing the diagonal distance between the limestone prediction box and the real box. The existing YOLOv8 loss function uses CIoU. MPDIoU replaces CIoU, and the IoU part in the MPDIoU calculation formula is replaced by Inner-IoU to construct a new loss function MioU. S7, train the YOLO-ADM network model through the training set and verify the YOLO-ADM model through the verification set during the training process; The specific operations of step S7 are as follows: S71. Prepare three folders train, valid and test according to the YOLO format to store the training set, validation set and test set respectively. Each folder contains two folders images and labels. The images folder stores the limestone image data, and the labels folder stores the label files of the corresponding images. S72. Configure network selection, select Windows system and pytorch framework for training; S73, setting network model parameters, according to the computer video memory and memory size, setting the YOLO-ADM network model input image size, recognition quantity and name, pre-training weight file, number of training rounds, closing mosaic enhancement argument, optimizer type, and patience parameter; S74, training until the network model converges, using the validation set for validation during the training process, saving the weight file obtained for each training round and the most weighted file of the trained argument; S8. Test the recognition performance of the YOLO-ADM network model using the test set; The specific operations of step S8 are as follows: S81, load the trained optimal network model weight file obtained in S7, input the test set into the trained YOLO-ADM network model, extract features by adding the backbone network of DAttention, and integrate the neck network of SSFF and TFE modules to achieve the fusion of deep and shallow features, and obtain all the prediction results of the network belonging to the two feature layers; S82, obtaining the coordinates, confidence and category probabilities of all prediction boxes that may contain limestone blocks by setting the confidence threshold; and then removing redundant prediction boxes by non-maximum suppression processing to obtain the final detection result; S9, after pixel-level processing of the limestone object recognition frame predicted by the YOLO-ADM model, the size of each limestone particle is obtained; The specific operations of step S9 are as follows: S91, combining the prediction frame coordinates obtained in S8 with the camera focal length, the straight-line distance between the camera and the ore, and the shooting angle to obtain the particle size of the limestone block corresponding to each prediction frame; S92. Obtain the particle size level of each stone according to the set classification threshold.
[0010] On the other hand, the present invention further discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the above method.
[0011] On the other hand, the present invention further discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.
[0012] It can be seen from the above technical scheme that the limestone particle size detection method and system based on YOLO-ADM of the present invention first collects the limestone data set of the raw material crushing section, then performs data enhancement on the initial sample limestone data set, and divides it into a training set, a validation set, and a test set; the deformable attention mechanism DAttention, the multi-scale sequence fusion module SSFF, and the triple feature decoding module TFE are integrated into the YOLOv8 framework to obtain the YOLO-ADM model; and on this basis, the training loss function is improved, and the loss function MioU based on the auxiliary border and the minimum point distance is designed; the YOLO-ADM model is trained by the training set and the performance of the network model is tested by the test set. The method of the present invention introduces deformable attention DAttention into the YOLOv8 network, and redesigns the YOLOv8 neck network based on the multi-scale sequence fusion module SSFF and the triple feature decoding module TFE, and combines the designed loss function MioU to show excellent performance in limestone detection and good generalization performance.
[0013] The present invention improves the YOLOv8 framework, introduces a deformable attention mechanism module (DAttention) to optimize the backbone network, so that the model can flexibly distort the sampling grid, dynamically adjust the features that need to be paid attention to, and enable the model to better identify dense and stacked raw material ore targets; the present invention redesigns a multi-scale feature fusion network based on the SSFF module and the TFE module, and redesigns the YOLOv8 neck network to improve the detection performance of dense and stacked targets; on this basis, the feature layer of larger-sized targets is secondary fused for smaller and denser ore target detection; based on the auxiliary bounding box and the metric standard of minimizing the diagonal distance between the real box and the predicted box, the present invention proposes an improved loss function MIoU to solve the problem of weak generalization ability of the CIoU loss function in the original YOLOv8 network, and at the same time, an algorithm for generating auxiliary bounding boxes based on scale factors and directly minimizing the diagonal vertex distance between the predicted box and the real box is proposed, so as to more accurately reflect the similarity between the real box and the predicted box, and improve the bounding box regression convergence speed, thereby improving the detection performance of the model, so that the detection results can be better applied to the crushing control process, which has important theoretical and practical significance and promotion value for the application of complex industrial problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 is a flow chart of an embodiment of the present invention; Figure 2 This is a deformable attention DAttention operation structure diagram of an embodiment of the present invention; Figure 3 The C2f_DAttention module that introduces the attention mechanism into the embodiment of the present invention; Figure 4 The YOLO-ADM network structure of the embodiment of the present invention; Figure 5 It is a multi-scale sequence feature fusion module SSFF according to an embodiment of the present invention; Figure 6 It is a triple feature decoding module TFE according to an embodiment of the present invention; Figure 7 This is a schematic diagram of MPDIoU calculation according to an embodiment of the present invention; Figure 8 This is a schematic diagram of I-IoU calculation in an embodiment of the present invention; Fig. 9 This is the limestone block recognition effect of the improved YOLO-ADM network model in a normal environment according to an embodiment of the present invention; Fig.10 The improved YOLO-ADM network model of the embodiment of the present invention is used to identify limestone blocks in a dusty environment; Fig.11The improved YOLO-ADM network model of the embodiment of the present invention is used to identify limestone blocks in other crushing openings; Fig.12 The performance curves of the improved YOLO-ADM and YOLOv8 are compared in the embodiment of the present invention; Fig.13 This is a schematic diagram of the conversion between the pixels and the actual size of a limestone image according to an embodiment of the present invention; Fig.14 This is a schematic diagram of limestone particle size calculation according to an embodiment of the present invention. DETAILED DESCRIPTION
[0015] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0016] like Figure 1 As shown, the limestone particle size detection method based on YOLO-ADM described in this embodiment is implemented in the following steps: S1. During the whole day, collect dense pictures of limestone blocks under different lighting conditions for different limestone unloading ports to ensure the practicality and adequacy of the data, and then make the initial sample limestone block data set from the collected picture data.
[0017] The specific method of step S1 is as follows: S11, taking pictures of the limestone raw materials in real time according to the high-definition cameras installed at each limestone discharge port; S12, screening the limestone pictures obtained in step S11, selecting pictures under different lighting, different discharge ports, and different time periods, averaging the screened limestone data pictures in terms of categories, and eliminating pictures due to blur; S13, define the ID of the picture for the filtered limestone picture, then use labelimg software to mark each picture, frame the target area where the limestone block of a certain size is located, that is, the position of the real frame, generate a txt label file in yolo format, the label file name corresponds to the picture ID, and then use the marked limestone picture as the initial sample data set, the limestone block of a certain size refers to the stone that can be seen by the face and can be screened out by the screen before entering the crusher; S2, divide the limestone block data set obtained in S1 into training set, validation set and test set according to 7:2:1, and generate train, valid and test folders respectively. Each folder corresponds to two folders, images and labels. The images folder stores the collected original images, and the labels folder stores the label files corresponding to the image IDs in the images folder. S3, performing data enhancement operation on the training set samples in S2, expanding the samples to three times of the original size, wherein the data enhancement operation includes rotation, random cropping, and blurring, wherein the rotation includes 90° clockwise rotation, 90° counterclockwise rotation, and inversion, and the blurring is Gaussian blurring with a blurring radius of 3px; S4, integrating the deformable attention mechanism DAttention into the YOLOV8 backbone network; The specific operation of step S4 is as follows: S41, construct a deformable attention mechanism DAttention Figure 2 As shown, the query volume is obtained by taking the dot product weight matrix of the elements in the input image, and then a set of offsets are obtained based on the offset network, and then the key K and value V are dynamically moved to important positions according to the offsets. The offset network uses GELU (Gaussian Error Linear Unit) as a nonlinear activation function; S42, construct the improved C2f module C2f-DAttention, such as Figure 3 As shown in the figure, in the C2f module of the existing YOLOV8 backbone network, the input features enter the convolution and split operations first and are divided into two parts. One part is input to The output of each residual module will lead to a branch for subsequent splicing operations, and the other part after the split operation is directly spliced with the output branches of these residual modules. Finally, the feature extraction is completed through the convolution operation, and the deformable attention module DAttention is inserted into the convolution module, and then the other part after the split operation is directly spliced with the output branches of these residual modules to obtain the new module C2f-DAttention; S43, the C2f-DAttention module obtained in S42 is Figure 4 As shown, the C2f module on the upper layer of the backbone network SPPF module is replaced; S5. According to Figure 4 As shown, the multi-scale sequence feature fusion module SSFF and the triple feature decoding module TFE are integrated into the YOLOv8 neck network, and added to S4 to obtain the YOLO-ADM network model; The specific operations of step S5 are as follows: S51, construct a multi-scale sequence feature fusion module SSFF module, such as Figure 5 As shown in the figure, in the existing YOLOV8 network structure, the backbone network CSPDarkNet53 contains three effective branches P3, P4, and P5. These three effective branches are used as the multi-scale sequence feature fusion module SSFF, as follows: The SSFF module is designed based on the P3 feature map. First, the size of P4, P5 to P3 is adjusted through 1×1 convolution and nearest neighbor interpolation. Then, the dimension of each feature layer is increased from a three-dimensional tensor to a four-dimensional tensor (increasing the depth) using the unsqueeze method. Finally, it is stacked together and input into the 3D convolution channel to realize the combination of multi-scale features. S52, construct a triple feature decoding module, such as Figure 6 As shown in the figure, in the backbone network CSPDarkNet53, the P3 and P4 layers are convolved to obtain large-size feature maps and medium-size feature maps, and the SPPF layer is convolved to obtain a small-size feature map. The large, medium, and small-size feature maps are input into the TFE module for feature fusion, as follows: The TFE module first performs convolution on the large-size feature map, and then uses a hybrid structure of maximum pooling and average pooling for downsampling. For the small-size feature map, the convolution module is used to adjust the number of channels, and then the nearest neighbor interpolation method is used for upsampling. Finally, the three large, medium, and small-size feature maps of the same size are convolved once and concatenated in the channel dimension. The calculation formula is as follows:
[0018] Among them, FTEE represents the feature map output by the TFE module. F1, Fm, Fs represent the feature maps of large, medium and small sizes respectively. FTEE is obtained by concatenating F1, Fm, Fs. FTEE has the same resolution as Fm, and the number of channels is three times that of Fm; S6. Generate auxiliary bounding boxes based on the scale factor and design a new YOLO-ADM model loss function MioU by minimizing the diagonal distance between the limestone prediction box and the true box. The existing YOLOv8 loss function uses CIoU. MPDIoU replaces CIoU, and the IoU part in the MPDIoU calculation formula is replaced by Inner-IoU to construct a new loss function MioU. The specific calculation formula is as follows:
[0019] The MPDIoU loss function is a new bounding box similarity comparison metric based on the minimum point distance. The specific calculation process is as follows:
[0020] Among them, according to Figure 7 As shown, Indicates the coordinates of the upper left and lower right corners of the prediction box; Indicates the coordinates of the upper left corner and lower right corner of the real box. Respectively represent the distance between the upper left corner and the lower right corner of the two boxes.
[0021] The I-IoU loss function is a new bounding box similarity comparison metric based on the minimum point distance. The specific calculation process is as follows: During model training, the scale factor is used Control the generation of auxiliary bounding boxes of different scales for calculating the loss. In this way, a smaller auxiliary bounding box calculation loss has a positive effect on the regression of high IoU samples, while the opposite is true for low IoU samples. The calculation formula is as follows: First, define the upper left and lower right coordinates of the real box:
[0022] In the formula, according to Figure 8 As shown, is the center point of the real frame, are the width and height of the ground-truth box respectively.
[0023] Then, define the top left and bottom right coordinates of the predicted bounding box:
[0024] in, is the center point of the predicted bounding box, are the width and height of the predicted bounding box respectively.
[0025] Next, calculate the intersection and union areas:
[0026] Finally, calculate I-IoU:
[0027] From this we can obtain that when When it is less than 1, the auxiliary border size is smaller than the actual border, and its effective range of regression is smaller than the IoU loss, but its absolute value of the gradient is larger than the gradient obtained by the IoU loss, which can accelerate the convergence of high IoU samples. When it is greater than 1, the larger scale auxiliary bounding box expands the effective range of regression and improves the regression of low IoU.
[0028] S7, train the YOLO-ADM network model through the training set and verify the YOLO-ADM model through the verification set during the training process; The specific operations of step S7 are as follows: S71. Prepare three folders train, valid and test according to the YOLO format to store the training set, validation set and test set respectively. Each folder contains two folders images and labels. The images folder stores the limestone image data, and the labels folder stores the label files of the corresponding images. S72. Configure network selection, select Windows system and pytorch framework for training; S73. Set the network model parameters. According to the computer video memory and memory size, set the YOLO-ADM network model input image size, recognition quantity and name, pre-trained weight file, number of training rounds, mosaic enhancement, optimizer type, and patience parameter; among them, the user needs to use a graphics card type that supports CUDA acceleration.
[0029] S74, training until the network model converges, using the validation set for validation during the training process, saving the weight file obtained for each training round and the most weighted file of the trained argument; S8. Test the recognition performance of the YOLO-ADM network model using the test set; The specific operations of step S8 are as follows: S81, load the trained optimal network model weight file obtained in S7, input the test set into the trained YOLO-ADM network model, extract features by adding the backbone network of DAttention, and integrate the neck network of SSFF and TFE modules to achieve the fusion of deep and shallow features, and obtain all the prediction results of the network belonging to the two feature layers; S82, obtaining the coordinates, confidence and category probabilities of all prediction boxes that may contain limestone blocks by setting the confidence threshold; and then removing redundant prediction boxes by non-maximum suppression processing to obtain the final detection result; Fig. 9 This is the limestone block recognition effect of the improved YOLO-ADM network model in a normal environment; Fig.10 The improved YOLO-ADM network model shows the recognition effect of limestone blocks in dusty environment. Fig.11 The improved YOLO-ADM network model is used to identify limestone blocks in other crushing openings. S9. According to the real box position of the test set and the prediction results obtained by the model, the average precise mean mAP, accuracy, and recall rate of the model are calculated to systematically evaluate the model. Fig.12 As shown in the figure, compared with the YOLOv8 model, the mAP0.5 of YOLO-ADM increased by 1.13% to 84.17%; the mAP0.5:0.95 increased by 1.49%; and the accuracy increased by 1.59%.
[0030] S10, after pixel-level processing of the limestone object recognition frame predicted by the YOLO-ADM model, the size of each limestone particle is obtained; The specific operations of step S9 are as follows: S91, according to Fig.13 As shown, the predicted frame coordinates obtained in S8 can be combined with the camera focal length , the straight-line distance between the camera and the raw ore Or the vertical distance between the camera and the raw ore , The camera's shooting angle for the raw ore Parameters such as Convert to actual size ; The specific calculation formula is as follows:
[0031] S92, according to Fig.14 As shown, when calculating the particle size of raw ore, the pixel size in the image That is, the maximum geometric pixel distance of the diagonal coordinates of the identification box of the ore object ,Will Substitute the S91 calculation formula to get the particle size of each raw material ore. The specific calculation formula is as follows: Maximum geometric distance The calculation of is as follows:
[0032] Where: -Geometric pixel distance between diagonal vertices of the ore identification frame; —The pixel coordinates of the upper left corner of the identification box; —The pixel coordinates of the vertex of the lower right corner of the identification box; —The pixel coordinates of the top right corner of the identification box; —The pixel coordinates of the lower left corner of the identification box; Further conversion can give the ore particle size as follows:
[0033] Where: It is the conversion coefficient of raw ore material.
[0034] In summary, the limestone particle size detection method based on YOLO-ADM in the embodiment of the present invention improves the YOLOv8 framework and introduces a deformable attention mechanism module (DAttention) to optimize the backbone network, so that the model can flexibly distort the sampling grid and dynamically adjust the features that need to be paid attention to, so that the model can better identify dense and stacked raw material ore targets; the present invention redesigns a multi-scale feature fusion network based on the SSFF module and the TFE module, and redesigns the YOLOv8 neck network to improve the detection performance of dense and stacked targets; on this basis, the feature layer of larger-sized targets is secondary fused for smaller and Denser ore target detection; Based on the auxiliary bounding box and the metric of minimizing the diagonal distance between the real box and the predicted box, the present invention proposes an improved loss function MIoU to solve the problem of weak generalization ability of the CIoU loss function in the original YOLOv8 network, and proposes an algorithm for generating auxiliary bounding boxes based on scale factors and directly minimizing the diagonal vertex distance between the predicted box and the real box, so as to more accurately reflect the similarity between the real box and the predicted box, and improve the convergence speed of the bounding box regression, thereby improving the detection performance of the model, so that the detection results can be better applied to the crushing control process, which has important theoretical and practical significance and promotion value for the application of complex industrial problems.
[0035] On the other hand, the present invention further discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the above method.
[0036] On the other hand, the present invention further discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.
[0037] In another embodiment provided in the present application, a computer program product including instructions is also provided. When the computer program product is executed on a computer, the computer executes any one of the limestone particle size detection methods based on YOLO-ADM in the above embodiments.
[0038] It is understandable that the system, device and storage medium provided in the embodiments of the present invention correspond to the method provided in the embodiments of the present invention, and the explanation, examples and beneficial effects of the relevant contents can refer to the corresponding parts in the above methods.
[0039] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0040] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0041] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0042] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A limestone particle size detection method based on YOLO-ADM, characterized in that: The following steps are included: S1, dataset of collected stones; During the whole day, pictures of limestone blocks under different lighting conditions are collected for different limestone discharge ports to create a limestone block dataset of the initial sample; S2, divide the limestone block data set obtained in S1 into a training set, a validation set, and a test set according to a ratio of 7:2:1; S3, performing data enhancement operation on the training set samples in S2, expanding the samples to three times of the original size, wherein the data enhancement operation includes rotation, random cropping, and blurring, wherein the rotation includes 90° clockwise rotation, 90° counterclockwise rotation, and inversion, and the blurring is Gaussian blurring with a blurring radius of 3px; S4, integrating the deformable attention mechanism DAttention into the YOLOV8 backbone network; S5, integrate the multi-scale sequence feature fusion module SSFF and the triple feature decoding module TFE into the YOLOv8 neck network, and add them to S4 to obtain the YOLO-ADM network model; S6. Generate auxiliary bounding boxes based on the scale factor and design a new YOLO-ADM model loss function MioU by minimizing the diagonal distance between the limestone prediction box and the true box. Replace the IoU part in the MPDIoU calculation formula with Inner-IoU to construct a new loss function MioU. S7, train the YOLO-ADM network model through the training set and verify the YOLO-ADM model through the verification set during the training process; S8. Test the recognition performance of the YOLO-ADM network model using the test set; S9. After pixel-level processing of the limestone object recognition frame predicted by the trained YOLO-ADM model, the size of each limestone particle is obtained.
2. The limestone particle size detection method based on YOLO-ADM according to claim 1, characterized in that: Step S1 specifically includes: S11, taking pictures of the limestone raw materials in real time according to the high-definition cameras installed at each limestone discharge port; S12, screening the limestone pictures obtained in step S11, selecting pictures under different lighting, different discharge ports, and different time periods, averaging the screened limestone data pictures in terms of categories, and eliminating pictures due to blur; S13, annotating the screened limestone images, framing the target area where the limestone blocks of a set size are located, that is, the position of the real frame, and then using the annotated limestone images as the initial sample data set.
3. The limestone particle size detection method based on YOLO-ADM according to claim 1, characterized in that: The specific operation of step S4 is as follows: S41, obtain the query amount by using the deformable attention mechanism DAttention to obtain the dot product weight matrix of the elements in the input image, and then dynamically move the key K and the value V to the set position according to a set of offsets based on the offset network; the offset network uses GELU (Gaussian Error Linear Unit) as a nonlinear activation function; S42, based on the C2f module in the existing YOLOV8 backbone network, the input features are firstly subjected to convolution and split operations and are divided into two parts; one part is input to The output of each residual module leads to a branch for subsequent splicing operation, and the other part after the split operation is directly spliced with the output branches of these residual modules; finally, feature extraction is completed through convolution operation, and the deformable attention module DAttention is inserted into the convolution module, and then the other part after the split operation is directly spliced with the output branches of these residual modules to obtain a new C2f-DAttention module; S43, replace the C2f module on the upper layer of the multi-scale sequence feature fusion module SPPF module of the backbone network with the C2f-DAttention module obtained in S42.
4. The limestone particle size detection method based on YOLO-ADM according to claim 1, characterized in that: The specific operations of step S5 are as follows: S51. In the existing YOLOV8 network structure, the backbone network CSPDarkNet53 contains three effective branches P3, P4, and P5. These three effective branches are used as the multi-scale sequence feature fusion module SSFF, as follows: The SSFF module is designed based on the P3 feature map. First, the size of P4, P5 to P3 is adjusted through 1×1 convolution and nearest neighbor interpolation. Then, the dimension of each feature layer is increased from a three-dimensional tensor to a four-dimensional tensor using the unsqueeze method. Finally, they are stacked together and input into the 3D convolution channel to realize the combination of multi-scale features. S52, P3, P4 layers in the backbone network CSPDarkNet53 are convolved to obtain large-size feature maps and medium-size feature maps. The multi-scale sequence feature fusion module SPPF layer is convolved to obtain a small-size feature map. The large, medium, and small-size feature maps are input into the TFE module for feature fusion, as follows: The triple feature decoding module TFE first performs convolution processing on the large-size feature map, and then uses a hybrid structure of maximum pooling and average pooling for down-sampling; for the small-size feature map, the convolution module is used to adjust the number of channels, and then the nearest neighbor interpolation method is used for up-sampling. Finally, the three large, medium, and small-size feature maps of the same size are convolved once and concatenated in the channel dimension. The calculation formula is as follows: Among them, FTEE represents the feature map output by the triple feature decoding module TFE, F1, Fm, Fs represent the feature maps of large, medium and small sizes respectively, and FTEE is obtained by concatenating F1, Fm, Fs; FTEE has the same resolution as Fm, and the number of channels is three times that of Fm.
5. The limestone particle size detection method based on YOLO-ADM according to claim 1, characterized in that: The specific operations of step S7 are as follows: S71. Prepare three folders train, valid and test according to the YOLO format to store the training set, validation set and test set respectively. Each folder contains two folders images and labels. The images folder stores the limestone image data, and the labels folder stores the label files of the corresponding images. S72. Configure network selection, select Windows system and pytorch framework for training; S73, setting network model parameters, according to the computer video memory and memory size, setting the YOLO-ADM network model input image size, recognition quantity and name, pre-training weight file, number of training rounds, closing mosaic enhancement argument, optimizer type, and patience parameter; S74. Train until the network model converges. Use the validation set for validation during the training process. Save the weight file obtained from each training round and the most weighted file of the trained model.
6. The limestone particle size detection method based on YOLO-ADM according to claim 1, characterized in that: The specific operations of step S8 are as follows: S81, load the trained optimal network model weight file obtained in S7, input the test set into the trained YOLO-ADM network model, extract features through the backbone network with DAttention, and fuse the neck network of the multi-scale sequence feature fusion module SSFF and the triple feature decoding module TFE to achieve the fusion of deep and shallow features, and obtain all the prediction results of the network belonging to the two feature layers; S82, obtaining the coordinates, confidence and category probabilities of all prediction boxes that may contain limestone blocks by setting the confidence threshold; and then removing redundant prediction boxes by non-maximum suppression processing to obtain the final detection result.
7. The limestone particle size detection method based on YOLO-ADM according to claim 1, characterized in that: The specific operations of step S9 are as follows: S91, combining the prediction frame coordinates obtained in S8 with the camera focal length, the straight-line distance between the camera and the ore, and the shooting angle to obtain the particle size of the limestone block corresponding to each prediction frame; S92. Obtain the particle size level of each stone according to the set classification threshold.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the computer program is executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Grain composition rapid detection method based on YOLO-V4
CN114022474A
Image segmentation method for low-granularity ore
CN117853498A
Remote sensing image target detection method based on multi-scale feature extraction
CN118230180A
Small target detection method for images acquired by unmanned aerial vehicle based on improved YOLOv8 algorithm
CN118628939A
Cited By
Face target detection method based on improved YOLOv8
CN120088835A
Face target detection method based on improved YOLOv8
CN120088835B