Ore sample classification method and device and storage medium
By fusing the image features of ore with text features and using the XGBoost model, the problems of low ore classification accuracy and environmental pollution in the existing technology are solved, and high accuracy classification under multi-dimensional conditions are achieved, and the efficiency of ore classification is improved. and environmentally friendly.
Patent Information
- Application Number
- CN202411064301.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-11-26
AI Technical Summary
The existing ore classification methods have problems such as low recognition accuracy, large land space, high investment costs and serious environmental pollution. Especially when dealing with complex and changeable coal gangue components, it is difficult to accurately classify them. Image recognition technology faces coal surface pollution. Or the effect is not good when the particles are small.
By fusing the image features of the ore to be tested with the text features, combining the appearance and material characteristics, the pre-trained XGBoost ore recognition classification model is used to perform gangue under multi-dimensional factors such as texture, color, quality and size. Classification of coal.
It significantly improves the accuracy of ore sample classification, realizes accurate classification under complex conditions, improves identification accuracy, and reduces resource consumption and environmental impact.
Smart Images

Figure CN119026029A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of ore classification, and in particular to a method for classifying ore samples, a device for classifying ore samples, and a computer-readable storage medium. Background Art
[0002] At present, my country relies on coal as an important industrial raw material and main energy source, and the use of coal has a very important impact in my country. With the continuous growth of coal resource mining in my country in recent years, a large amount of ore has been generated. In order to effectively deal with these accumulated ores, it is particularly important to identify and distinguish useful coal from useless gangue. However, the main methods currently used for ore classification include artificial gangue, jigging coal preparation, flotation coal preparation, selective crushing, heavy medium coal preparation, and ray detection identification coal preparation, which have many problems. These traditional methods generally face challenges such as low recognition accuracy, large space occupation, high investment cost, and serious environmental pollution, and cannot effectively cope with the complex and changeable coal gangue components. In addition, the existing ore classification methods based on image recognition often face the problem of insufficient accuracy in practical applications. This method is affected by the texture, color, quality and size of coal gangue, resulting in the difficulty of recognition accuracy to meet actual needs. In addition, image recognition technology is often difficult to achieve satisfactory classification results when dealing with coal surface pollution or fine particles, which limits its widespread adoption in practical industrial applications.
[0003] In order to overcome the above-mentioned defects of the prior art, the art urgently needs an improved ore sample classification method for accurately classifying gangue and coal while considering multi-dimensional factors such as ore texture, color, quality and size, so as to improve the accuracy of ore sample classification. Summary of the invention
[0004] A brief summary of one or more aspects is given below to provide a basic understanding of these aspects. This summary is not an exhaustive overview of all conceived aspects, and is neither intended to identify the key or decisive elements of all aspects nor to define the scope of any or all aspects. Its only purpose is to give some concepts of one or more aspects in a simplified form as a prelude to a more detailed description that will be given later.
[0005] In order to overcome the above-mentioned defects of the prior art, the present invention provides a method for classifying ore samples, a device for classifying ore samples and a computer-readable storage medium, which can fuse the image features and text features of the ore to be tested, combined with the appearance morphology and material properties of the ore to be tested, to accurately classify gangue and coal while considering multi-dimensional factors such as ore texture, color, quality and size, so as to improve the accuracy of ore sample classification.
[0006] Specifically, the above-mentioned ore sample classification method provided according to the first aspect of the present invention comprises the following steps: obtaining an image to be classified of the ore to be tested and a corresponding first text feature. The image to be classified describes the appearance of the ore to be tested. The first text feature describes the material properties of the ore to be tested; extracting the corresponding first image feature according to the pixel points of the image to be classified; fusing the first image feature and the first text feature to obtain a first fused feature; and inputting the first fused feature into a pre-trained XGB oo st ore identification and classification model to determine the category of the ore to be tested.
[0007] Furthermore, in some embodiments of the present invention, before extracting the first image feature of the image to be classified based on the pixel points of the image to be classified, the following steps are also included: performing median filtering on the image to be classified to remove impulse noise in the image to be classified.
[0008] Further, in some embodiments of the present invention, the ore to be tested is selected from coal or gangue. The step of extracting the first image feature of the image to be classified according to the pixel points of the image to be classified includes: extracting the first texture feature of the image to be classified according to the pixel points of the image to be classified; calculating the color moment and the first principal component of the image to be classified to extract the first color feature of the image to be classified; and splicing the first texture feature with the first color feature to extract the first image feature of the image to be classified.
[0009] Further, in some embodiments of the present invention, the step of extracting the first texture feature of the image to be classified according to the pixel points of the image to be classified includes: traversing the pixel points of the image to be classified to calculate the gray level co-occurrence matrix of the image to be classified:
[0010] P(i,j|d,θ)={(x,y)|f(x,y)=i,f(x+dx,y+dy)=j;x,y=0,1,2,...,N-1}
[0011] i, j = 0, 1, 2, ..., L-1
[0012] Wherein, d is the relative distance between the currently traversed pixel pairs, θ is the direction angle, (x, y) is the pixel point in the image to be classified, N is the number of pixel points in the image to be classified, and L is the number of gray levels of the image to be classified; and the secondary statistics of the gray level co-occurrence matrix are calculated to extract the first texture feature of the image to be classified. The secondary statistics include second-order moment, entropy and contrast.
[0013] Furthermore, in some embodiments of the present invention, the step of calculating the color moment of the image to be classified includes:
[0014] The first-order moment, the second-order moment and the third-order moment of the image to be classified are calculated respectively.
[0015] The first-order moment of the image to be classified is:
[0016]
[0017] The second-order moment of the image to be classified is:
[0018]
[0019] The third-order moment of the image to be classified is:
[0020]
[0021] Where i is the color channel. N is the number of pixels in the image to be classified. i,j is the pixel value of the j-th pixel in the image to be classified on the i-th color channel.
[0022] Furthermore, in some embodiments of the present invention, the step of calculating the first principal component of the image to be classified includes: obtaining a gray value matrix of the image to be classified, and performing zero mean processing on the gray value matrix:
[0023]
[0024] Among them, x ij is an element in the gray value matrix; according to the gray value matrix, the covariance matrix S of the image to be classified is calculated T , and calculate the covariance matrix S T The eigenvalue λ i and the corresponding normalized orthogonal eigenvector a i ; and the eigenvalue λ i Sort from large to small and select the eigenvalue λ i The normalized orthogonal eigenvector corresponding to the maximum eigenvalue in is taken as the first principal component of the image to be classified.
[0025] Furthermore, in some embodiments of the present invention, the step of obtaining the image to be classified of the ore to be tested and the corresponding first text feature includes: taking a photo of the ore to be tested to obtain the image to be classified; weighing the ore to be tested to obtain the mass of the ore to be tested; measuring the ore to be tested to obtain the size of the ore to be tested; and converting the mass and / or size of the ore to be tested into the first text feature.
[0026] Furthermore, in some embodiments of the present invention, the step of training the XGBoost ore identification and classification model includes: obtaining an ore image sample data set, wherein the ore image sample data set includes image samples of coal or gangue and corresponding second text features; constructing an XGBoost ore identification and classification model to be trained; and training the XGBoost ore identification and classification model according to the ore image sample data set.
[0027] Further, in some embodiments of the present invention, the step of constructing the XGBoost ore identification and classification model to be trained includes: constructing an objective function of the XGBoost ore identification and classification model:
[0028]
[0029] Wherein, t is the t-th learner in the XGBoost ore identification and classification model. i is the true value of the i-th image sample. t-1 (x i ) is the test value of the i-th image sample determined by the first t-1 learners. t (x i ) is the test value determined by the t-th learner for the i-th image sample, and J is the number of nodes in the XGBoost ore recognition and classification model. t,j is the output value of the image sample at the Jth node; and calculates the first-order derivative and the second-order derivative of the image sample in the tth learner, and optimizes the objective function:
[0030]
[0031] Among them, g ti is the first-order derivative of the i-th image sample in the t-th learner. ti is the second-order derivative of the i-th image sample in the t-th learner.
[0032] Further, in some embodiments of the present invention, the step of training the XGBoost ore identification and classification model based on the ore image sample data set includes: preprocessing the image sample, and extracting the second image feature of the image sample based on the pixel points of the image sample; fusing the second image feature and the second text feature of the image sample to obtain a second fused feature; dividing the second fused feature into a training set and a test set; training the XGBoost ore identification and classification model using the training set, and testing the XGBoost ore identification and classification model using the test set to determine the model loss value of the XGBoost ore identification and classification model; in response to the model loss value being greater than a preset loss threshold, redefining the hyperparameters of the XGBoost ore identification and classification model, and re-training the XGBoost ore identification and classification model based on the redefined hyperparameters; and in response to the model loss value being less than or equal to the loss threshold, determining that the training of the XGBoost ore identification and classification model is completed.
[0033] Furthermore, in some embodiments of the present invention, the following steps are also included: calculating the proportion of correctly classified image samples to the total number of image samples:
[0034]
[0035] Where TP is the number of image samples predicted to be positive and actually positive. TN is the number of image samples predicted to be negative and actually negative. FP is the number of image samples predicted to be positive and actually negative. FN is the number of image samples predicted to be negative and actually positive.
[0036] In addition, the above-mentioned ore sample classification device provided according to the second aspect of the present invention includes a memory and a processor. The memory stores computer instructions. The processor is connected to the memory and is configured to execute the computer instructions stored thereon to implement the ore sample classification method provided by the first aspect of the present invention.
[0037] In addition, the computer-readable storage medium provided according to the third aspect of the present invention stores computer instructions, which, when executed by a processor, implement the method for classifying ore samples provided in the first aspect of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The above features and advantages of the present invention can be better understood after reading the detailed description of the embodiments of the present disclosure in conjunction with the following drawings. In the drawings, the components are not necessarily drawn to scale, and components with similar related properties or features may have the same or similar reference numerals.
[0039] Figure 1 A schematic flow chart of a method for classifying ore samples according to some embodiments of the present invention is shown.
[0040] Figure 2 A schematic diagram of a process for extracting features of an ore to be tested according to some embodiments of the present invention is shown.
[0041] Figure 3 A schematic diagram showing the principle of feature fusion of a first image feature and a first text feature provided according to some embodiments of the present invention is shown.
[0042] Figure 4 A diagram showing classification results of an XGBoost classification model based on image features provided according to some embodiments of the present invention.
[0043] Figure 5 A diagram showing classification results of an XGBoost classification model based on image and text fusion features provided according to some embodiments of the present invention. DETAILED DESCRIPTION
[0044] The following specific embodiments illustrate the implementation of the present invention, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Although the description of the present invention will be introduced in conjunction with the preferred embodiment, this does not mean that the features of this invention are limited to this implementation. On the contrary, the purpose of introducing the invention in conjunction with the implementation is to cover other options or modifications that may be extended based on the claims of the present invention. In order to provide a deep understanding of the present invention, the following description will include many specific details. The present invention can also be implemented without using these details. In addition, in order to avoid confusion or blurring the focus of the present invention, some specific details will be omitted in the description.
[0045] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0046] In addition, the terms "upper", "lower", "left", "right", "top", "bottom", "horizontal" and "vertical" used in the following description should be understood as the directions shown in the paragraph and the related drawings. Such relative terms are only used for the convenience of description and do not mean that the device described therein must be manufactured or operated in a specific direction, and therefore should not be understood as limiting the present invention.
[0047] It is understood that although the terms "first", "second", "third", etc. may be used herein to describe various components, regions, layers and / or parts, these components, regions, layers and / or parts should not be limited by these terms, and these terms are only used to distinguish different components, regions, layers and / or parts. Therefore, the first component, region, layer and / or part discussed below may be referred to as a second component, region, layer and / or part without departing from some embodiments of the present invention.
[0048] As mentioned above, the main methods currently used for ore classification include artificial gangue removal, jigging coal preparation, flotation coal preparation, selective crushing, heavy medium coal preparation, and ray detection and identification coal preparation, which have many problems. These traditional methods generally face challenges such as low recognition accuracy, large space occupation, high investment cost, and serious environmental pollution, and cannot effectively cope with the complex and changeable coal gangue components. In addition, the existing ore classification methods based on image recognition often face the problem of insufficient accuracy in practical applications. This method is affected by the texture, color, quality and size of coal gangue, resulting in the difficulty of recognition accuracy to meet actual needs. In addition, image recognition technology often finds it difficult to achieve satisfactory classification results when dealing with coal surface pollution or fine particles, which limits its widespread adoption in practical industrial applications.
[0049] In order to overcome the above-mentioned defects of the prior art, the present invention provides a method for classifying ore samples, a device for classifying ore samples and a computer-readable storage medium, which can fuse the image features and text features of the ore to be tested, combined with the appearance morphology and material properties of the ore to be tested, to accurately classify gangue and coal while considering multi-dimensional factors such as ore texture, color, quality and size, so as to improve the accuracy of ore sample classification.
[0050] In some non-limiting embodiments, the above-mentioned ore sample classification method provided in the first aspect of the present invention can be implemented based on the above-mentioned ore sample classification device provided in the second aspect of the present invention. Specifically, the ore sample classification device can be configured with a memory and a processor. The memory includes but is not limited to the above-mentioned computer-readable storage medium provided in the third aspect of the present invention, on which computer instructions are stored. The processor is connected to the memory and is configured to execute the computer instructions stored on the memory to implement the above-mentioned ore sample classification method provided in the first aspect of the present invention.
[0051] Please refer to Figure 1 and Figure 2 . Figure 1 A schematic flow chart of a method for classifying ore samples according to some embodiments of the present invention is shown. Figure 2A schematic diagram of a process for extracting features of an ore to be tested according to some embodiments of the present invention is shown.
[0052] like Figure 1 and Figure 2 As shown, the processor can obtain the image to be classified of the ore to be tested and the corresponding first text feature. Here, the image to be classified describes the appearance of the ore to be tested, and the first text feature describes the material properties of the ore to be tested.
[0053] Please further refer to Table 1. Table 1 shows a data table of text features provided according to some embodiments of the present invention.
[0054] Table 1: Text features
[0055] variable meaning unit M quality g L length mm W width mm H high mm
[0056] Specifically, the processor may take a photo of the ore to be tested to obtain an image to be classified. Then, as shown in Table 1, the processor may weigh the ore to be tested to obtain the mass of the ore to be tested, and use a measuring sensor to measure the ore to be tested to obtain the size (e.g., length, width, height) of the ore to be tested. Then, the processor may convert the mass and / or size of the ore to be tested into the first text feature.
[0057] In addition, in some embodiments, the processor may also use an ultrasonic volume and weight integrated measuring instrument to measure the volume and mass of the ore to be measured, and convert them into the first text feature.
[0058] In addition, in some preferred embodiments, after obtaining the image to be classified, the processor may also perform image preprocessing on the image to be classified to remove useless background information, thereby improving the efficiency of extracting image features of the image to be classified. Specifically, the processor may use a median filter with a window size of 5×5 to perform median filtering on the obtained image to be classified to remove impulse noise in the image, and crop the image to remove redundant background information, so that only one piece of ore to be tested is retained on the image to be classified.
[0059] In addition, in some preferred embodiments, the processor may also pre-process the first text feature of the ore to be tested to remove data with missing data and data with excessive deviation from other samples, thereby improving the accuracy of extracting the text features of the sample to be tested.
[0060] Afterwards, the processor can extract the corresponding first image features according to the pixel points of the image to be classified. Here, the ore to be tested is selected from coal or gangue.
[0061] Specifically, the processor may first extract the first texture feature of the image to be classified based on the pixel points of the image to be classified. In the process of extracting the first texture feature of the image to be classified, the processor may first traverse the pixel points of the image to be classified to calculate the gray level co-occurrence matrix of the image to be classified:
[0062] P(i,j|d,θ)={(x,y)|f(x,y)=i,f(x+dx,y+dy)=j;x,y=0,1,2,...,N-1}
[0063] i, j = 0, 1, 2, ..., L-1
[0064] Where d is the relative distance between the currently traversed pixel pairs, θ is the direction angle, and four directions of 0°, 45°, 90° and 135° are selected. (x, y) is the pixel point in the image to be classified, N is the number of pixels in the image to be classified, and L is the number of gray levels of the image to be classified. In this way, the processor can obtain the gray level co-occurrence matrix of the image to be classified in four directions.
[0065] Afterwards, since the gray level co-occurrence matrix has a large amount of calculation, the processor can calculate the secondary statistics of the gray level co-occurrence matrix to further extract the first texture feature of the image to be classified, thereby improving the extraction efficiency of the texture feature of the image to be classified. Here, the secondary statistics include Angular Second Moment (ASM), Entropy (ENT) and Contrast (Con).
[0066] Specifically, the processor can calculate the second-order distance ASM, entropy ENT and contrast Con as follows:
[0067]
[0068] Here, the second-order distance ASM is the sum of the squares of the elements in the gray-level co-occurrence matrix, which is used to measure the uniformity of the gray-level distribution and the texture coarseness of the image to be classified. If the elements in the gray-level co-occurrence matrix are similar, the second-order distance ASM is large, indicating that the texture of the image to be classified is fine. If the elements in the gray-level co-occurrence matrix differ greatly, the order distance ASM is large, indicating that the texture of the image to be classified is rough. Entropy ENT is used to measure the randomness of the amount of information contained in the image to be classified. When all values in the gray-level co-occurrence matrix are equal or the pixel values show the greatest randomness, the entropy ENT is large. Therefore, entropy ENT can represent the complexity of the gray-level distribution of the image to be classified. The larger the entropy ENT value, the more complex the image. Contrast Con is used to measure the local changes in the image to be classified to reflect the clarity of the image to be classified and the depth of the grooves of the texture. When the texture of the image to be classified is clearer and the contrast of the pixel value is greater, the contrast Con is greater.
[0069] In this way, the processor can calculate the corresponding quadratic statistics of the gray level co-occurrence matrix of the image to be classified in four directions respectively, so as to obtain a 12-dimensional first texture feature representing the texture characteristics of the image to be classified.
[0070] Thereafter, the processor may calculate the color moment and the first principal component of the image to be classified to extract the first color feature of the image to be classified.
[0071] Specifically, in the process of calculating the color moment of the image to be classified, the processor can respectively calculate the first-order moment, the second-order moment and the third-order moment of the image to be classified to represent the color distribution in the image to be classified. i Used to represent the mean of all pixels on the i-th color channel, the second-order moment σ i Used to represent the standard deviation of all pixels on the i-th color channel, the third-order moment s i Represents the deviation of all pixels on the i-th color channel.
[0072] Here, the first-order moment μ of the image to be classified i for:
[0073]
[0074] Here, the second-order moment σ of the image to be classified i for:
[0075]
[0076] Here, the third-order moment s of the image to be classified is i for:
[0077]
[0078] Among them, i is the color channel, N is the number of pixels in the image to be classified, and P i,j is the pixel value of the jth pixel in the image to be classified on the i-th color channel.
[0079] In this way, the processor can calculate the first-order moment, second-order moment and third-order moment corresponding to each of the three color components R, G and B in the image to be classified to obtain a 9-dimensional component representing the color distribution of the image to be classified.
[0080] In addition, in some preferred embodiments, before calculating the color moment of the image to be classified, the processor may also crop the image to be classified to retain only the central 52×52 pixel size to reduce the influence of surrounding environmental factors, thereby further improving the accuracy of color feature extraction of the image to be classified.
[0081] Furthermore, in the process of calculating the first principal component of the image to be classified, the processor may first obtain the gray value matrix of the image to be classified, and perform zero mean processing on the gray value matrix to eliminate the average brightness offset in the image to be classified, thereby improving the accuracy of extracting the color features of the image to be classified:
[0082]
[0083] Among them, x ij is the element in the gray value matrix.
[0084] Afterwards, the processor can calculate the covariance matrix S of the image to be classified based on the gray value matrix after zero mean processing. T , and the covariance matrix S T Orthogonalize to calculate the covariance matrix S T The eigenvalue λ i and the corresponding normalized orthogonal eigenvector a i .
[0085] Afterwards, the processor can convert the eigenvalue λ i Sort from large to small and select the eigenvalue λ i The normalized orthogonal eigenvector corresponding to the maximum eigenvalue in is taken as the first principal component of the image to be classified.
[0086] In this way, the processor can use principal component analysis (PCA) technology to obtain the first principal components of the three color components R, G, and B of the image to be classified, so as to obtain a three-dimensional component representing the color distribution of the image to be classified, thereby describing the overall color and contrast of the image to be classified.
[0087] Afterwards, the processor can obtain a 12-dimensional first color feature that characterizes the color characteristics of the image to be classified based on the color moment of the 9-dimensional component and the first principal component of the 3-dimensional component. Afterwards, the processor can concatenate the 12-dimensional first texture feature with the 12-dimensional first color feature to obtain a 24-dimensional first image feature of the image to be classified.
[0088] Please refer to Figure 3 . Figure 3 A schematic diagram showing the principle of feature fusion of a first image feature and a first text feature provided according to some embodiments of the present invention is shown.
[0089] like Figure 3 As shown, the processor can fuse the first image feature and the first text feature to obtain a first fused feature, and input the first fused feature into a pre-trained XGBoost ore recognition and classification model to determine the category of the ore to be tested.
[0090] Specifically, in the process of training the XGBoost ore recognition and classification model, the processor may first obtain an ore image sample data set, wherein the ore image sample data set includes image samples of coal or gangue and corresponding second text features.
[0091] Afterwards, the processor can construct the objective function of the XGBoost ore identification classification model to be trained:
[0092]
[0093] Where t is the tth learner in the XGBoost ore recognition classification model, y i is the true value of the i-th image sample, f t-1 (x i ) is the test value of the i-th image sample determined by the first t-1 learners, h t (x i ) is the test value of the i-th image sample determined by the t-th learner, J is the number of nodes in the XGBoost ore recognition classification model, W t,j is the output value of the image sample at the Jth node.
[0094] After that, the processor can calculate the first-order and second-order derivatives of the image sample in the t-th learner and optimize the objective function:
[0095]
[0096] Among them, g ti is the first-order derivative of the i-th image sample in the t-th learner, h ti is the second-order derivative of the i-th image sample in the t-th learner.
[0097] Afterwards, the processor can train the XGBoost ore recognition classification model according to the ore image sample data set. Similarly, the processor can first pre-process the image samples in the ore image sample data set, and extract the second image features of the image samples according to the pixel points of the image samples, and then perform feature fusion on the second image features of the image samples and the second text features to obtain the second fused features.
[0098] Afterwards, the processor may use the second fused features as input features of the XGBoost ore identification and classification model, and select 70% of the second fused features as a training set and the remaining 30% as a test set to divide them into a training set and a test set.
[0099] Afterwards, the processor may train the XGBoost ore identification classification model using the training set, and test the XGBoost ore identification classification model using the test set to determine the model loss value of the XGBoost ore identification classification model. In response to the model loss value being greater than a preset loss threshold, the processor may redefine the hyperparameters of the XGBoost ore identification classification model, and retrain the XGBoost ore identification classification model based on the redefined hyperparameters. In response to the model loss value being less than or equal to the loss threshold, the processor may determine that the training of the XGBoost ore identification classification model is completed.
[0100] Please refer to Figure 4 , Figure 5 And Table 2. Figure 4 A diagram showing classification results of an XGBoost classification model based on image features provided according to some embodiments of the present invention. Figure 5 The diagram shows the classification results of the XGBoost classification model based on image and text fusion features provided according to some embodiments of the present invention. Table 2 shows a comparison table of classification accuracy of several methods provided according to some embodiments of the present invention.
[0101] like Figure 4 and Figure 5 As shown, the processor can calculate the proportion of correctly classified image samples to the total number of image samples:
[0102]
[0103] Among them, TP is the number of image samples predicted to be positive and actually positive, TN is the number of image samples predicted to be negative and actually negative, FP is the number of image samples predicted to be positive and actually negative, and FN is the number of image samples predicted to be negative and actually positive.
[0104] Table 2: Comparison of the accuracy of several methods
[0105]
[0106] As shown in Table 2, in order to further verify the accuracy of the classification method of ore samples provided by the first aspect of the present invention, the accuracy of several common classification methods is compared. Here, the accuracy of the classification method of ore samples provided by the first aspect of the present invention is 96.15%, while the accuracy of the SVM classification model based on image features, the XGBoost classification model based on image features, and the SVM classification model based on image and text fusion features are 57.69%, 88.46%, and 76.92%, which are all lower than the accuracy of the classification method of ore samples provided by the first aspect of the present invention. It can be seen that the classification method of ore samples provided by the first aspect of the present invention has a good detection effect for the type of sample to be tested, and can accurately classify gangue and coal under the condition of considering multi-dimensional factors such as ore texture, color, quality and size.
[0107] In summary, the above-mentioned ore sample classification method, ore sample classification device and computer-readable storage medium provided by the present invention can fuse the image features and text features of the ore to be tested, combined with the appearance morphology and material properties of the ore to be tested, to accurately classify gangue and coal while considering multi-dimensional factors such as ore texture, color, quality and size, so as to improve the accuracy of ore sample classification.
[0108] Although the above methods are illustrated and described as a series of actions for simplicity of explanation, it should be understood and appreciated that these methods are not limited by the order of the actions, because according to one or more embodiments, some actions may occur in a different order and / or concurrently with other actions from those illustrated and described herein or not illustrated and described herein but understandable to those skilled in the art.
[0109] The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be apparent to those skilled in the art, and the general principles defined herein may be applied to other variations without departing from the spirit or scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein, but should be granted the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for classifying ore samples, characterized in that: The following steps are involved: Acquire an image to be classified of the ore to be tested and a corresponding first text feature, wherein the image to be classified describes the appearance of the ore to be tested, and the first text feature describes the material properties of the ore to be tested; Extracting corresponding first image features according to the pixel points of the image to be classified; Fusing the first image feature and the first text feature to obtain a first fused feature; and The first fusion feature is input into a pre-trained XGBoost ore identification and classification model to determine the category of the ore to be tested.
2. The classification method according to claim 1, characterized in that: Before extracting the first image feature of the image to be classified according to the pixel points of the image to be classified, the following steps are also included: Perform median filtering on the image to be classified to remove impulse noise in the image to be classified.
3. The classification method according to claim 1, characterized in that: The ore to be tested is selected from coal or gangue, and the step of extracting the first image feature of the image to be classified according to the pixel points of the image to be classified comprises: Extracting a first texture feature of the image to be classified according to the pixel points of the image to be classified; Calculating the color moment and the first principal component of the image to be classified to extract the first color feature of the image to be classified; and The first texture feature and the first color feature are concatenated to extract a first image feature of the image to be classified.
4. The classification method according to claim 3, characterized in that: The step of extracting the first texture feature of the image to be classified according to the pixel points of the image to be classified comprises: Traverse the pixel points of the image to be classified to calculate the gray level co-occurrence matrix of the image to be classified: P(i,j|d,θ)={(x,y)|f(x,y)=i,f(x+dx,y+dy)=j;x,y=0,1,2,...,N-1} i,j=0,1,2,...,L-1 Wherein, d is the relative distance between the currently traversed pixel pairs, θ is the direction angle, (x, y) is the pixel point in the image to be classified, N is the number of pixel points in the image to be classified, and L is the number of gray levels of the image to be classified; and The secondary statistics of the gray level co-occurrence matrix are calculated to extract the first texture feature of the image to be classified, wherein the secondary statistics include second-order moment, entropy and contrast.
5. The classification method according to claim 3, characterized in that: The step of calculating the color moment of the image to be classified comprises: The first-order moment, second-order moment and third-order moment of the image to be classified are calculated respectively, wherein: The first-order moment of the image to be classified is: The second-order moment of the image to be classified is: The third-order moment of the image to be classified is: Where i is the color channel, N is the number of pixels in the image to be classified, and P i,j is the pixel value of the j-th pixel in the image to be classified on the i-th color channel.
6. The classification method according to claim 5, characterized in that: The step of calculating the first principal component of the image to be classified comprises: Obtain the gray value matrix of the image to be classified, and perform zero mean processing on the gray value matrix: Among them, x ij is an element in the gray value matrix; According to the gray value matrix, calculate the covariance matrix S of the image to be classified T , and calculate the covariance matrix S T The eigenvalue λ i and the corresponding normalized orthogonal eigenvector a i ;as well as The eigenvalue λ i Sort from large to small and select the eigenvalue λ i The normalized orthogonal eigenvector corresponding to the maximum eigenvalue in is taken as the first principal component of the image to be classified.
7. The classification method according to claim 1, characterized in that: The step of obtaining the image to be classified of the ore to be tested and the corresponding first text feature comprises: Taking a photo of the ore to be tested to obtain the image to be classified; Weighing the ore to be tested to obtain the mass of the ore to be tested; Measuring the ore to be measured to obtain the size of the ore to be measured; and The mass and / or size of the ore to be measured is converted into the first text feature.
8. The classification method according to claim 1, characterized in that: The steps of training the XGBoost ore identification classification model include: Acquire an ore image sample data set, wherein the ore image sample data set includes image samples of coal or gangue and corresponding second text features; Constructing an XGBoost ore identification and classification model to be trained; and The XGBoost ore recognition and classification model is trained according to the ore image sample data set.
9. The classification method according to claim 8, characterized in that: The step of constructing the XGBoost ore identification classification model to be trained includes: The objective function of the XGBoost ore identification and classification model is constructed as follows: Where t is the tth learner in the XGBoost ore recognition and classification model, y i is the true value of the i-th image sample, f t-1 (x i ) is the test value of the i-th image sample determined by the first t-1 learners, h t (x i ) is the test value of the i-th image sample determined according to the t-th learner, J is the number of nodes in the XGBoost ore recognition classification model, w t,j is the output value of the image sample at the Jth node; and Calculate the first-order derivative and the second-order derivative of the image sample in the t-th learner, and optimize the objective function: Among them, g ti is the first-order derivative of the i-th image sample in the t-th learner, h ti is the second-order derivative of the i-th image sample in the t-th learner.
10. The classification method according to claim 9, characterized in that: The step of training the XGBoost ore recognition and classification model according to the ore image sample data set comprises: Preprocessing the image sample, and extracting a second image feature of the image sample according to pixel points of the image sample; Fusing the second image feature and the second text feature of the image sample to obtain a second fused feature; Dividing the second fusion feature into a training set and a test set; Using the training set to train the XGBoost ore identification classification model, and using the test set to test the XGBoost ore identification classification model to determine a model loss value of the XGBoost ore identification classification model; In response to the model loss value being greater than a preset loss threshold, redefining the hyperparameters of the XGBoost ore identification and classification model, and retraining the XGBoost ore identification and classification model according to the redefined hyperparameters; and In response to the model loss value being less than or equal to the loss threshold, it is determined that the training of the XGBoost ore identification classification model is completed.
11. The classification method according to claim 10, characterized in that: The following steps are also included: Calculate the ratio of correctly classified image samples to the total number of image samples: Among them, TP is the number of image samples predicted to be positive and actually positive, TN is the number of image samples predicted to be negative and actually negative, FP is the number of image samples predicted to be positive and actually negative, and FN is the number of image samples predicted to be negative and actually positive.
12. A device for classifying ore samples, characterized in that: include: a memory having computer instructions stored thereon; and A processor is connected to the memory and configured to execute computer instructions stored thereon to implement the method for classifying ore samples according to any one of claims 1 to 11.
13. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the computer instructions are executed by a processor, the method for classifying ore samples according to any one of claims 1 to 11 is implemented.
Citation Information
Cited By
Ore sorting method, sorting system and sorting machine
CN121911665A
