Improved YOLOv5-based spodumene sorting method and system
Through the improved YOLOv5 model, the problem of detection of small and medium-sized targets of spodumene recognition is solved, and the accurate identification and positioning of spodumene images is achieved, and the accuracy and efficiency of spodumene sorting are improved.
Patent Information
- Application Number
- CN202411276751.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2024-12-31
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing spodumene identification methods, the X-ray imaging resolution is not sufficient to accurately locate tiny spodumene fragments, and it is difficult to classify spodumene with different colors and irregular contours in light sources, resulting in low recognition accuracy and inefficiency.
Using the improved YOLOv5 model, including the backbone feature extraction network, the improved neck network and the back head network, through image data training and preprocessing, a bounding box with categories and confidence is generated for controlling the high-pressure air gun for lithium glaze. Sorting of stones.
The multi-scale object detection performance of spodumene is improved, and the accurate identification and positioning of small and medium-sized targets of spodumene images is achieved, and the accuracy and efficiency of spodumene sorting are improved.
Smart Images

Figure CN119229187A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of deep learning and machine learning, and in particular to a spodumene sorting method and system based on improved YOLOv5. Background Art
[0002] Spodumene is one of the important minerals for lithium extraction. How to accurately identify spodumene in the crushed raw materials after using a spodumene crusher to crush the spodumene frame is a very critical step. At present, in the processing of spodumene, the target recognition method is usually used for spodumene identification, specifically using X-rays to locate the crushed spodumene. This method has the following disadvantages:
[0003] (1) The resolution of X-ray imaging is insufficient to accurately locate tiny spodumene fragments and features;
[0004] (2) The different shades of color and irregular outlines displayed by spodumene light source scanning make it difficult to classify.
[0005] In the field of deep learning, the model's ability to detect small targets has always been a challenge, because small targets occupy fewer pixels in the image and have relatively scarce feature information, which makes it difficult for the model to identify and locate these small targets. Summary of the invention
[0006] In order to more accurately locate the crushed spodumene in the raw material and improve the accuracy and efficiency of spodumene sorting, the present invention application proposes a spodumene sorting method and system based on improved YOLOv5, which can solve the problem of insensitivity to small targets in spodumene image target detection, and can adapt to target frames of different sizes to improve the performance in multi-scale target detection tasks.
[0007] On the one hand, the present invention provides a spodumene sorting method based on improved YOLOv5, comprising the following steps:
[0008] S1. Build a spodumene sorting model. The spodumene sorting model is specifically an improved YOLOv5 model, including a backbone feature extraction network, an improved neck network and an improved head network connected in sequence. The backbone feature extraction network is used to extract feature information from the input image and process it, and output a feature map. The improved neck network receives the feature map and performs feature enhancement processing to obtain an enhanced feature map. The improved head network receives the enhanced feature map and processes it to obtain a bounding box image with confidence and category.
[0009] S2, collecting image data related to spodumene and constructing a data set, dividing the data set into a training set and a validation set, using the training set to train the spodumene sorting model, and calculating the loss through a preset loss function to obtain the trained spodumene sorting model, evaluating the trained spodumene sorting model through the validation set, optimizing the trained spodumene sorting model according to the evaluation result, and obtaining the optimized spodumene sorting model;
[0010] S3, preliminarily crushing the spodumene ore by a crusher, vibrating and flattening the crushed spodumene, collecting and preprocessing the image of the spodumene to be detected after the vibration and flattening in real time by an image acquisition module, inputting the preprocessed spodumene image into the optimized spodumene sorting model for processing, and outputting a bounding box image with a category and confidence corresponding to the spodumene image to be detected;
[0011] S4. Convert the bounding box image with the category and confidence into a control signal, and control the solenoid valve through the control signal to start the high-pressure air gun to blow and sort the spodumene that has been vibrated and flattened to obtain sorted lithium ore.
[0012] Preferably, the improved back neck network in S1 includes a first convolutional layer, a first dynamic sampling layer, a first splicing layer, a first cross-stage connection layer, a second convolutional layer, a second dynamic sampling layer, a second splicing layer, a second cross-stage connection layer, a third convolutional layer, a third splicing layer, a third cross-stage connection layer, a fourth convolutional layer, a fourth splicing layer, and a fourth cross-stage connection layer, which are connected in sequence, wherein the first convolutional layer is also connected to the fourth splicing layer, and the second convolutional layer is also connected to the third splicing layer. The first convolutional layer, the first splicing layer, and the second splicing layer of the improved back neck network respectively receive feature maps of different scales output by the backbone feature extraction module, and are processed through convolution, dynamic sampling, and splicing, and output enhanced feature maps of different scales through the second, third, and fourth cross-stage connection layers of the improved back neck network respectively.
[0013] Preferably, the specific working process of the two dynamic sampling layers in the improved neck network is as follows:
[0014] S11, each dynamic sampling layer of the improved neck network receives the feature map M output by the convolutional layer connected to it;
[0015] S12, setting an offset sampling grid O according to the feature map M, and setting a sampling set S according to the original sampling grid and the offset sampling grid O;
[0016] S13, performing sampling operation on the feature map M and the sampling set S through a resampling operation function, and outputting the sampled feature map M';
[0017] S14, output the sampled feature map M' to the concatenated layer connected to it.
[0018] Preferably, the offset sampling grid O in S12 can be specifically expressed as:
[0019] O=0.5sigmoid(linear1(M))·linear2(M)
[0020] Where O is the offset sampling grid, sigmoid represents the logical function that maps the input value to between 0 and 1, linear1(·) and linear2(·) represent the first linear operation and the second linear operation, and M represents the input feature map.
[0021] Preferably, the feature map M' after sampling in S13 can be specifically expressed as:
[0022] M' = grid.sample(M, S)
[0023] Where S=G+O
[0024] Where M' is the feature map after sampling, grid.sample(·) is the resampling operation function, M is the feature map output by the convolutional layer adjacent to the dynamic sampling layer, S represents the sampling set, G is the original sampling grid, and O is the offset sampling grid.
[0025] Preferably, the improved head network in S1 includes an ASFF module and several detection head modules, the ASFF module includes several ASFF layers the same number as the several detection heads, the several ASFF layers are connected to the several detection head modules in a one-to-one correspondence, each ASFF layer receives the enhanced feature maps of different scales output by the improved neck network and uses an adaptive attention mechanism for constant scaling and adaptive fusion, outputs the fused feature map, and inputs the fused feature map into the detection head module corresponding to it.
[0026] Preferably, the fused feature map output by each ASFF layer can be specifically expressed as:
[0027] ASFF_j=α 1j ·X 1→j +α 2j ·X 2→j +…+α ij ·X i→j +…+α nj ·X n→j
[0028] In the formula, α ij represents the weight parameter when the i-th enhanced feature map is mapped to the j-th ASFF layer, X i→j Indicates that the i-th enhanced feature map X i Transform to the feature map X of the jth ASFF layer with preset size j, ASFF_j represents the fused feature map output by the jth ASFF layer, j = 1, 2, ..., m, i = 1, 2, ..., n, m is the total number of ASFF modules, and n is the total number of enhanced feature maps output by the improved neck network.
[0029] Preferably, the loss function preset in S2 includes a positioning loss function, a classification loss function and a confidence loss function, wherein the positioning loss function is specifically:
[0030] SIoU=1-IoU+(Ω+Δ) / 2
[0031] Where SIoU represents the positioning loss, IoU is the ratio of the intersection area to the union area of the predicted box and the true box, Ω is the shape loss, and Δ is the distance loss.
[0032] On the other hand, the present invention provides a spodumene sorting system, which uses the above-mentioned spodumene sorting method based on improved YOLOv5 to sort spodumene, and the sorting system includes an automated sorting device, an image acquisition module, an image preprocessing module, a spodumene sorting model and a computer system, wherein the automated sorting device and the image acquisition module are connected to the computer system respectively, and the image preprocessing module and the spodumene sorting model are connected in sequence and arranged in the computer system, wherein:
[0033] Automated sorting equipment is used to crush and vibrate the spodumene ore;
[0034] The image acquisition module acquires the image of the spodumene after vibration paving in real time and sends it to the computer system;
[0035] The computer system receives the spodumene image and processes it through the image preprocessing module to obtain a preprocessed spodumene image;
[0036] The spodumene sorting model receives and processes the preprocessed spodumene image, outputs a bounding box image with a category and a confidence level, and displays it on a display interface of a computer system;
[0037] The bounding box image with category and confidence is converted into a control signal. The control signal is used to control the solenoid valve of the automated sorting equipment to start a high-pressure air gun to blow and sort the vibrated and flattened spodumene to obtain sorted lithium ore.
[0038] The above-mentioned spodumene sorting method and system based on improved YOLOv5 build a spodumene sorting model, including a backbone feature extraction network, an improved neck network and an improved head network connected in sequence; collect spodumene-related image data and construct a data set, divide the data set into a training set and a verification set, train the spodumene sorting model through the training set, calculate the loss through a preset loss function, evaluate and optimize the trained spodumene sorting model through the verification set, and obtain an optimized spodumene sorting model; preliminarily crush the spodumene ore through a crusher, and vibrate and flatten the crushed spodumene; collect and preprocess the spodumene image to be detected after vibration and flattening in real time through an image acquisition module, input the preprocessed spodumene image into the optimized spodumene sorting model for processing, and output a bounding box image with a category and a confidence level corresponding to the spodumene image to be detected; convert the bounding box image with a category and a confidence level into a control signal, and control the solenoid valve through the control signal to start a high-pressure air gun to blow and sort the spodumene after vibration and flattening, so as to obtain sorted lithium ore. The method and system can intelligently and efficiently detect spodumene images, automatically extract useful information from a large number of spodumene images, and accurately detect the presence of lithium ore therein. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a flow chart of a spodumene sorting method based on improved YOLOv5 in one embodiment of the present invention;
[0040] Figure 2 It is a structural schematic diagram of a spodumene sorting model in one embodiment of the present invention;
[0041] Figure 3 is a schematic diagram of the structure of a cross-stage connection layer in one embodiment of the present invention;
[0042] Figure 4 1 is a schematic diagram of a sampling generator in one embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings.
[0044] In one embodiment, see Figure 1 , a spodumene sorting method based on improved YOLOv5, the method comprising:
[0045] S1. Build a spodumene sorting model. The spodumene sorting model is specifically an improved YOLOv5 model. The improved YOLOv5 model includes a backbone feature extraction network, an improved neck network and an improved head network connected in sequence. The backbone feature extraction module is used to extract the most basic feature information from the input image and process it, and output a feature map. The improved neck network receives the feature map and performs feature enhancement processing to obtain an enhanced feature map. The improved head network receives the enhanced feature map and processes it to obtain a bounding box image with confidence and category corresponding to the input image.
[0046] Specifically, the YOLOv5 model includes a backbone feature extraction network, a neck network and a head network which are connected in sequence. The spodumene sorting model is obtained by making improvements on the YOLOv5 model, mainly by improving the neck network and the head network.
[0047] See also Figure 2 The backbone feature extraction network includes several convolutional layers, several cross-stage connection layers, and improved pyramid pooling layers. After each convolutional layer, the input feature map size is reduced by half and the number of channels is multiplied by 2.
[0048] See also Figure 3 There are three convolutional layers in the cross-stage connection layer, which are divided into two branches. The convolutional layers on the first branch and the second branch each extract half of the features. After the general features extracted by the first branch are processed by the bottleneck layer, the features obtained by the two branches are connected, and then processed once more and output.
[0049] In the improved pyramid pooling layer, the input feature map undergoes three maximum pooling after feature extraction through a convolution layer, and the last two maximum pooling are performed on the basis of the previous one. Finally, the results of these four operations are concatenated and output through a convolution layer.
[0050] The backbone feature extraction network receives and processes the original image of spodumene to be detected, and outputs three feature maps of different scales, namely the first feature map (size is 80*80*256), the second feature map (size is 40*40*512), and the third feature map (size is 20*20*1024).
[0051] Further, see Figure 2, the improved neck network in S1 includes a first convolutional layer, a first dynamic sampling layer, a first splicing layer, a first cross-stage connection layer, a second convolutional layer, a second dynamic sampling layer, a second splicing layer, a second cross-stage connection layer, a third convolutional layer, a third splicing layer, a third cross-stage connection layer, a fourth convolutional layer, a fourth splicing layer, and a fourth cross-stage connection layer, which are connected in sequence, wherein the first convolutional layer is also connected to the fourth splicing layer, and the second convolutional layer is also connected to the third splicing layer. The second splicing layer, the first splicing layer, and the first convolutional layer of the improved neck network respectively receive the first feature map (size is 80*80*256), the second feature map (size is 40*40*512), and the third feature map (size is 20*20*1024) output by the backbone feature extraction module, and through convolution, dynamic sampling, and splicing processing, the first enhanced feature map X is output through the second cross-stage connection layer, the third cross-stage connection layer, and the fourth cross-stage connection layer of the improved neck network. 1 (Size is 80*80*256), the second enhanced feature map X 2 (Size is 40*40*512), the third enhanced feature map X 3 (The size is 40*40*512).
[0052] Specifically, the improved neck network is compared with the original neck network in the YOLOv5 model in that the upsampling layer in the original neck network is replaced with a dynamic sampling layer. By replacing the upsampling layer with a dynamic sampling layer, more information of the image can be retained, the performance and robustness of the YOLOv5 model can be improved, and the improved head network can be helped to make better predictions.
[0053] Furthermore, the specific working process of the two dynamic sampling layers in the improved neck network is as follows:
[0054] S11. Each dynamic sampling layer of the improved neck network receives the feature map M output by the convolutional layer connected to it.
[0055] S12. Set an offset sampling grid O according to the feature map M, and set a sampling set S according to the original sampling grid and the offset sampling grid O.
[0056] The offset sampling grid O in S12 can be specifically expressed as:
[0057] O=0.5sigmoid(linear1(M))·linear2(M)
[0058] Where O is the offset sampling grid, sigmoid represents the logical function that can map the input value to between 0 and 1, linear is the linear relationship function used to describe and process the linear relationship of data, linear1(·) and linear2(·) represent the first linear operation and the second linear operation respectively, M represents the input feature map, that is, the feature map output by the corresponding convolutional layer, and its size is (C1, H1, W1), where C1, H1, and W1 represent the number of channels of the feature map, the number of pixels in the vertical direction of the feature map, and the number of pixels in the horizontal direction of the feature map respectively.
[0059] Specifically, see Figure 4 , the input feature map of the dynamic sampling layer is M(C1, H1, W1), and two linear layer operations are performed on the input feature map M. Two linear layers, linear1(·) and linear2(·), are used, and the number of input and output channels of these two linear layers are C1 and 2gS respectively 2 , used to generate the first offset sampling grid O1(2gS 2 ,H1,W1 and the second offset sampling network O2 (2gS 2 ,H1,W1), after multiplying the first offset sampling network O1 by a static factor of 0.5, the dynamic range value can be mapped to the range of 0 to 0.5, and then multiplying it with the second offset sampling grid O2, and obtaining the third offset sampling grid O3 through the sigmoid function; the third offset sampling grid O3 is reshaped into the final offset sampling grid O through pixel shuffle, and the size of the final offset sampling grid O is (2g, SH1, SW1). The original sampling network G is added to the offset sampling grid O to obtain the sampling set S.
[0060] S13. Perform sampling operation on the feature map M and the sampling set S through the resampling operation function, and output the sampled feature map M'.
[0061] The sampled feature map M' can be specifically expressed as:
[0062] M' = grid.sample(M, S)
[0063] Where S=G+O
[0064] Where M′ is the sampled feature map, with a size of (C3, H3, W3), grid.sample(·) is a resampling operation function, which is used to perform a resampling operation on the input feature map, that is, to resample the input feature map in space to achieve finer pixel-level operations, M is the feature map output by the convolutional layer adjacent to the dynamic sampling layer, S represents the sampling set, with a size of (C2, H2, W2), G is the original sampling grid, and O is the offset sampling grid. The parameter definitions of C2, H2, W2 and C3, H3, W3 can refer to the parameter definitions of C1, H1, W1, and will not be repeated here.
[0065] S14, output the sampled feature map M' to the connection layer connected to it.
[0066] Furthermore, the improved head network in S1 includes an ASFF module and several detection head modules, the ASFF module includes a number of ASFF layers equal to the number of detection heads, the several ASFF layers are connected to the several detection head modules in a one-to-one correspondence, each ASFF layer receives the enhanced feature maps of different scales output by the improved neck network and uses an adaptive attention mechanism for constant scaling and adaptive fusion, outputs the fused feature map, and inputs the fused feature map corresponding to each ASFF layer into the detection head module connected to it.
[0067] Among them, the fused feature map output by each ASFF layer can be specifically expressed as:
[0068] ASFF_j=α 1j ·X 1→j +α 2j ·X 2→j +…+α ij ·X i→j +…+α nj ·X n→j
[0069] In the formula, α ij represents the weight parameter when the i-th enhanced feature map output by the improved neck network is mapped to the j-th ASFF layer, X i→j Represents the i-th enhanced feature map X output by the improved neck network i Transform to the feature map X of the jth ASFF layer with preset size j , ASFF_j represents the fused feature map output by the jth ASFF layer, j = 1, 2, ..., m, i = 1, 2, ..., n, m is the total number of ASFF modules, and n is the total number of enhanced feature maps output by the improved neck network.
[0070] Specifically, compared with the original head network of the YOLOv5 model, the improved head network adds an ASFF (Adaptive Structure Feature Fusion) module at the input of the detection head of the existing head network. The ASFF module is a neural network model for target detection. It is an improvement based on the Faster R-CNN framework, which aims to improve the effect of feature fusion, thereby improving the accuracy and performance of target detection. By integrating the ASFF module into the original head network of the YOLOv5 model, the problem of insensitivity to small targets in spodumene images can be solved in target detection of spodumene images.
[0071] See also Figure 2 There are three detection head modules in the improved head network. Therefore, the ASFF module in the improved head network includes three ASFF layers connected in parallel. The first ASFF layer, the second ASFF layer and the third ASFF layer are connected to the first detection head module, the second detection head module and the third detection head module respectively. The first ASFF layer inputs the first fused feature map to the first detection head module, and after processing, outputs a first bounding box image with a category and a confidence. The second ASFF layer inputs the second fused feature map to the second detection head module, and after processing, outputs a second bounding box image with a category and a confidence. The third ASFF layer inputs the third fused feature map to the third detection head module, and after processing, outputs a third bounding box image with a category and a confidence.
[0072] The key idea of ASFF is to adaptively learn the fusion space weights of each scale feature map, which is divided into two steps: constant scaling and adaptive fusion. Taking the second fused feature map ASFF_2 as an example, the improved neck network outputs the first enhanced feature map X through the second cross-stage connection layer, the third cross-stage connection layer, and the fourth cross-stage connection layer. 1 , the second enhanced feature map X 2 , the third enhanced feature map X 3 , the first enhanced feature map X 1 , the second enhanced feature map X 2 , the third enhanced feature map X 3 The sizes are processed into the second enhanced feature map X preset in the second ASFF layer 2 The size of is multiplied by the weight parameter and added, and the features from different feature extractors, such as the color, outline and multi-scale information of spodumene, are combined into a new feature vector according to certain rules to obtain the second fusion feature map ASFF_2 corresponding to the second ASFF layer. The specific formula is as follows:
[0073] ASFF_2=α 12 ·X 1→2 +α22 ·X 2→2 +α 32 ·X 3→2
[0074] Among them, α 12 , α 22 and α 32 They represent the weight parameters when the first enhanced feature map, the second enhanced feature map and the third enhanced feature map are mapped to the second ASFF layer, respectively, and X 1→2 , X 2→2 and X 3→2 Respectively represent the first enhanced feature map X 1 , the second enhanced feature map X 2 , the second enhanced feature map X 3 The feature maps are respectively converted to the preset size of the second ASFF layer, and the weight parameters are multiplied and added with the enhanced features to obtain the second fused feature map ASFF_2.
[0075] S2. Collect image data related to spodumene and construct a data set, divide the data set into a training set and a validation set, use the training set to train the spodumene sorting model, and calculate the loss through a preset loss function to obtain the trained spodumene sorting model, evaluate the trained spodumene sorting model through the validation set, optimize the trained spodumene sorting model according to the evaluation result, and obtain the optimized spodumene sorting model.
[0076] Specifically, first collect spodumene-related image data, such as pictures containing differences in the amount of spodumene, the amount and type of other minerals, etc., and then preprocess these image data, including image enhancement, normalization, image data annotation and other operations, to improve the training effect of the model. The preprocessed image data is divided into a training set and a validation set, and the training set is used to train the improved YOLOv5 model, and the loss is calculated through a preset loss function. The back propagation algorithm updates the model parameters, including the parameters of the YOLOv5 basic model and the parameters of the ASFF module; the validation set is used to evaluate the trained model, including indicators such as detection accuracy and recall rate, and the model is optimized according to the evaluation results, such as adjusting hyperparameters, improving network structure, etc., thereby obtaining an optimized spodumene sorting model.
[0077] Furthermore, the loss functions preset in S2 include a positioning loss function, a classification loss function, and a confidence loss function, wherein the positioning loss function is specifically:
[0078] SIoU=1-IoU+(Ω+Δ) / 2
[0079] In the formula, SIoU represents the positioning loss, IoU is the ratio of the intersection area to the union area of the predicted box and the real box, Ω is the shape loss, and Δ is the distance loss.
[0080] 1) The calculation formula of distance loss is as follows:
[0081]
[0082] in, and is the x-coordinate of the true bounding box and the predicted bounding box, and b cy is the y coordinate of the real bounding box and the predicted bounding box, c w and c h is the width and height of the minimum external box, Λ is the angle loss, ρ x is the ratio of the width difference between the center point of the real box and the predicted box to the square of the minimum enclosing rectangle width, ρ y It is the ratio of the height difference between the center point of the real box and the predicted box to the square of the height of the minimum circumscribed rectangle, and γ is the coefficient related to the angle loss.
[0083] 2) The calculation formula of shape loss is as follows:
[0084]
[0085] Among them, w and are the widths of the predicted and true bounding boxes, h and is the height of the predicted and true bounding boxes, w w and w h is the relative difference between the width and height of the two bounding boxes, θ represents the exponential weight of the shape loss, and the range of θ is 2 to 6.
[0086] Specifically, the loss function of the YOLOv5 model includes the positioning loss function, the classification loss function and the confidence loss function. The default positioning loss function of the detection head of the YOLOv5 model is CIoU. Based on the default positioning loss function, the SIoU loss function is selected through experiments to calculate the positioning loss of the improved head network. SIoU (Scale-Invariant Intersection over Union Loss) is an improved IoU loss that aims to provide smoother and more robust gradients. It considers the scale and angle information of the bounding box on the basis of calculating IoU to improve the accuracy and robustness of positioning. The improved loss function will be more sensitive to small target boxes, so that it can adapt to target boxes of different sizes to improve the performance of multi-scale target detection tasks.
[0087] S3. The spodumene ore is preliminarily crushed in a crusher, and the crushed spodumene is vibrated and flattened. The image of the spodumene to be detected after the vibration and flattening is collected in real time by the image acquisition module and preprocessed. The preprocessed spodumene image is input into the optimized spodumene sorting model for processing, and a bounding box image with category and confidence corresponding to the spodumene image to be detected is output.
[0088] Specifically, the spodumene ore is initially crushed by a crusher, and the crushed spodumene ore is transported to the corresponding position by a belt conveyor, and then the vibration equipment is started to generate strong vibration force. As the vibration continues, the friction between the ore particles decreases, and the relative positions between the particles are continuously adjusted, finally achieving the effect of flattening and uniform distribution. Then, the image acquisition module is used to collect and preprocess the spodumene image to be detected after vibration flattening in real time, and the optimized spodumene sorting model is applied to the image analysis task of spodumene sorting, and the preprocessed spodumene image is input into the optimized spodumene sorting model for processing. The optimized spodumene sorting model receives the newly input spodumene image to be detected, identifies the spodumene color, contour and other information in the image to be detected, and after processing, outputs the bounding box image with category and confidence corresponding to the spodumene image to be detected, providing auxiliary support for the spodumene sorting process.
[0089] S4. Convert the bounding box image with the category and confidence into a control signal, and control the solenoid valve through the control signal to start the high-pressure air gun to blow and sort the spodumene that has been vibrated and flattened to obtain sorted lithium ore.
[0090] Specifically, in the spodumene sorting process, the airflow size needs to be precisely controlled to ensure the stability and efficiency of the process. As a key component of automated control, the high-pressure solenoid valve converts the bounding box image with categories and confidence levels into a control signal, and controls the magnetic field generated by the solenoid valve through the control signal to control the opening and closing of the valve, thereby achieving precise control of the fluid generated by the high-pressure air gun.
[0091] In one embodiment, a spodumene sorting system is provided, which uses the spodumene sorting method based on the improved YOLOv5 as described above to sort spodumene, and the sorting system includes an automated sorting device, an image acquisition module, an image preprocessing module, a spodumene sorting model and a computer system, wherein the automated sorting device and the image acquisition module are respectively connected to the computer system, and the image preprocessing module is sequentially connected to the spodumene sorting model and is arranged in the computer system, wherein:
[0092] Automated sorting equipment is used to crush and vibrate the spodumene ore;
[0093] The image acquisition module acquires the image of the spodumene after vibration paving in real time and sends it to the computer system;
[0094] The computer system receives the spodumene image and processes it through the image preprocessing module to obtain a preprocessed spodumene image;
[0095] The spodumene sorting model receives and processes the preprocessed spodumene image, outputs a bounding box image with a category and a confidence level, and displays it on a display interface of a computer system;
[0096] The bounding box image with category and confidence is converted into a control signal. The control signal is used to control the solenoid valve of the automated sorting equipment to start a high-pressure air gun to blow and sort the vibrated and flattened spodumene to obtain sorted lithium ore.
[0097] Specifically, the automated sorting equipment includes a crusher, a vibration device, a solenoid valve, a high-pressure air gun and a conveyor belt connected in sequence, wherein the crusher and the vibration device are connected through the conveyor belt, the image acquisition module (such as a camera) and the high-pressure air gun are arranged in sequence behind the vibration device and located beside the conveyor belt, the solenoid valve is a key component of automated control, and is used to control the start and stop of the high-pressure air gun and the size of the airflow, the automated sorting equipment is connected to a computer system, and the computer system is provided with an image preprocessing module and a spodumene sorting model, the camera collects the image of the spodumene to be detected after vibration flattening in real time and sends it to the computer system, the computer system receives the image of the spodumene to be detected and processes it through the image preprocessing module, the spodumene sorting model receives the preprocessed spodumene image and processes it, outputs a boundary box image with a category and a confidence level and displays it on a display interface of the computer system; the boundary box image with a category and a confidence level is converted into a control signal, and the solenoid valve of the automated sorting equipment is controlled by the control signal to start the high-pressure air gun to blow and sort the spodumene after vibration flattening, so as to obtain sorted lithium ore.
[0098] For the specific definition of a spodumene sorting system, please refer to the definition of a spodumene sorting method based on improved YOLOv5 in the above text, which will not be repeated here.
[0099] The above-mentioned spodumene sorting method and system based on improved YOLOv5 build a spodumene sorting model, including a backbone feature extraction network, an improved neck network and an improved head network connected in sequence; collect spodumene-related image data and construct a data set, divide the data set into a training set and a verification set, train the spodumene sorting model through the training set, calculate the loss through a preset loss function, evaluate and optimize the trained spodumene sorting model through the verification set, and obtain an optimized spodumene sorting model; preliminarily crush the spodumene ore through a crusher, and vibrate and flatten the crushed spodumene; collect and preprocess the spodumene image to be detected after vibration and flattening in real time through an image acquisition module, input the preprocessed spodumene image into the optimized spodumene sorting model for processing, and output a bounding box image with a category and a confidence level corresponding to the spodumene image to be detected; convert the bounding box image with a category and a confidence level into a control signal, and control the solenoid valve through the control signal to start a high-pressure air gun to blow and sort the spodumene after vibration and flattening, so as to obtain sorted lithium ore. The method and system can intelligently and efficiently detect spodumene images, automatically extract useful information from a large number of spodumene images, and accurately detect samples containing lithium ore.
[0100] The above is a detailed introduction to a spodumene sorting method and system based on improved YOLOv5 provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the core idea of the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A spodumene sorting method based on improved YOLOv5, characterized in that: The method comprises: S1. Build a spodumene sorting model. The spodumene sorting model is specifically an improved YOLOv5 model, including a backbone feature extraction network, an improved neck network and an improved head network connected in sequence. The backbone feature extraction network is used to extract feature information from the input image and process it, and output a feature map. The improved neck network receives the feature map and performs feature enhancement processing to obtain an enhanced feature map. The improved head network receives the enhanced feature map and processes it to obtain a bounding box image with confidence and category. S2, collecting image data related to spodumene and constructing a data set, dividing the data set into a training set and a validation set, using the training set to train the spodumene sorting model, and calculating the loss through a preset loss function to obtain the trained spodumene sorting model, evaluating the trained spodumene sorting model through the validation set, optimizing the trained spodumene sorting model according to the evaluation result, and obtaining the optimized spodumene sorting model; S3, preliminarily crushing the spodumene ore by a crusher, vibrating and flattening the crushed spodumene, collecting and preprocessing the image of the spodumene to be detected after the vibration and flattening in real time by an image acquisition module, inputting the preprocessed spodumene image into the optimized spodumene sorting model for processing, and outputting a bounding box image with a category and confidence corresponding to the spodumene image to be detected; S4. Convert the bounding box image with the category and confidence into a control signal, and control the solenoid valve through the control signal to start the high-pressure air gun to blow and sort the spodumene that has been vibrated and flattened to obtain sorted lithium ore.
2. The spodumene sorting method based on improved YOLOv5 as claimed in claim 1, characterized in that, The improved back neck network in S1 includes a first convolutional layer, a first dynamic sampling layer, a first splicing layer, a first cross-stage connection layer, a second convolutional layer, a second dynamic sampling layer, a second splicing layer, a second cross-stage connection layer, a third convolutional layer, a third splicing layer, a third cross-stage connection layer, a fourth convolutional layer, a fourth splicing layer, and a fourth cross-stage connection layer, which are connected in sequence. Among them, the first convolutional layer is also connected to the fourth splicing layer, and the second convolutional layer is also connected to the third splicing layer. The first convolutional layer, the first splicing layer, and the second splicing layer of the improved back neck network respectively receive feature maps of different scales output by the backbone feature extraction module, and are processed through convolution, dynamic sampling, and splicing, and output enhanced feature maps of different scales through the second, third, and fourth cross-stage connection layers of the improved back neck network respectively.
3. The spodumene sorting method based on improved YOLOv5 as claimed in claim 2, characterized in that, The specific working process of the two dynamic sampling layers in the improved neck network is as follows: S11, each dynamic sampling layer of the improved neck network receives the feature map M output by the convolutional layer connected to it; S12, setting an offset sampling grid O according to the feature map M, and setting a sampling set S according to the original sampling grid and the offset sampling grid O; S13, performing sampling operation on the feature map M and the sampling set S through a resampling operation function, and outputting the sampled feature map M'; S14, output the sampled feature map M' to the concatenated layer connected to it.
4. The spodumene sorting method based on improved YOLOv5 as claimed in claim 3, characterized in that: The offset sampling grid O in S12 can be specifically expressed as: O=0.5sigmoid(linear1(M))·linear2(M) Where O is the offset sampling grid, sigmoid represents the logical function that maps the input value to between 0 and 1, linear1(·) and linear2(·) represent the first linear operation and the second linear operation, and M represents the input feature map.
5. The spodumene sorting method based on improved YOLOv5 as claimed in claim 4, characterized in that: The feature map M' after sampling in S13 can be specifically expressed as: M' = grid.sample(M, S) Where S=G+O Where M' is the feature map after sampling, grid.samole(·) is the resampling operation function, M is the feature map output by the convolutional layer adjacent to the dynamic sampling layer, S represents the sampling set, G is the original sampling grid, and O is the offset sampling grid.
6. The spodumene sorting method based on improved YOLOv5 as claimed in claim 2, characterized in that: The improved head network in S1 includes an ASFF module and several detection head modules. The ASFF module includes several ASFF layers with the same number as the detection heads. The several ASFF layers are connected to the detection head modules one by one. Each ASFF layer receives the enhanced feature maps of different scales output by the improved neck network and uses an adaptive attention mechanism for constant scaling and adaptive fusion, outputs the fused feature map, and inputs the fused feature map into the detection head module connected to it.
7. The spodumene sorting method based on improved YOLOv5 as claimed in claim 6, characterized in that: The fused feature map output by each ASFF layer can be specifically expressed as: ASFF_j=a 1j ·X 1→j +a 2j ·X 2→j +…+a ij ·X i→j +…+a nj ·X n→j In the formula, α ij represents the weight parameter when the i-th enhanced feature map is mapped to the j-th ASFF layer, X i→j Indicates that the i-th enhanced feature map X i Transform to the feature map X of the preset size of the j-th ASFF layer j , ASFF_j represents the fused feature map output by the jth ASFF layer, j = 1, 2, ..., m, i = 1, 2, ..., n, m is the total number of ASFF modules, and n is the total number of enhanced feature maps output by the improved neck network.
8. The spodumene sorting method based on improved YOLOv5 as claimed in claim 7, characterized in that: The loss functions preset in S2 include positioning loss function, classification loss function and confidence loss function, among which the positioning loss function is specifically: SIoU=1-IoU+(Ω+Δ) / 2 Where SIoU represents the positioning loss, IoU is the ratio of the intersection area to the union area of the predicted box and the true box, Ω is the shape loss, and Δ is the distance loss.
9. A spodumene sorting system, which uses the spodumene sorting method based on improved YOLOv5 as described in any one of claims 1 to 8 to sort spodumene, characterized in that: The sorting system comprises an automated sorting device, an image acquisition module, an image preprocessing module, a spodumene sorting model and a computer system, wherein the automated sorting device and the image acquisition module are connected to the computer system respectively, and the image preprocessing module is connected to the spodumene sorting model in sequence and arranged in the computer system, wherein: Automated sorting equipment is used to crush and vibrate the spodumene ore; The image acquisition module acquires the image of the spodumene after vibration paving in real time and sends it to the computer system; The computer system receives the spodumene image and processes it through the image preprocessing module to obtain a preprocessed spodumene image; The spodumene sorting model receives and processes the preprocessed spodumene image, outputs a bounding box image with a category and a confidence level, and displays it on a display interface of a computer system; The bounding box image with category and confidence is converted into a control signal. The control signal is used to control the solenoid valve of the automated sorting equipment to start a high-pressure air gun to blow and sort the vibrated and flattened spodumene to obtain sorted lithium ore.
Citation Information
Patent Citations
Pedestrian detection method and system based on MPDNet model
CN115410160A
Intelligent ore sorting equipment and method based on visible light and X-ray image fusion
CN117299581A
Strip steel surface defect detection method based on improved Yolov5s network
CN117350948A
