A method and system for raw ore classification based on image recognition
By preprocessing and adjusting the raw ore image data, extracting feature vectors and fusion, and combining the convolutional neural network DNN model for raw ore classification, the problems of unstable raw ore image data quality and high computing resources of deep learning model are solved, and efficient and accurate raw ore classification is achieved.
Patent Information
- Application Number
- CN202410871346.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-07-01
AI Technical Summary
The image data of the raw ore is affected by lighting conditions and ore surface characteristics, resulting in unstable image quality and affecting the accuracy of classification. The amount of hyperspectral and 3D image data is large. How to effectively process and extract useful information is a technical problem. Existing deep learning models such as CNN require a lot of computing resources and time during training, and the preprocessing and feature extraction requirements for data are high, which limits its application in the mine environment.
By collecting raw ore image data, preprocessing and adjustment, extracting feature vectors and fusion, a convolutional neural network DNN model is constructed to classify raw ore, combining hyperspectral cameras, 3D scanning equipment and light sensors to collect data, and optimize image data using wavelet transformation, white balance correction and linear adjustment methods.
It significantly improves the responsiveness and accuracy of the raw ore classification algorithm, reduces the possibility of misclassification, improves processing speed and accuracy, and is suitable for actual mine environments.
Smart Images

Figure CN118781411B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of raw ore classification based on image recognition, and in particular to a raw ore classification method and system based on image recognition. Background Art
[0002] In modern mining, the classification and analysis of raw ores is one of the key steps to obtain effective mineral resource information. With the advancement of science and technology, image recognition technology has shown significant potential and broad application prospects in the field of raw ore classification. Traditional raw ore classification methods mainly rely on physical and chemical analysis, which usually require cumbersome sample preparation and a long analysis process, and cannot meet the modern industrial needs of high efficiency and low cost. With the development of hyperspectral imaging technology and 3D scanning technology, combined with machine learning and deep learning algorithms, automatic recognition and classification of raw ore images has become an effective way to improve the efficiency and accuracy of ore classification. These technologies enable the composition and structural characteristics of raw ores to be quickly and accurately identified, greatly promoting the innovation of mining technology.
[0003] Existing image recognition methods still face many challenges in the application of raw ore classification. The image data of raw ore is often affected by lighting conditions and the surface characteristics of the ore itself. These factors may lead to unstable image quality and affect the accuracy of classification. The data volume of hyperspectral images and 3D images is huge. How to effectively process and extract useful information from these image data is still a technical problem. The existing deep learning model convolutional neural network CNN requires a lot of computing resources and time during training, and has high requirements for data preprocessing and feature extraction, which limits its application in actual mining environments. Summary of the invention
[0004] In view of the problems existing in the above-mentioned existing ore classification methods and systems based on image recognition, the present invention is proposed.
[0005] Therefore, the problem to be solved by the present invention is that the image data of the raw ore is often affected by the lighting conditions and the surface characteristics of the ore itself. These factors may lead to unstable image quality and affect the accuracy of classification. The data volume of hyperspectral images and 3D images is huge. How to effectively process and extract useful information from these image data? The existing deep learning model convolutional neural network CNN requires a lot of computing resources and time during training, and has high requirements for data preprocessing and feature extraction, which limits its application in actual mining environments.
[0006] To solve the above technical problems, the present invention provides the following technical solutions: a method for raw ore classification based on image recognition, which includes collecting raw ore image data, preprocessing and adjusting the raw ore image data, extracting feature vectors of the preprocessed and adjusted raw ore image data and performing vector fusion; constructing a convolutional neural network DNN model to classify raw ore, constructing a visualization interface to display the classification results in real time, and storing the collected and analyzed raw ore data.
[0007] As a preferred solution of the raw ore classification method based on image recognition described in the present invention, wherein: the collection of raw ore image data refers to using a hyperspectral camera to collect hyperspectral image data covering the wavelength range of 400-2500nm of the raw ore;
[0008] Use 3D scanning equipment to obtain the surface morphology and structure data of the raw ore and obtain 3D image data;
[0009] Install a light sensor above the 3D scanning device to collect light data;
[0010] Hyperspectral imagery, illumination, and 3D image data were temporally and spatially aligned using data synchronization software.
[0011] As a preferred solution of the raw ore classification method based on image recognition of the present invention, the preprocessing and adjustment of raw ore image data refers to denoising the hyperspectral and 3D image data using wavelet transform technology;
[0012] Performing white balance correction on the spectral data and geometrically aligning the 3D image data to form initial 3D image data;
[0013] Construct a linear adjustment method, the formula is:
[0014] I adjus =I orig ×(1-k×(LI opti )),
[0015] Among them I adjus is the adjusted 3D image data, I orig is the original 3D image data, L is the real-time measured light intensity data;
[0016] Build a laboratory where the light intensity can be changed gradually. When only the light intensity is changed, use the same 3D imaging device to collect the same test 3D image data under different light intensities. Use the evaluation algorithm SSIM to evaluate the quality of the test 3D image data. Based on the image quality evaluation results, find the light intensity with the best image quality as the ideal light intensity I. opti ;
[0017] Based on the ideal light intensity Iopti Collect ideal 3D image data, use mean square error (MSE) to calculate the quality difference between the test 3D image data under other light intensities and the ideal 3D image data under ideal light intensity, and select the adjustment coefficient k that minimizes the mean square error (MSE) as the final adjustment coefficient;
[0018] The initial 3D image data is input into the linear adjustment method for adjustment.
[0019] As a preferred solution of the raw ore classification method based on image recognition described in the present invention, wherein: the extraction of feature vectors of the raw ore image data after preprocessing and adjustment and vector fusion refers to extracting features from the hyperspectral image data using the pre-trained convolutional neural network VGG-19 to obtain the hyperspectral image feature vector F spcet ;
[0020] The 3D image data is divided into small areas, and the information entropy of the pixel values in the small areas is calculated. The formula is:
[0021]
[0022] Where H(A) is the information entropy of region A, p q is the probability of pixel value q appearing in the region, and Q is the total number of pixel values;
[0023] Based on the information entropy of a small area, the formula for dynamically adjusting the window size is:
[0024]
[0025] Where W is the window size and K is the adjustment coefficient;
[0026] Use the Sobel operator to calculate the gradient of x, y, and z. The formula is:
[0027]
[0028] Among them G x , G y and G x are the gradients of x, y and z respectively;
[0029] The formula for calculating the gradient amplitude U is:
[0030]
[0031] The threshold τ is set based on the mean value of the gradient amplitude plus two times the standard deviation, and the gradient amplitude U greater than the threshold τ is marked as the key area of the image;
[0032] Use MATLAB, a 3D image processing tool, to set the center of the key area of the image as the center point of the segmented image, and obtain the segmented image data based on the window size W;
[0033] Collect historical 3D image data, perform preprocessing and standardization, and generate a 3D image training set;
[0034] The construction of 3D-CNN model includes input layer, convolution layer, activation layer, pooling layer and fully connected output layer;
[0035] Define the input layer as 3D image data;
[0036] The 3D image training set is input into the 3D-CNN model for model training, and the loss function and Adam optimizer are used to iteratively optimize the model parameters;
[0037] Input the adjusted 3D image data into the 3D-CNN model to obtain the 3D image feature vector
[0038] F geome ;
[0039] Input the segmented image data into the 3D-CNN model to obtain the segmented image feature vector F optim ;
[0040] Calculate the image emphasis score V a , the formula is:
[0041]
[0042] Among them U max,a is the maximum gradient amplitude in the a-th segmented image, U max is the maximum gradient amplitude in the segmented image;
[0043] The segmentation image weight ω is determined by combining the window size, image emphasis score and feature entropy of the image block. a , the formula is:
[0044]
[0045] Among them, γ and ρ are adjustment coefficients, ω a is the weight of segmenting image a, W a is the window size;
[0046] Collect historical segmentation image weights and corresponding labels to generate a weight training set.
[0047] Construct a linear regression model, define the input as window size, image emphasis score and feature entropy of image patch, and output as the contribution of segmented image to the task;
[0048] Use the weight training set to train the linear regression model, and use the loss function and Adam optimizer to iteratively optimize the model parameters;
[0049] Input the segmented image weights into the trained linear regression model to obtain the optimal adjustment coefficients γ and ρ;
[0050] Using the 3D image feature vector F geome and segmented image feature vector F optim Perform weighted fusion, the formula is:
[0051] F home =1-∑ω a ·F geome +∑(ω a ·F optim ),
[0052] where F home is the initial fusion feature vector, ω a is the weight;
[0053] The extracted hyperspectral image feature vector F spcet and the initial fused feature vector F home Sort by extraction order to form a hyperspectral image feature matrix X spcet and the initial fused feature vector X home ,In the image feature matrix, each column represents the feature vector of a sample;
[0054] Calculate the hyperspectral image feature matrix X spcet and the initial fused feature vector X home The collinear matrix C between them is given by:
[0055]
[0056] Where T is the transpose of the matrix;
[0057] The principal component analysis PCA dimensionality reduction technique is used to simplify the matrix. The formula is:
[0058] F fused = PCA(C),
[0059] where F fused is the comprehensive feature vector obtained after dimensionality reduction.
[0060] As a preferred solution of the ore classification method based on image recognition described in the present invention, the construction of a convolutional neural network DNN model for ore classification refers to collecting hyperspectral images and 3D image data of historical type labels, preprocessing and normalizing them, and extracting feature vectors F f ′ used , generate model training set;
[0061] Construct a convolutional neural network (DNN) model, including input layer, convolution layer, activation layer, pooling layer, fully connected layer and output layer;
[0062] Set the input layer to the comprehensive feature vector F fused ;
[0063] Use the convolution kernel to perform a convolution operation on the input data. The formula is:
[0064]
[0065] where F conv is the output of the convolutional layer, K is the number of convolution kernels, and W k is the convolution kernel, b k is the bias term, F f ′ used is the input data;
[0066] Use the ReLU activation function for nonlinear transformation, the formula is:
[0067] ReLU(f)=max(0,f),
[0068] Where f is the output of the convolutional layer conv , and get the output F of the activation layer act ;
[0069] Use the maximum pooling operation to reduce the size of the feature map. The formula is:
[0070] F pool =max u,v F act (u,v),
[0071] where F act (u,v) is the value of position u and v in the pooling layer window;
[0072] Flatten the pooling layer output into a one-dimensional vector F flat , input to the fully connected layer, the formula is:
[0073] Z=W fc ·F flat +b fc ,
[0074] Where W fc is the weight matrix of the fully connected layer, b fc is the bias term of the fully connected layer;
[0075] Use the softmax function to calculate the final classification probability p c , the formula is:
[0076]
[0077] Where Z c is the score of category c, C is the total number of categories, is the exponential sum of the raw scores of all categories in the output layer;
[0078] Use the model training set to train the convolutional neural network DNN model, and use the loss function and Adam optimizer to iteratively optimize the model parameters;
[0079] The integrated feature vector F fused Input the trained convolutional neural network DNN model to obtain the probability of ore classification;
[0080] According to the probability of the original ore classification, the category with the highest probability is selected as the prediction result.
[0081] As a preferred solution of the ore classification method based on image recognition described in the present invention, wherein: the construction of a visual interface to display the classification results in real time refers to using WebSocket to create an interface in the form of a dashboard to display the probability of various types of ore and the final selected classification in real time;
[0082] The classification results are updated in real time in the UI, showing the probability bar chart of each type of ore;
[0083] Only users who have passed real-name verification are allowed to view it.
[0084] As a preferred solution of the raw ore classification method based on image recognition described in the present invention, wherein: the storing of the raw ore data collected and analyzed refers to storing the collected data, the data generated by the analysis, and the generated charts in the database, and marking the corresponding labels, synchronously backing up the raw ore prediction data in the cloud, and regularly performing integrity checks on the collected data, the data generated by the analysis, the generated charts and the backup data.
[0085] Another object of the present invention is to provide a raw ore classification system based on image recognition, which comprises:
[0086] The collection and processing module is used to collect raw ore image data in real time and perform preprocessing and adjustment;
[0087] Extraction and construction module, used to extract feature vectors of pre-processed and adjusted raw ore image data for vector fusion, and to construct a convolutional neural network DNN model for raw ore classification;
[0088] The visualization storage module is used to display the classification results of the convolutional neural network DNN model in real time and store the raw ore data collected and analyzed.
[0089] A computer device comprises: a memory and a processor; the memory stores a computer program, and the processor implements the steps of the above-mentioned raw ore classification method based on image recognition when executing the computer program.
[0090] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned ore classification method based on image recognition.
[0091] The beneficial effects of the present invention are as follows: the present invention collects raw ore image data, preprocesses and adjusts the raw ore image data, extracts feature vectors of the raw ore image data after preprocessing and adjustment and performs vector fusion, and constructs a convolutional neural network DNN model to classify raw ore, thereby greatly improving the responsiveness and accuracy of the classification algorithm, reducing the possibility of misclassification, significantly improving the performance of raw ore classification, significantly improving the processing speed and accuracy, and having very obvious practical value and market prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0092] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0093] Figure 1 The figure is a flow chart of the ore classification method based on image recognition.
[0094] Figure 2 This is a schematic diagram of the structure of the ore classification method based on image recognition.
[0095] Figure 3 This is a schematic diagram of the structure of the ore classification method based on image recognition. DETAILED DESCRIPTION
[0096] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.
[0097] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0098] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor is it a separate or selective embodiment that is mutually exclusive with other embodiments.
[0099] Example 1
[0100] Reference Figure 1 and Figure 2 , which is the first embodiment of the present invention, and provides a method for classifying raw ore based on image recognition. The method for classifying raw ore based on image recognition includes:
[0101] S1. Collect raw ore image data, preprocess and adjust the raw ore image data, extract feature vectors of the preprocessed and adjusted raw ore image data, and perform vector fusion;
[0102] Specifically, collecting raw ore image data refers to using a hyperspectral camera to collect hyperspectral image data covering the wavelength range of 400-2500nm of the raw ore;
[0103] Use 3D scanning equipment to obtain the surface morphology and structure data of the raw ore and obtain 3D image data;
[0104] Install a light sensor above the 3D scanning device to collect light data;
[0105] Hyperspectral imagery, illumination, and 3D image data were temporally and spatially aligned using data synchronization software.
[0106] The use of hyperspectral cameras can capture the subtle differences in various chemical components present in the original minerals. The acquisition of data in this wide wavelength range provides extremely rich material basis information for the composition analysis and classification of the original minerals, greatly enhancing the classification accuracy. Through precise alignment, it can be ensured that the data obtained from different dimensions corresponds to the same part of the same substance, which is crucial for subsequent data analysis and feature extraction. Correct alignment ensures the accuracy of data processing and avoids misinterpretation caused by data dislocation.
[0107] Furthermore, preprocessing and adjusting the raw ore image data refers to denoising the hyperspectral and 3D image data using wavelet transform technology;
[0108] Performing white balance correction on the spectral data and geometrically aligning the 3D image data to form initial 3D image data;
[0109] Construct a linear adjustment method, the formula is:
[0110] I adjus =I orig×(1-k×(LI opti )),
[0111] Among them I adjus is the adjusted 3D image data, I orig is the original 3D image data, L is the real-time measured light intensity data;
[0112] Build a laboratory where the light intensity can be changed gradually. When only the light intensity is changed, use the same 3D imaging device to collect the same test 3D image data under different light intensities. Use the evaluation algorithm SSIM to evaluate the quality of the test 3D image data. Based on the image quality evaluation results, find the light intensity with the best image quality as the ideal light intensity I. opti ;
[0113] Based on the ideal light intensity I opti Collect ideal 3D image data, use mean square error (MSE) to calculate the quality difference between the test 3D image data under other light intensities and the ideal 3D image data under ideal light intensity, and select the adjustment coefficient k that minimizes the mean square error (MSE) as the final adjustment coefficient;
[0114] The initial 3D image data is input into the linear adjustment method for adjustment.
[0115] The use of wavelet transform effectively removes random noise in the image while retaining key feature information, improves the signal-to-noise ratio of the data, and lays the foundation for high-precision image analysis. The constructed linear adjustment method adjusts the 3D image data to adapt to different light intensities. This strategy significantly improves the stability and consistency of the image under different environmental conditions. By simulating different light intensities in a laboratory environment, selecting the optimal light intensity and optimizing the 3D image data, the high quality of the data is further guaranteed. In addition, the SSIM structural similarity index is used to evaluate the image quality to ensure that the selected light intensity can reproduce high-quality images in practical applications. After determining the ideal light intensity, the mean square error (MSE) is used to calculate the quality difference between the test data and the ideal data. The image data is further fine-tuned and the adjustment coefficient that minimizes the mean square error is selected to ensure the best image quality under various lighting conditions.
[0116] Furthermore, extracting the feature vector of the preprocessed and adjusted raw ore image data and performing vector fusion refers to extracting features from the hyperspectral image data using the pre-trained convolutional neural network VGG-19 to obtain the hyperspectral image feature vector F spcet ;
[0117] The 3D image data is divided into small areas, and the information entropy of the pixel values in the small areas is calculated. The formula is:
[0118]
[0119] Where H(A) is the information entropy of region A, p q is the probability of pixel value q appearing in the region, and Q is the total number of pixel values;
[0120] Based on the information entropy of a small area, the formula for dynamically adjusting the window size is:
[0121]
[0122] Where W is the window size, and K is the adjustment coefficient, which is used to adjust the sensitivity of the window size according to actual needs;
[0123] Use the Sobel operator to calculate the gradient of x, y, and z. The formula is:
[0124]
[0125] Among them G x , G y and G x are the gradients of x, y and z respectively;
[0126] The formula for calculating the gradient amplitude U is:
[0127]
[0128] The threshold τ is set based on the mean value of the gradient amplitude plus two times the standard deviation, and the gradient amplitude U greater than the threshold τ is marked as the key area of the image;
[0129] Use MATLAB, a 3D image processing tool, to set the center of the key area of the image as the center point of the segmented image, and obtain the segmented image data based on the window size W;
[0130] Collect historical 3D image data, perform preprocessing and standardization, and generate a 3D image training set;
[0131] The construction of 3D-CNN model includes input layer, convolution layer, activation layer, pooling layer and fully connected output layer;
[0132] Define the input layer as 3D image data;
[0133] The 3D image training set is input into the 3D-CNN model for model training, and the loss function and Adam optimizer are used to iteratively optimize the model parameters;
[0134] Input the adjusted 3D image data into the 3D-CNN model to obtain the 3D image feature vector
[0135] F geome ;
[0136] Input the segmented image data into the 3D-CNN model to obtain the segmented image feature vector F optim ;
[0137] Calculate the image emphasis score V a , the formula is:
[0138]
[0139] Among them U max,a is the maximum gradient amplitude in the a-th segmented image, U max is the maximum gradient amplitude in the segmented image;
[0140] The segmentation image weight ω is determined by combining the window size, image emphasis score and feature entropy of the image block. a , the formula is:
[0141]
[0142] Among them, γ and ρ are adjustment coefficients, ω a is the weight of segmenting image a, W a is the window size;
[0143] Collect historical segmentation image weights and corresponding labels to generate a weight training set.
[0144] Construct a linear regression model, define the input as window size, image emphasis score and feature entropy of image patch, and output as the contribution of segmented image to the task;
[0145] Use the weight training set to train the linear regression model, and use the loss function and Adam optimizer to iteratively optimize the model parameters;
[0146] Input the segmented image weights into the trained linear regression model to obtain the optimal adjustment coefficients γ and ρ;
[0147] Using the 3D image feature vector F geome and segmented image feature vector F optim Perform weighted fusion, the formula is:
[0148] F home =1-∑ω a ·F geome +∑(ω a ·F optim ),
[0149] where F home is the initial fusion feature vector, ω a is the weight;
[0150] The extracted hyperspectral image feature vector F spcet and the initial fused feature vector Fhome Sort by extraction order to form a hyperspectral image feature matrix X spcet and the initial fused feature vector X home ,In the image feature matrix, each column represents the feature vector of a sample;
[0151] Calculate the hyperspectral image feature matrix X spcet and the initial fused feature vector X home The collinear matrix C between them is given by:
[0152]
[0153] Where T is the transpose of the matrix;
[0154] The principal component analysis PCA dimensionality reduction technique is used to simplify the matrix. The formula is:
[0155] F fused = PCA(C),
[0156] where F fused is the comprehensive feature vector obtained after dimensionality reduction.
[0157] Using the pre-trained VGG-19 model to extract feature vectors from hyperspectral images can effectively identify and analyze small changes and complex features in the original ore. This method greatly enhances the analytical ability of hyperspectral image data and improves the accuracy and reliability of classification. The voxel-based method is used for spatial segmentation, allowing the model to understand and process the spatial properties of the original ore more finely, which is critical to improving the model's understanding of the three-dimensional structure. Calculating and selecting the voxel window with the largest weight is a key step in optimizing the data, which helps to highlight the most informative part of the image, thereby improving the quality and relevance of the feature vector, and ultimately optimizing the performance of the classification model. The 3D image feature vector and the hyperspectral image feature vector are weighted fused, and the principal component analysis PCA technology is used for dimensionality reduction, which not only simplifies the data structure, but also enhances the efficiency and effect of the model when processing large-scale data sets. The fused feature vector represents the chemical and physical properties of the original ore more comprehensively, thereby greatly improving the accuracy of the final classification.
[0158] S2. Construct a convolutional neural network (DNN) model to classify raw ore, build a visualization interface to display the classification results in real time, and store the raw ore data collected and analyzed;
[0159] Specifically, building a convolutional neural network (DNN) model for ore classification involves collecting hyperspectral images and 3D image data with historical type labels, preprocessing and normalizing them, and extracting feature vectors F f ′ used , generate model training set;
[0160] Construct a convolutional neural network (DNN) model, including input layer, convolution layer, activation layer, pooling layer, fully connected layer and output layer;
[0161] Set the input layer to the comprehensive feature vector F fused ;
[0162] Use the convolution kernel to perform a convolution operation on the input data. The formula is:
[0163]
[0164] Among them, F conv is the output of the convolutional layer, K is the number of convolution kernels, and W k is the convolution kernel, b k is the bias term, F f ′ used is the input data;
[0165] Use the ReLU activation function for nonlinear transformation, the formula is:
[0166] ReLU(f)=max(0,f),
[0167] Where f is the output of the convolutional layer conv , and get the output F of the activation layer act ;
[0168] Use the maximum pooling operation to reduce the size of the feature map. The formula is:
[0169] F pool =max u,v F act (u,v),
[0170] Among them, F act (u,v) is the value of position u and v in the pooling layer window;
[0171] Flatten the pooling layer output into a one-dimensional vector F flat , input to the fully connected layer, the formula is:
[0172] Z=W fc ·F flat +b fc ,
[0173] Where W fc is the weight matrix of the fully connected layer, b fc is the bias term of the fully connected layer;
[0174] Use the softmax function to calculate the final classification probability p c , the formula is:
[0175]
[0176] Where Z c is the score of category c, C is the total number of categories, is the exponential sum of the raw scores of all categories in the output layer;
[0177] Use the model training set to train the convolutional neural network DNN model, and use the loss function and Adam optimizer to iteratively optimize the model parameters;
[0178] The integrated feature vector F fused Input the trained convolutional neural network DNN model to obtain the probability of ore classification;
[0179] According to the probability of the original ore classification, the category with the highest probability is selected as the prediction result.
[0180] Collecting hyperspectral and 3D image data with historical type labels is crucial to improving the generalization ability of the model and reducing the risk of overfitting. The extraction of feature vectors is the core of machine learning. It can capture the key information in the raw ore image data and provide data support for subsequent classification. The multi-layer structure can effectively learn useful features from the complex image data of the raw ore. Each layer gradually extracts higher-level features. The use of ReLU activation function helps the network introduce nonlinearity while maintaining fast calculation, enhancing the expressiveness of the model. The fully connected layer maps the learned representation to the final output category, which is an important part of integrating learning features and performing classification. The final classification probability is calculated by the softmax function, which makes the model output interpretable as a probability distribution, facilitating multi-category classification judgment. The Adam optimizer and loss function are used to iteratively optimize the model parameters to ensure the efficiency of the training process and the convergence of the model. The preprocessed and normalized comprehensive feature vector is input into the trained DNN model for classification. The model makes effective classification decisions based on the learned data representation and selects the category with the highest probability as the prediction result, which not only improves the accuracy of classification, but also makes the results more reliable.
[0181] Furthermore, constructing a visual interface to display the classification results in real time means using WebSocket to create a dashboard-style interface to display the probability of various types of raw ores and the final selected classification in real time;
[0182] The classification results are updated in real time in the UI, showing the probability bar chart of each type of ore;
[0183] Only users who have passed real-name verification are allowed to view it.
[0184] The dashboard interface created using WebSocket can display the classification results of the raw ore in real time. This real-time display function not only increases the transparency of the system, but also enables the operator to instantly understand every link of the classification process, enhancing the user experience and system usability. The interface includes a dynamically updated bar chart that displays the probability of each type of raw ore, which allows users to intuitively see the possibility of each type of raw ore and help users better understand the judgment basis and classification logic of the model. The real-time update function ensures the timeliness and accuracy of the data, which is especially important for decision-making environments that require rapid response. Access rights are controlled through the real-name verification mechanism to ensure data security and reliability. This measure is particularly important for systems containing sensitive data, ensuring that only authorized users can view the classification results, thereby protecting the security of corporate data and information.
[0185] Furthermore, storing the raw ore data generated by the collection and analysis means storing the collected data, the data generated by the analysis, and the generated charts in the database and marking them with corresponding tags, synchronously backing up the raw ore prediction data in the cloud, and regularly performing integrity checks on the collected data, the data generated by the analysis, the generated charts, and the backup data.
[0186] Storing raw ore data can effectively organize and manage large amounts of data. This organizational method not only improves the efficiency of data retrieval, but also facilitates subsequent data analysis and report generation. Backing up data in the cloud improves data security. In the event of local hardware failure, system crash, or data corruption, cloud backup allows for rapid recovery to the most recent backup state, ensuring that business continuity and data integrity are not affected. Integrity testing is a key step in ensuring data quality and reliability. Integrity testing can detect data corruption, loss, or tampering, and take timely measures to repair or restore it to maintain data accuracy and credibility.
[0187] Example 2
[0188] Reference Figure 3 , which is the second embodiment of the present invention, is different from the previous embodiment and provides a raw ore classification method system based on image recognition, including:
[0189] The collection and processing module is used to collect raw ore image data in real time and perform preprocessing and adjustment;
[0190] Extraction and construction module, used to extract feature vectors of pre-processed and adjusted raw ore image data for vector fusion, and to construct a convolutional neural network DNN model for raw ore classification;
[0191] The visualization storage module is used to display the classification results of the convolutional neural network DNN model in real time and store the raw ore data collected and analyzed.
[0192] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0193] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0194] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0195] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
Claims
1. A method for raw ore classification based on image recognition, characterized in that: include, Collecting raw ore image data, preprocessing and adjusting the raw ore image data, extracting feature vectors of the preprocessed and adjusted raw ore image data, and performing vector fusion; Construct a convolutional neural network (DNN) model to classify raw ore, build a visual interface to display the classification results in real time, and store the raw ore data collected and analyzed; The collecting of raw ore image data refers to using a hyperspectral camera to collect hyperspectral image data covering the wavelength range of 400-2500nm of the raw ore; Use 3D scanning equipment to obtain the surface morphology and structure data of the raw ore and obtain 3D image data; Install a light sensor above the 3D scanning device to collect light data; Temporal and spatial alignment of hyperspectral imagery, illumination, and 3D image data using data synchronization software; The preprocessing and adjustment of the raw ore image data refers to using wavelet transform technology to perform denoising on the hyperspectral and 3D image data; Performing white balance correction on the spectral data and geometrically aligning the 3D image data to form initial 3D image data; Construct a linear adjustment method, the formula is: I adjus =I orig ×(1-k×(L-I opti )), Among them I adjus is the adjusted 3D image data, I orig is the original 3D image data, L is the real-time measured light intensity data; Build a laboratory where the light intensity can be changed gradually. When only the light intensity is changed, use the same 3D imaging device to collect the same test 3D image data under different light intensities. Use the evaluation algorithm SSIM to evaluate the quality of the test 3D image data. Based on the image quality evaluation results, find the light intensity with the best image quality as the ideal light intensity I. opti ; Based on the ideal light intensity I opti Collect ideal 3D image data, use mean square error (MSE) to calculate the quality difference between the test 3D image data under other light intensities and the ideal 3D image data under ideal light intensity, and select the adjustment coefficient k that minimizes the mean square error (MSE) as the final adjustment coefficient; The initial 3D image data is input into the linear adjustment method for adjustment.
2. The method for raw ore classification based on image recognition according to claim 1, characterized in that: The extracting feature vectors of the pre-processed and adjusted raw ore image data and performing vector fusion refers to extracting features from the hyperspectral image data using a pre-trained convolutional neural network VGG-19 to obtain a hyperspectral image feature vector F spcet ; The 3D image data is divided into small areas, and the information entropy of the pixel values in the small areas is calculated. The formula is: Where H(A) is the information entropy of region A, p q is the probability of pixel value q appearing in the region, and Q is the total number of pixel values; Based on the information entropy of a small area, the formula for dynamically adjusting the window size is: Where W is the window size and K is the adjustment coefficient; Use the Sobel operator to calculate the gradient of x, y, and z. The formula is: Among them G x , G y and G x are the gradients of x, y and z respectively; The formula for calculating the gradient amplitude U is: The threshold τ is set based on the mean value of the gradient amplitude plus two times the standard deviation, and the gradient amplitude U greater than the threshold τ is marked as the key area of the image; Use MATLAB, a 3D image processing tool, to set the center of the key area of the image as the center point of the segmented image, and obtain the segmented image data based on the window size W; Collect historical 3D image data, perform preprocessing and standardization, and generate a 3D image training set; The construction of 3D-CNN model includes input layer, convolution layer, activation layer, pooling layer and fully connected output layer; Define the input layer as 3D image data; The 3D image training set is input into the 3D-CNN model for model training, and the loss function and Adam optimizer are used to iteratively optimize the model parameters; Input the adjusted 3D image data into the 3D-CNN model to obtain the 3D image feature vector F geome ; Input the segmented image data into the 3D-CNN model to obtain the segmented image feature vector F optim ; Calculate the image emphasis score V a , the formula is: Among them U max,a is the maximum gradient amplitude in the a-th segmented image, U max is the maximum gradient amplitude in the segmented image; The segmentation image weight ω is determined by combining the window size, image emphasis score and feature entropy of the image block. a , the formula is: Among them, γ and ρ are adjustment coefficients, ω a is the weight of segmenting image a, W a is the window size; Collect historical segmentation image weights and corresponding labels to generate a weight training set. Construct a linear regression model, define the input as window size, image emphasis score and feature entropy of image patch, and output as the contribution of segmented image to the task; Use the weight training set to train the linear regression model, and use the loss function and Adam optimizer to iteratively optimize the model parameters; Input the segmented image weights into the trained linear regression model to obtain the optimal adjustment coefficients γ and ρ; Using the 3D image feature vector F geome and segmented image feature vector F optim Perform weighted fusion, the formula is: F home =1-∑ω a ·F geome +∑(ω a ·F optim ), where F home is the initial fusion feature vector, ω a is the weight; The extracted hyperspectral image feature vector F spcet and the initial fused feature vector F home Sort by extraction order to form a hyperspectral image feature matrix X spcet and the initial fused feature vector X home ,In the image feature matrix, each column represents the feature vector of a sample; Calculate the hyperspectral image feature matrix X spcet and the initial fused feature vector X home The collinear matrix C between them is given by: Where T is the transpose of the matrix; The principal component analysis PCA dimensionality reduction technique is used to simplify the matrix. The formula is: F fused =PCA(C), where F fused is the comprehensive feature vector obtained after dimensionality reduction.
3. The method for raw ore classification based on image recognition according to claim 2, characterized in that: The construction of the convolutional neural network DNN model for ore classification refers to collecting hyperspectral images and 3D image data with historical type labels, preprocessing and normalizing them, and extracting feature vectors F f ′ used , generate model training set; Construct a convolutional neural network (DNN) model, including input layer, convolution layer, activation layer, pooling layer, fully connected layer and output layer; Set the input layer to the comprehensive feature vector F fused ; Use the convolution kernel to perform a convolution operation on the input data. The formula is: where F conv is the output of the convolution layer, K is the number of convolution kernels, W k is the convolution kernel, b k is the bias term, F f ′ used is the input data; Use the ReLU activation function for nonlinear transformation, the formula is: ReLU(f)=max(0,f), Where f is the output of the convolutional layer conv , and get the output F of the activation layer act ; Use the maximum pooling operation to reduce the size of the feature map. The formula is: F pool =max u,v F act (u,v), where F act (u,v) is the value of position u and v in the pooling layer window; Flatten the pooling layer output into a one-dimensional vector F flat , input to the fully connected layer, the formula is: Z=W fc ·F flat +b fc , Where W fc is the weight matrix of the fully connected layer, b fc is the bias term of the fully connected layer; Use the softmax function to calculate the final classification probability p c , the formula is: Where Z c is the score of category c, C is the total number of categories, is the exponential sum of the raw scores of all categories in the output layer; Use the model training set to train the convolutional neural network DNN model, and use the loss function and Adam optimizer to iteratively optimize the model parameters; The integrated feature vector F fused Input the trained convolutional neural network DNN model to obtain the probability of ore classification; According to the probability of the original ore classification, the category with the highest probability is selected as the prediction result.
4. The method for raw ore classification based on image recognition as claimed in claim 3, characterized in that: The construction of a visual interface to display the classification results in real time refers to using WebSocket to create an interface in the form of a dashboard to display the probability of various types of raw ores and the final selected classification in real time; The classification results are updated in real time in the UI, showing the probability bar chart of each type of ore; Only users who have passed real-name verification are allowed to view it.
5. The method for raw ore classification based on image recognition according to claim 4, characterized in that: The storing of the raw ore data generated by the collection and analysis refers to storing the collected data, the data generated by the analysis and the generated charts in the database, marking them with corresponding tags, synchronously backing up the raw ore prediction data in the cloud, and regularly performing integrity checks on the collected data, the data generated by the analysis, the generated charts and the backup data.
6. A raw ore classification system based on image recognition based on the raw ore classification method based on image recognition according to any one of claims 1 to 5, characterized in that: include, The collection and processing module is used to collect raw ore image data in real time and perform preprocessing and adjustment; Extraction and construction module, used to extract feature vectors of pre-processed and adjusted raw ore image data for vector fusion, and to construct a convolutional neural network DNN model for raw ore classification; The visualization storage module is used to display the classification results of the convolutional neural network DNN model in real time and store the raw ore data collected and analyzed.
7. A computer device comprising: Memory and processor; The memory stores a computer program, characterized in that: when the processor executes the computer program, the steps of the ore classification method based on image recognition described in any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the ore classification method based on image recognition described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
An ore sorting method based on a convolutional neural network
CN109740656A
Mineral recognition and classification method, system and equipment and storage medium
CN115984600A