A coal sample assay value prediction method and device and computer equipment

By processing near-infrared spectroscopy and laser-induced breakdown spectroscopy and training models, the problems of irrelevant feature interference and insufficient prediction stability of LIBS or NIR single spectral technology in coal quality detection are solved, and rapid and accurate detection of coal sample test values ​​is achieved.

CN122241421APending Publication Date: 2026-06-19SHENHUA SHENDONG COAL GRP +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENHUA SHENDONG COAL GRP
Filing Date
2026-02-26
Publication Date
2026-06-19

Smart Images

  • Figure CN122241421A_ABST
    Figure CN122241421A_ABST
Patent Text Reader

Abstract

This application belongs to the field of coal product testing and analysis technology, and particularly relates to a method, device, and computer equipment for predicting coal sample test values. The method, device, and computer equipment provided in this application, based on spectral analysis, predict coal sample test values ​​by collecting near-infrared and laser-induced breakdown spectra of the original coal sample, followed by wavelet decomposition and dimensionality reduction to generate a feature fingerprint matrix. This achieves effective fusion and dimensionality reduction of the two spectral data, preserving key spectral features of the organic and inorganic elements in the coal sample, providing fundamental data for subsequent model training. Furthermore, a genetic algorithm is used to optimize the feature weight vector of the feature fingerprint matrix to reconstruct the feature space. Abnormal samples are eliminated by comparing the ash content prediction with a preset threshold, highlighting the key spectral features for test value prediction. By eliminating interfering samples, the specificity of the feature space and the reliability of the data are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of coal testing and analysis technology, and in particular relates to a method, device and computer equipment for predicting coal sample test values. Background Technology

[0002] As an important energy source and industrial raw material, coal's key test values, such as ash content and moisture, directly affect combustion efficiency, transportation costs, and environmental emissions. Rapid and accurate coal quality testing is a core element in achieving clean and efficient coal utilization. Online measurement methods based on gamma-ray or neutron activation principles can achieve real-time analysis, but they pose a risk of radioactive contamination, and the high cost of equipment purchase and maintenance makes them difficult to adopt in small and medium-sized enterprises.

[0003] In recent years, spectroscopic analysis technology has become a research hotspot in coal testing due to its advantages such as being non-contact, pollution-free, and fast in detection. Among them, laser-induced breakdown spectroscopy (LIBS) technology can quickly obtain information on the inorganic elemental composition of coal samples through laser plasma spectroscopy, and is suitable for the analysis of indicators related to inorganic minerals such as ash content. Near-infrared spectroscopy (NIR) technology can reflect the molecular structure information of organic components and moisture in coal samples through molecular vibration absorption characteristics, and has outstanding advantages in the detection of indicators such as moisture.

[0004] However, single LIBS or NIR spectroscopy techniques have significant limitations. For example, LIBS is limited by plasma fluctuations and matrix effects, resulting in low accuracy in predicting molecular-level indicators such as moisture. NIR spectroscopy is susceptible to band overlap and scattering effects, making it difficult to analyze indicators dominated by inorganic elements, such as ash content. Furthermore, the lack of targeted optimization in the allocation of feature weights for coal parameters easily leads to irrelevant features interfering with model accuracy, and the failure to effectively utilize the intrinsic correlation between indicators such as ash content and moisture results in insufficient predictive stability.

[0005] Therefore, the development of a method, device, and computer equipment for predicting coal sample test values ​​is urgently needed to address the technical shortcomings of existing LIBS or NIR single-spectral techniques in coal quality detection, which are easily interfered with by irrelevant features and have insufficient predictive stability. Summary of the Invention

[0006] Therefore, it is necessary to address the technical shortcomings of existing LIBS or NIR single-spectral techniques in coal quality detection, such as susceptibility to interference from irrelevant features and insufficient predictive stability, and to provide a method, device, and computer equipment for predicting coal sample test values.

[0007] This application provides a method for predicting coal sample test values ​​based on spectral analysis, the method comprising: Step 1: Collect near-infrared spectrum and laser-induced breakdown spectrum of the original coal sample. Generate a feature fingerprint matrix by performing wavelet decomposition and dimensionality reduction on the near-infrared spectrum and the laser-induced breakdown spectrum. Step 2: Optimize the feature weight vector of the feature fingerprint matrix based on the genetic algorithm to generate an optimized weight vector. Reconstruct the feature space based on the optimized weight vector and the feature fingerprint matrix. Calculate the gray value estimate through the reconstructed feature space and compare the gray value estimate with a preset gray value threshold to obtain a comparison result. Remove abnormal samples from the reconstructed feature space based on the comparison result to obtain the filtered feature matrix. Step 3: Divide the filtered feature matrix into a training set and a validation set. Train the first XGBoost model and the random forest model on the training set to obtain the ash content prediction model and the moisture prediction model. Calculate the ash content prediction residual through the validation set. Dynamically correct the model parameters of the moisture prediction model based on the ash content prediction residual and the coal type of the original coal sample to generate an optimized moisture model. Step 4: Perform wavelet decomposition and dimensionality reduction on the real-time spectral data of the new coal sample to obtain an initial feature vector. Multiply the initial feature vector with the optimized weight vector to obtain a real-time feature vector. Based on the ash prediction model and the optimized moisture model, predict the real-time feature vector to obtain the real-time ash prediction value and the real-time moisture prediction value.

[0008] In one embodiment, step one, which involves collecting near-infrared and laser-induced breakdown spectra of the original coal sample and generating a feature fingerprint matrix by performing wavelet decomposition and dimensionality reduction on the near-infrared and laser-induced breakdown spectra, includes: S101. The diffuse reflectance spectrum in the 350-2500nm band of the original coal sample is collected by a near-infrared spectrometer to generate a near-infrared spectral matrix; S102. The atomic emission spectrum in the 200-980nm band of the original coal sample is collected by a laser-induced breakdown spectrometer to generate a laser-induced breakdown spectral matrix. S103. The near-infrared spectral matrix and the laser-induced breakdown spectral matrix are decomposed into third-level wavelet bases using the db4 wavelet basis, and the corresponding third-level approximation coefficients are extracted. S104. The third-order approximation coefficients of the near-infrared spectral matrix and the third-order approximation coefficients of the laser-induced breakdown spectral matrix are concatenated column by column to obtain the joint feature matrix. S105. Perform principal component analysis to reduce the dimensionality of the joint feature matrix, and select the top 8 principal components whose cumulative contribution rate is greater than the preset contribution threshold to generate the feature fingerprint matrix.

[0009] In one embodiment, step two, which involves optimizing the feature weight vector of the feature fingerprint matrix using a genetic algorithm to generate an optimized weight vector, and reconstructing the feature space based on the optimized weight vector and the feature fingerprint matrix, includes: S201. Initialize the feature weight vector of the feature fingerprint matrix, generate several random vectors, and the element values ​​of each random vector follow a uniform distribution of 0-1 and the sum of the element values ​​is 1. S202. Extract the true ash content from the test data of the original coal sample and construct an ash content label set.

[0010] In one embodiment, for each of the random vectors, the fitness value is calculated using the following procedure: S2021. Multiply the random vector element-wise with the feature fingerprint matrix to generate a temporary feature space; S2022. The temporary feature space and the gray label set are trained using the second XGBoost model to obtain a temporary gray prediction model. S2023. The temporary feature space is predicted using the temporary gray prediction model, and the root mean square error of gray prediction between the predicted value and the true gray value of the gray label set is calculated. S2024. The reciprocal of the root mean square error of the ash prediction is used as the fitness value of the corresponding random vector; S2025. Based on each random vector and the corresponding fitness value, perform selection, crossover, and mutation operations according to the genetic algorithm according to a preset number of iterations to obtain the final population. S2026. Extract the vector with the highest fitness value from the final population, and use the vector with the highest fitness value as the optimization weight vector; S2027. Multiply the optimized weight vector element-wise with the feature fingerprint matrix to obtain the reconstructed feature space.

[0011] In one embodiment, in step two, the reconstructed feature space is an 8-dimensional feature space. A gray value prediction is calculated using the reconstructed feature space, and the gray value prediction is compared with a preset gray value threshold to obtain a comparison result. Based on the comparison result, abnormal samples in the reconstructed feature space are removed to obtain a filtered feature matrix, including: S203. Extract the first four columns of features from the reconstructed feature space to generate a gray feature submatrix, wherein the first four columns of features are principal component features associated with the near-infrared spectrum; S204. Input the gray feature sub-matrix into the temporary gray prediction model for prediction calculation to obtain the gray prediction value corresponding to each sample in the reconstructed feature space. S205. Compare the ash content estimates of each sample with the preset ash content threshold. When the ash content estimate is greater than the preset ash content threshold, mark the corresponding sample as the abnormal sample to obtain the comparison result. S206. Based on the comparison results, remove the row vectors of the abnormal samples from the reconstructed feature space to obtain the filtered row vectors. Arrange the filtered row vectors in their original order to obtain the filtered feature matrix.

[0012] In one embodiment, in step three, the filtered feature matrix is ​​an 8-dimensional feature matrix. The filtered feature matrix is ​​divided into a training set and a validation set. The training set is used to train a first XGBoost model and a random forest model, respectively, to obtain a gray content prediction model and a moisture prediction model, including: S301. Using stratified sampling, the filtered feature matrix is ​​divided into the training set and the validation set according to the ash content range. The ratio of the number of samples in the training set to the number of samples in the validation set is 6:2. The ash content range is divided according to the metamorphism degree of the original coal sample. S302. Extract the first four columns of features from the training set, and use the first four columns of features as gray training data. The first four columns of features are principal component features associated with the near-infrared spectrum. S303. Based on the ash training data and the corresponding ash training true value of the original coal sample, train the first XGBoost model, and according to the validation set, use the optimized parameters in the 5-fold cross-validation training process to obtain the trained first XGBoost model, and use the trained first XGBoost model as the ash prediction model. S304. Extract the last four columns of features from the training set, and use the last four columns of features as water training data. The last four columns of features are principal component features associated with the laser-induced breakdown spectrum. S305. Based on the moisture training data and the actual moisture value of the corresponding original coal sample, train a random forest model and evaluate the model performance of the random forest model using out-of-bag data. When the out-of-bag data score meets the preset conditions, stop training to obtain a trained random forest model. S306. Use the trained random forest model as the water prediction model.

[0013] In one embodiment, step three, which involves calculating the ash content prediction residual using the validation set, dynamically correcting the model parameters of the moisture prediction model based on the ash content prediction residual and the coal type of the original coal sample, and generating an optimized moisture model, includes: S307. Input the first four columns of features of the validation set into the ash prediction model to obtain the ash prediction value of each validation sample in the validation set. The first four columns of features of the validation set are principal component features associated with the near-infrared spectrum. S308. Extract the true ash content verification value from the test data of the original coal sample corresponding to the verification set, and calculate the ash content prediction residual by combining it with the ash content prediction value of each verification sample in the verification set. S309. Input the last four columns of features of the validation set into the moisture prediction model to predict moisture, and obtain the initial moisture prediction value of each validation sample in the validation set. The last four columns of features of the validation set are principal component features associated with the laser-induced breakdown spectrum. S310. Based on the ash content prediction residual, the initial moisture prediction value is dynamically corrected to obtain the corrected moisture value. S311. Taking the minimum root mean square error between the corrected moisture value and the true moisture value of the original coal sample corresponding to the validation set as the optimization objective, the parameters of the moisture prediction model are dynamically adjusted by grid search method, and the parameters of the moisture prediction model are optimized by grouping them according to the coal type of the original coal sample until the root mean square error meets the preset condition, so as to obtain the optimized moisture prediction model. S312. The water prediction model with the optimized parameters is used as the optimized water model.

[0014] In one embodiment, the formula for calculating the corrected moisture value includes: ; in, The corrected moisture value is... The initial moisture prediction value. The ash content prediction residual, This is a coal type correction factor. The preset basic correction coefficient, This is the ash residual sensitivity coefficient.

[0015] This application also provides a coal sample test value prediction device based on spectral analysis, the coal sample test value prediction device including: a spectral acquisition and matrix generation module, a weight optimization and sample screening module, a model training and model correction module, and a real-time spectral prediction module for new coal samples; The spectral acquisition and matrix generation module is used to acquire near-infrared spectrum and laser-induced breakdown spectrum of the original coal sample, and generate a feature fingerprint matrix by performing wavelet decomposition and dimensionality reduction processing on the near-infrared spectrum and the laser-induced breakdown spectrum. The weight optimization and sample screening module is used to optimize the feature weight vector of the feature fingerprint matrix based on a genetic algorithm, generate an optimized weight vector, and combine the optimized weight vector with the feature fingerprint matrix to obtain a reconstructed feature space. The gray value prediction is calculated through the reconstructed feature space, and the gray value prediction is compared with a preset gray value threshold to obtain a comparison result. Abnormal samples in the reconstructed feature space are removed according to the comparison result to obtain a screened feature matrix. The model training and model calibration module is used to divide the filtered feature matrix into a training set and a validation set, train the first XGBoost model and the random forest model respectively through the training set to obtain the ash content prediction model and the moisture prediction model, calculate the ash content prediction residual through the validation set, and dynamically calibrate the model parameters of the moisture prediction model based on the ash content prediction residual and the coal type of the original coal sample to generate an optimized moisture model. The real-time spectral prediction module for new coal samples is used to perform wavelet decomposition and dimensionality reduction on the real-time spectral data of new coal samples to obtain an initial feature vector. The initial feature vector is multiplied by the optimized weight vector to obtain a real-time feature vector. Based on the ash prediction model and the optimized moisture model, the real-time feature vector is predicted to obtain the real-time ash prediction value and the real-time moisture prediction value.

[0016] This application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program using the coal sample analysis value prediction method described in any of the above claims.

[0017] In summary, the coal sample analysis value prediction method, device, and computer equipment provided in this application, based on spectral analysis, acquire near-infrared and laser-induced breakdown spectra of the original coal sample during coal sample analysis and prediction. Then, wavelet decomposition and dimensionality reduction are performed to generate a feature fingerprint matrix, which effectively integrates the two spectral data and simplifies the dimensionality. This preserves the key spectral features of the organic components and inorganic elements of the coal sample, providing basic data for subsequent model training. Furthermore, by optimizing the feature weight vector of the feature fingerprint matrix using a genetic algorithm to reconstruct the feature space, and by comparing the ash content prediction with a preset threshold to remove abnormal samples, the key spectral features for predicting test values ​​can be highlighted. By eliminating interfering samples, the specificity of the feature space and the reliability of the data are improved. The filtered feature matrix is ​​divided into training and validation sets, and the first XGBoost model and the random forest model are trained respectively to obtain the ash content prediction model and the moisture prediction model. The moisture model parameters are dynamically corrected based on the ash content prediction residual and the coal type. This fully utilizes the complementarity of the two spectra and the intrinsic correlation between coal sample indicators, realizing targeted training and optimization of the model, and enhancing the model's adaptability and prediction stability for different coal types. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0019] Figure 1 A flowchart illustrating a method for predicting coal sample test values ​​based on spectral analysis, provided in the technical solutions of this application. Figure 2 A flowchart illustrating step one of a method for predicting coal sample test values ​​based on spectral analysis, provided in an embodiment of this application. Figure 3 A flowchart illustrating step two of a method for predicting coal sample test values ​​based on spectral analysis, provided in an embodiment of this application. Figure 4 A flowchart illustrating step three of a method for predicting coal sample test values ​​based on spectral analysis, provided in an embodiment of this application. Figure 5 A flowchart illustrating the calculation of fitness values ​​in step two of a method for predicting coal sample test values ​​based on spectral analysis provided in this application embodiment; Figure 6 A schematic diagram of the structure of a coal sample analysis value prediction device based on spectral analysis, provided in the technical solution of this application embodiment; The system includes a coal sample analysis value prediction device 300, a spectral acquisition and matrix generation module 301, a weight optimization and sample screening module 302, a model training and model correction module 303, and a real-time spectral prediction module for new coal samples 304. Detailed Implementation

[0020] This application provides a method, apparatus, and computer equipment for predicting coal sample test values, which addresses the technical shortcomings of existing LIBS or NIR single-spectral techniques in coal quality detection, such as susceptibility to interference from irrelevant features and insufficient prediction stability.

[0021] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the specific embodiments of this application are described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of this application. Therefore, this application is not limited to the specific embodiments disclosed below.

[0022] Please see Figures 1 to 5 This application provides a method for predicting coal sample test values ​​based on spectral analysis, including: Step 1: Collect near-infrared and laser-induced breakdown spectra of the original coal sample. Generate a feature fingerprint matrix by performing wavelet decomposition and dimensionality reduction on the near-infrared and laser-induced breakdown spectra.

[0023] Specifically, in step one, the original coal sample undergoes spectral acquisition to obtain its near-infrared spectrum and laser-induced breakdown spectrum. Near-infrared spectroscopy utilizes the vibrational absorption characteristics of molecules to reflect the molecular structure information of organic components and moisture in the coal sample. When near-infrared light irradiates the original coal sample, the molecules in the sample absorb light of specific wavelengths, resulting in vibrational transitions and forming characteristic absorption bands. By detecting the position and intensity of these characteristic absorption bands, relevant information about the organic components and moisture in the coal sample can be obtained. Laser-induced breakdown spectroscopy uses a high-energy laser pulse focused on the surface of the original coal sample, instantly generating high-temperature, high-pressure plasma in a localized area. During the plasma cooling process, a characteristic spectrum, namely the laser-induced breakdown spectrum, is emitted. This spectrum contains the compositional information of inorganic elements in the original coal sample and can be used to analyze indicators related to inorganic minerals, such as ash content.

[0024] Furthermore, wavelet decomposition is a multi-resolution analysis method capable of decomposing spectral signals into sub-band signals of different frequencies. The measured near-infrared spectrum and laser-induced breakdown spectrum can be decomposed into more easily processed sub-band signals by selecting appropriate wavelet basis functions and decomposition levels, respectively, thus removing some noise interference. Moreover, since the sub-band signals obtained after wavelet decomposition still contain a large amount of redundant information, the technical solution provided in this application employs dimensionality reduction methods such as principal component analysis to further reduce the feature dimension, obtaining dimensionality-reduced feature vectors and generating a feature fingerprint matrix. This resulting feature fingerprint matrix contains complementary information from the two spectra, providing a foundation for further coal quality testing.

[0025] Step 2: Optimize the feature weight vector of the feature fingerprint matrix based on the genetic algorithm to generate the optimized weight vector. Based on the optimized weight vector and the feature fingerprint matrix, the reconstructed feature space is obtained. The gray value prediction is calculated through the reconstructed feature space, and the gray value prediction is compared with the preset gray value threshold to obtain the comparison result. Based on the comparison result, abnormal samples in the reconstructed feature space are removed to obtain the filtered feature matrix.

[0026] Specifically, in coal sample analysis, a genetic algorithm is an optimization algorithm that simulates the process of biological evolution, gradually searching for the optimal solution through operations such as selection, crossover, and mutation. In the technical solution provided in the embodiments of this application, the optimization problem of feature weight vectors is transformed into the optimization objective of a genetic algorithm.

[0027] For example, first define a fitness function to evaluate the quality of the feature weight vector. This fitness function can be designed based on the accuracy of gray prediction, and a larger fitness function value indicates a better feature weight vector. Initialize the genetic algorithm population, with each individual representing a feature weight vector; the population size can be set according to the problem size and computational resources. Then, evaluate the fitness of each individual in the population, calculating the fitness value of each individual based on the fitness function; use selection methods such as roulette wheel selection to select individuals with high fitness values ​​to enter the next generation; then perform a crossover operation, randomly selecting two parent individuals and exchanging some gene segments according to a certain crossover probability to generate new offspring individuals. Finally, perform a mutation operation, randomly selecting certain gene loci in individuals and mutating them according to a certain mutation probability to introduce new genetic variations and increase population diversity.

[0028] Specifically, through multiple generations of genetic evolution, individuals in the population gradually approach the optimal solution, ultimately yielding an optimized weight vector. By combining this optimized weight vector with the feature fingerprint matrix, feature weights can be rationally allocated, highlighting important features and reducing interference from irrelevant features. In practical applications, models such as linear regression, support vector machines, and XGBoost are used to predict the grayscale values ​​of samples in the reconstructed feature space, obtaining grayscale predictions. By comparing these grayscale predictions with a preset grayscale threshold, and based on the comparison results, abnormal samples in the reconstructed feature space are further removed, resulting in a filtered feature matrix, thereby reducing the impact of abnormal data on subsequent model training.

[0029] Step 3: Divide the filtered feature matrix into a training set and a validation set. Train the first XGBoost model and the random forest model using the training set to obtain the ash content prediction model and the moisture prediction model. Calculate the ash content prediction residual using the validation set. Dynamically correct the model parameters of the moisture prediction model based on the ash content prediction residual and the coal type of the original coal sample to generate an optimized moisture model.

[0030] Specifically, the selected feature matrix is ​​divided into a training set and a validation set. The training set is used to train the model, and the validation set is used to evaluate the model's performance and dynamically adjust the model parameters. XGBoost is an ensemble learning algorithm based on gradient boosting. It constructs multiple decision trees, each optimizing the previous one to progressively reduce the model's loss function. When training the first XGBoost model on the training set, appropriate hyperparameters are set, such as learning rate, tree depth, and number of trees. These hyperparameters are then optimized using methods like cross-validation to obtain the grayscale prediction model. Random Forest is an ensemble learning algorithm based on decision trees. By constructing multiple decision trees and employing random sampling and feature selection, it improves the model's generalization ability and resistance to overfitting. Training the Random Forest model on the training set yields the final moisture prediction model.

[0031] Furthermore, the ash content prediction residual is calculated using the validation set. Samples from the validation set are input into the ash content prediction model to obtain predicted ash content values. The residual between the predicted and actual ash content values ​​is then calculated, reflecting the error in the model prediction. Since different coal types have different chemical compositions and physical properties, their impact on the moisture prediction model also varies. Therefore, in practical applications, the model parameters of the moisture prediction model can be dynamically adjusted based on the ash content prediction residual and the coal type of the original coal sample to generate an optimized moisture model, further improving the accuracy and stability of moisture prediction.

[0032] Step 4: Perform wavelet decomposition and dimensionality reduction on the real-time spectral data of the new coal sample to obtain the initial feature vector. Multiply the initial feature vector with the optimized weight vector to obtain the real-time feature vector. Based on the ash prediction model and the optimized moisture model, predict the real-time ash content and the real-time moisture content respectively.

[0033] Specifically, the near-infrared and laser-induced breakdown spectral data of the new coal sample undergo the same wavelet decomposition and dimensionality reduction processing as in step one to obtain an initial feature vector. This initial feature vector contains the key spectral features of the new coal sample. Subsequently, the initial feature vector is multiplied by the optimized weight vector obtained in step two. Through weight allocation, the real-time feature vector is focused on the key feature information for prediction. Finally, based on the ash prediction model and optimized moisture model obtained in step three, the real-time feature vector is predicted to obtain real-time ash and moisture prediction values, thereby enabling rapid and accurate detection of the new coal sample's test values.

[0034] Further optimizing the technical solution, in step one, near-infrared and laser-induced breakdown spectra of the original coal sample are collected. Wavelet decomposition and dimensionality reduction are then performed on the near-infrared and laser-induced breakdown spectra to generate a feature fingerprint matrix, including: S101. The diffuse reflectance spectrum in the 350-2500nm band of the original coal sample is collected by a near-infrared spectrometer to generate a near-infrared spectral matrix. S102. Atomic emission spectra in the 200-980nm band are collected from the original coal sample using a laser-induced breakdown spectrometer to generate a laser-induced breakdown spectral matrix. S103. The near-infrared spectral matrix and the laser-induced breakdown spectral matrix are decomposed into third-order wavelet derivatives using the db4 wavelet basis, and the corresponding third-order approximation coefficients are extracted. S104. The third-order approximation coefficients of the near-infrared spectral matrix and the third-order approximation coefficients of the laser-induced breakdown spectral matrix are concatenated column by column to obtain the joint characteristic matrix. S105. Perform principal component analysis to reduce the dimensionality of the joint feature matrix, select the top 8 principal components whose cumulative contribution rate is greater than the preset contribution threshold, and generate the feature fingerprint matrix.

[0035] Specifically, near-infrared spectroscopy, based on the overtone and combination frequency absorption of molecular vibrations, can effectively reflect the molecular structure information of organic components and moisture in coal samples. Furthermore, in the 350-2500 nm wavelength range, organic components in coal samples, such as hydrocarbons and moisture, produce characteristic absorption peaks. By detecting the position and intensity of these absorption peaks, information about the organic components and moisture content of the coal sample can be obtained. For example, the collected spectral data can be stored in matrix form, with each row representing the spectral data of one coal sample and each column corresponding to the spectral intensity value of a specific wavelength. In contrast, laser-induced breakdown spectrometry can collect atomic emission spectra in the 200-980 nm wavelength range. This band contains characteristic spectral lines of the main ash components in coal, such as Si, Al, Fe, and Ca. By detecting the position and intensity of these characteristic spectral lines, the composition information of inorganic elements in the coal sample can be obtained, which can then be used to analyze indicators such as ash content. Furthermore, the collected spectral data can be stored in matrix form, with each row representing the spectral data of one coal sample and each column corresponding to the spectral intensity value of a specific wavelength.

[0036] Furthermore, after obtaining the near-infrared spectral matrix and the laser-induced breakdown spectral matrix, a three-level wavelet decomposition can be performed using the db4 wavelet basis. The db4 wavelet basis is a Daubechies wavelet with good orthogonality and compact support, possessing excellent temporal localization characteristics and smoothness. It can effectively separate high-frequency noise (such as instrument electronic noise and ambient light interference) and low-frequency useful information (such as the overall trend of characteristic absorption peaks) in the spectral signal during the decomposition process. For example, a three-level wavelet transform is performed on each spectral curve (i.e., the row vector of the matrix) during the decomposition process. The first-level decomposition can split the spectral signal into approximation coefficients containing the main characteristic trends and detail coefficients containing high-frequency noise. The second-level decomposition can further split the first-level approximation coefficients, removing more subtle interferences. The third-level decomposition can focus on the deep extraction of low-frequency trends, ultimately yielding the third-level approximation coefficients. These third-level approximation coefficients can retain more than 90% of the characteristic information in the spectrum (such as absorption peak positions and relative intensities) and compress the dimension of the original spectrum from thousands of points to hundreds of points, reducing data redundancy for subsequent fusion processing.

[0037] Because the third-order approximation coefficients of near-infrared spectroscopy highlight the molecular characteristics of organic components and moisture, while the third-order approximation coefficients of laser-induced breakdown spectroscopy (LIBS) focus on the atomic characteristics of inorganic elements, the complementarity of these two spectra can be utilized. The third-order approximation coefficients of the near-infrared spectral matrix and the LIBS matrix can be concatenated column-wise to form a joint feature matrix. Each row of this matrix corresponds to a coal sample, and each column corresponds to a denoised spectral feature dimension, achieving a direct correlation between molecular and atomic features. For example, if the third-order approximation coefficients of near-infrared spectroscopy are 256-dimensional and those of LIBS are also 256-dimensional, the joint feature matrix will be 512-dimensional, preserving the independent information of both spectra while providing a fusion basis for subsequent dimensionality reduction processing.

[0038] Principal component analysis (PCA) is used to reduce the dimensionality of the joint feature matrix, further compressing the dimensions and enhancing key features. In the technical solution provided in this application, PCA is a dimensionality reduction method that projects the original data onto the principal component direction through linear transformation, removing redundant information and noise. Specifically, this PCA method can convert high-dimensional correlated features into low-dimensional uncorrelated principal components through orthogonal transformation. That is, the joint feature matrix can first be standardized to unify the variances of each feature and eliminate dimensional differences, and then the eigenvalues ​​and eigenvectors of the covariance matrix are solved. The eigenvalues ​​reflect the information contribution of the principal components, while the eigenvectors characterize the linear combination weights of the original features. A feature fingerprint matrix is ​​generated by selecting the top 8 principal components with a cumulative contribution rate greater than a preset contribution threshold, such as 85%. The cumulative contribution rate represents the proportion of original data information contained in these principal components. Principal components with a cumulative contribution rate greater than a preset contribution threshold are selected. This means that, based on the magnitude of the eigenvalues, the eigenvectors corresponding to the top 8 largest eigenvalues ​​are chosen as principal components. These top 8 principal components typically already contain most of the variation information from the original 512-dimensional features. Projecting the joint feature matrix onto the directions of these principal components yields a dimensionality-reduced feature fingerprint matrix. Each row of this feature fingerprint matrix represents a feature vector of a coal sample, and each column corresponds to a principal component. Furthermore, this approach maximizes the retention of key feature information for coal quality detection while compressing the data volume, providing high-quality input data for subsequent genetic algorithm optimization and model training.

[0039] In the technical solution provided in this application embodiment, step two involves optimizing the feature weight vector of the feature fingerprint matrix based on a genetic algorithm, generating an optimized weight vector, and combining the optimized weight vector with the feature fingerprint matrix to obtain a reconstructed feature space, including: S201. Initialize the feature weight vector of the feature fingerprint matrix and generate multiple random vectors. The element values ​​of each random vector follow a uniform distribution of 0-1 and the sum of the element values ​​is 1. S202. Extract the true ash content from the test data of the original coal sample and construct an ash content label set.

[0040] Furthermore, in S202, for each random vector, the fitness value is calculated through the following steps: S2021. Multiply the random vector element-wise with the feature fingerprint matrix to generate a temporary feature space; S2022. The temporary feature space and gray label set are trained using the second XGBoost model to obtain the temporary gray prediction model. S2023. Predict the temporary feature space using a temporary ash prediction model, and calculate the root mean square error of ash prediction between the predicted value and the true ash value of the ash label set. S2024. The reciprocal of the root mean square error of ash prediction is used as the fitness value of the corresponding random vector. S2025. Based on each random vector and its corresponding fitness value, perform selection, crossover, and mutation operations using a genetic algorithm according to a preset number of iterations to obtain the final population. S2026. Extract the vector with the highest fitness value from the final population and use the vector with the highest fitness value as the optimization weight vector. S2027. Multiply the optimized weight vector and the feature fingerprint matrix element by element to obtain the reconstructed feature space.

[0041] Specifically, when initializing the feature weight vector of the feature fingerprint matrix, multiple random vectors can be generated as the initial population for the genetic algorithm. Since the feature fingerprint matrix is ​​8-dimensional (corresponding to 8 principal components), each random vector contains 8 elements and must satisfy two constraints: the element values ​​must follow a uniform distribution of 0-1 to ensure the weights are non-negative and within a comparable order of magnitude; and the sum of the element values ​​must be 1 to avoid misjudging the feature contribution due to differences in absolute values.

[0042] In practical applications, the initial population size can be set to 50-100 vectors to ensure population diversity and provide sufficient solution space for subsequent evolutionary optimization. Furthermore, the true ash content values ​​can be extracted from the original coal sample test data to construct an ash label set. This label set corresponds one-to-one with the samples in the feature fingerprint matrix and is used as a "benchmark true value" to evaluate the quality of feature weights. By comparing the difference between the model's predicted values ​​and the true values, the rationality of the allocation of feature importance by different weight vectors can be quantified. Specifically, for each random vector, a temporary feature space can be generated by multiplying the random vector element-wise with the feature fingerprint matrix. The original features in the matrix can be scaled by the weights of the random vectors. That is, dimensions with higher weights, such as principal components that are sensitive to gray, can be amplified in the temporary feature space, while dimensions with lower weights, such as redundant features, are suppressed, thereby simulating the dataset shape under different feature contribution levels. When training the temporary feature space and gray label set using the second XGBoost model, the model parameters remain fixed (e.g., learning rate 0.1, tree depth 6, iteration count 100) to ensure consistent evaluation benchmarks for different random vectors. One possible implementation method is that the second XGBoost model can minimize the prediction error by constructing an ensemble model of multiple decision trees and utilizing gradient descent. Its ability to capture nonlinear relationships in features effectively uncovers key patterns amplified by weights in the temporary feature space. The resulting temporary gray prediction model can then output gray prediction values ​​for samples in the temporary feature space. Subsequently, the root mean square error (RMSE) of gray prediction between the predicted value and the true gray value in the gray label set can be calculated. This error metric reflects the overall deviation between the predicted and true values; a smaller error indicates a more reasonable allocation of features by the current weight vector. Furthermore, by using the reciprocal of the RMSE as the fitness value, weight vectors with better prediction performance receive higher fitness, thus conforming to the evolutionary logic of survival of the fittest in genetic algorithms. Specifically, based on the fitness values ​​of each random vector, the genetic algorithm can achieve iterative optimization of the population through selection, crossover, and mutation operations. The selection operation can employ a roulette wheel selection method, where vectors with higher fitness values ​​have a greater probability of being selected as parents, ensuring the preservation of high-quality genes. The crossover operation involves exchanging genes between two selected parent vectors at a random crossover point (e.g., the third dimension), generating offspring vectors; that is, new weight combinations can be produced through gene recombination. The mutation operation involves randomly changing the value of a certain element in the crossover offspring vector with a small probability, such as 5%, while satisfying the above constraints, preventing the population from getting trapped in local optima. In practical applications, these operations can be repeated for a preset number of iterations. After each iteration, the average fitness of the population gradually increases, eventually leading to a converged final population. From the final population, the vector with the highest fitness value can be extracted as the optimized weight vector. This vector represents the optimal feature allocation scheme selected through multiple generations of evolution, and its corresponding temporary feature space has the smallest root mean square error in gray prediction. By multiplying the optimized weight vector element-wise with the feature fingerprint matrix, the reconstructed feature space can be obtained. This reconstructed feature space highlights the most critical dimension for gray prediction through weight optimization and suppresses irrelevant interference, providing more targeted input data for subsequent abnormal sample removal and model training.

[0043] In the technical solution provided in this application embodiment, step two involves reconstructing the feature space into an 8-dimensional feature space, calculating the gray value estimate through the reconstructed feature space, comparing the gray value estimate with a preset gray value threshold to obtain a comparison result, and removing abnormal samples from the reconstructed feature space based on the comparison result to obtain a filtered feature matrix. This includes the following steps: S203. Extract the first four columns of features from the reconstructed feature space to generate a gray feature submatrix. The first four columns of features are principal component features associated with near-infrared spectroscopy. S204. Input the ash feature submatrix into the temporary ash prediction model to perform prediction calculations and obtain the ash prediction value corresponding to each sample in the reconstructed feature space. S205. Compare the estimated ash content values ​​with the preset ash content threshold. When the estimated ash content value is greater than the preset ash content threshold, mark the corresponding sample as an abnormal sample and obtain the comparison results. S206. Based on the comparison results, remove the row vectors of abnormal samples from the reconstructed feature space to obtain the filtered row vectors. Arrange the filtered row vectors in their original order to obtain the filtered feature matrix.

[0044] Specifically, the reconstructed feature space is an 8-dimensional feature matrix optimized by a genetic algorithm. Each dimension of the feature matrix has been weighted to highlight key information for predicting coal quality indicators. The first four columns correspond to principal component features associated with near-infrared spectroscopy, reflecting subtle changes in ash content. Based on this, extracting the first four columns from the reconstructed feature space to generate an ash feature submatrix allows focusing on the feature dimensions most sensitive to ash prediction. By reducing interference from irrelevant features, the accuracy of ash prediction calculations can be improved.

[0045] Subsequently, the ash feature sub-matrix is ​​input into a temporary ash prediction model trained during the genetic algorithm optimization phase for prediction calculation. This model uses the decision tree structure and splitting threshold learned during the training phase to reason about each sample (i.e., each row of the matrix) in the ash feature sub-matrix. For example, for the ash feature sub-vector of a sample, it judges the size of the feature value and the threshold of the decision tree node layer by layer, and finally outputs the ash prediction value of the sample. In this process, the model can capture the nonlinear relationship of the first four columns of features, so that the ash prediction value can accurately reflect the actual ash level of the sample, providing a reliable basis for the identification of abnormal samples. Furthermore, a preset ash threshold can be set based on the ash distribution characteristics of the original coal sample, for example, by statistically determining the 95th percentile of the true ash values ​​of all samples. When the ash prediction value of a sample exceeds this threshold, it may be a high-ash impurity sample or a sample with abnormal spectral acquisition (such as spectral distortion caused by coal sample surface contamination). Therefore, the sample can be marked as an abnormal sample, and the corresponding comparison result is abnormal; otherwise, it is marked as a normal sample.

[0046] When removing abnormal samples based on the comparison results, if the k-th sample is marked as abnormal, all elements in the k-th row of the reconstructed feature space are deleted. The remaining row vectors are arranged in their original order to form the filtered feature matrix, which still has 8 columns (feature dimension unchanged), but the number of rows (sample quantity) is reduced according to the proportion of abnormal samples. This avoids the extreme feature values ​​distorting the model's learning of the normal sample feature distribution. Furthermore, the distribution of the retained samples in the 8-dimensional feature space is more concentrated, and the correlation between features and gray content and moisture is further improved, providing a high-quality data foundation for subsequent training and validation set partitioning and model training.

[0047] In the technical solution provided in this application embodiment, in step three, the filtered feature matrix is ​​an 8-dimensional feature matrix. The filtered feature matrix is ​​divided into a training set and a validation set. The first XGBoost model and the random forest model are trained using the training set to obtain the gray content prediction model and the moisture prediction model, including: S301. Using stratified sampling, the selected feature matrix is ​​divided into training set and validation set according to the ash content range. The ratio of the number of samples in the training set to the number of samples in the validation set is 6:2. The ash content range is divided according to the metamorphism degree of the original coal sample. S302. Extract the first four columns of features from the training set and use the first four columns of features as gray training data. The first four columns of features are principal component features associated with near-infrared spectroscopy. S303. Based on the ash training data and the corresponding original coal sample ash training true value, train the first XGBoost model, and use the optimized parameters in the training process with 5-fold cross-validation according to the validation set to obtain the trained first XGBoost model. Use the trained first XGBoost model as the ash prediction model. S304. Extract the last four columns of features from the training set and use the last four columns of features as water training data. The last four columns of features are principal component features associated with laser-induced breakdown spectrum. S305. Based on the moisture training data and the actual moisture values ​​of the corresponding original coal samples, train a random forest model and evaluate the model performance of the random forest model using out-of-bag data. When the out-of-bag data score meets the preset conditions, stop training and obtain the trained random forest model. S306. Use the trained random forest model as a water prediction model.

[0048] Specifically, coal samples with different metamorphic degrees, such as lignite, bituminous coal, and anthracite, exhibit significant differences in ash content distribution ranges. For instance, lignite typically has low ash content, while anthracite's ash content fluctuates considerably. Therefore, ash content ranges can be subdivided based on the metamorphic degree of the original coal sample. For example, lignite ash content ranges can be divided into 5%-15% and 15%-25%, bituminous coal into 10%-20%, 20%-30%, and 30%-40%, and anthracite into 15%-25% and 25%-35%. Samples within each range are randomly assigned to the training and validation sets in a 6:2 ratio to ensure consistent sample proportions across the two datasets (e.g., if 30% of the samples in the training set have 10%-20% ash content, the same proportion in the validation set should also be maintained at 30%). This partitioning method avoids the problem of excessive concentration of certain coal types in the validation set that might occur with random sampling, ensuring that the validation set accurately reflects the distribution characteristics of the training set and provides an objective evaluation benchmark for model parameter optimization.

[0049] Since the first four columns of features in the training set are principal component features related to near-infrared spectroscopy, these features, after weight optimization, have effectively integrated key information related to ash content in the near-infrared spectrum. Therefore, the first four columns of features can be extracted from the training set as ash training data. For example, the first principal component in the first four columns contains absorption information around 1900 nm in the near-infrared spectrum, which is significantly positively correlated with the content of clay minerals (which mainly contribute to ash content) in coal. The second principal component reflects the absorption differences around 2200 nm, which can distinguish the ash composition of coal samples with different metamorphic degrees.

[0050] Therefore, training the grayscale model with the first four columns of features can reduce the interference from the latter four columns of laser-induced breakdown spectral features (which are more correlated with moisture), allowing the model to focus more on learning the intrinsic mapping relationship between grayscale and near-infrared features. Illustratively, when training the first XGBoost model based on grayscale training data and corresponding grayscale training ground values, the initial model parameters can be set to a learning rate of 0.1, a tree depth of 5-7, and a number of estimators of 100-200. Furthermore, during training, 5-fold cross-validation can be used to optimize the parameters. The training set is randomly divided into 5 mutually exclusive subsets. Each time, 4 subsets are used as the training subset and 1 subset as the validation subset. This process is repeated 5 times, and the mean squared error is calculated. The parameters are then adjusted with the goal of minimizing the mean squared error. The final trained first XGBoost model can stably capture the nonlinear patterns of the first four columns of features in the grayscale training data (such as the accurate prediction of high-grayscale samples by feature interaction terms).

[0051] Specifically, the last four columns of features in the training set correspond to principal component features associated with laser-induced breakdown spectroscopy. This spectroscopic technique, by detecting the characteristic spectral lines of hydrogen in coal, can directly reflect the moisture content level. The last four columns of principal components, after weight optimization, have amplified the characteristic signals related to hydrogen. Therefore, these last four columns of features can be extracted from the training set as moisture training data. For example, the fifth principal component integrates the intensity information of the hydrogen spectral lines in the laser-induced breakdown spectrum, while the sixth principal component is associated with the characteristic peaks of oxygen (which combines with hydrogen to form moisture). The combination of these two components can effectively distinguish the difference in content between free water and bound water.

[0052] Therefore, training the moisture model with the last four columns of features can fully utilize the sensitivity of laser-induced breakdown spectroscopy to elemental composition, thereby improving the specificity of moisture prediction. Furthermore, when training the random forest model based on the moisture training data and corresponding real moisture values, the initial parameters can be set to 200-300 decision trees, 8-10 tree depths, and 5-8 minimum split samples. Specifically, during training, out-of-bag data can be used to evaluate performance. That is, when constructing each tree in the random forest, approximately 1 / 3 of the samples are not used in training (out-of-bag samples), and the prediction error of these samples is used to calculate the out-of-bag score. When this score is greater than 0.9 and shows no significant improvement after 5 consecutive iterations, training can be stopped. At this point, the model has fully learned the association pattern between moisture and the last four columns of features, and the trained random forest model can be used as the moisture prediction model.

[0053] In the technical solution provided in this application embodiment, step three involves calculating the ash content prediction residual using a validation set, dynamically correcting the model parameters of the moisture prediction model based on the ash content prediction residual and the coal type of the original coal sample, and generating an optimized moisture model, including: S307. Input the first four columns of features of the validation set into the ash prediction model to obtain the ash prediction value of each validation sample in the validation set. The first four columns of features of the validation set are the principal component features associated with the near-infrared spectrum. S308. Extract the true ash content verification value from the test data of the original coal samples corresponding to the verification set, and calculate the ash content prediction residual by combining it with the ash content prediction value of each verification sample in the verification set. S309. Input the last four columns of features of the validation set into the moisture prediction model to predict moisture, and obtain the initial moisture prediction value of each validation sample in the validation set. The last four columns of features of the validation set are principal component features associated with laser-induced breakdown spectrum. S310. Dynamically correct the initial moisture prediction value based on the ash content prediction residual to obtain the corrected moisture value. S311. With the root mean square error between the corrected moisture value and the true moisture value of the original coal sample corresponding to the validation set as the optimization objective, the parameters of the moisture prediction model are dynamically adjusted by the grid search method, and the parameters of the moisture prediction model are optimized by grouping them according to the coal type of the original coal sample until the root mean square error meets the preset condition, thus obtaining the optimized moisture prediction model. S312. Use the optimized moisture prediction model as the optimized moisture model.

[0054] Specifically, the first four columns of features in the validation set are completely identical in dimension to the features of the gray training data during the training phase; they are all principal component features associated with near-infrared spectroscopy. For example, by inputting the first four columns of feature vectors of a sample in the validation set into the gray prediction model, the model can call the trained decision tree structure, determine the relationship between feature values ​​and node thresholds layer by layer, and finally output the gray prediction value of the sample. Furthermore, because the validation set is partitioned using stratified sampling, its sample distribution is highly consistent with that of the training set. Therefore, the gray prediction value can accurately reflect the actual gray level of the validation sample, providing effective benchmark data for subsequent residual calculation.

[0055] After extracting the true ash content validation value from the original coal sample test data corresponding to the validation set, the difference between the true ash content validation value and the predicted ash content value can be calculated as the ash content prediction residual. This residual essentially reflects the prediction bias of the ash content prediction model for the sample's ash content. Since there is a certain negative correlation between ash content and moisture in coal (e.g., high-ash coal samples usually have low moisture content), this bias can indirectly reflect the potential error trend in moisture prediction. For example, when the residual is positive (i.e., the actual ash content is higher than the predicted value), the actual moisture content of the corresponding sample may be lower than the predicted value based on the current moisture model. Therefore, this residual can serve as an important reference indicator for moisture prediction correction.

[0056] Furthermore, when the last four columns of features from the validation set are input into the moisture prediction model to obtain the initial moisture prediction value, these last four columns are principal component features associated with laser-induced breakdown spectroscopy, consistent with the feature dimensions of the moisture training data during the training phase. Subsequently, the moisture prediction model can output the initial moisture prediction value for each validation sample by integrating the prediction results of multiple decision trees. This value reflects the model's preliminary judgment on moisture based on existing parameters, but does not yet consider the potential bias caused by the ash prediction residual. Therefore, the initial moisture prediction value can be dynamically corrected based on the ash prediction residual.

[0057] In the technical solution provided in this application embodiment, the corrected moisture value can be calculated using the following formula: ; in, The corrected moisture value is... The initial moisture prediction value. The ash content prediction residual, This is a coal type correction factor. The preset basic correction coefficient, This is the ash residual sensitivity coefficient.

[0058] The above formula is based on the different correlations between ash and moisture content in different coal types. By using values ​​differentiated by coal type, the calibration can better reflect the actual coal quality characteristics. The optimization objective is to minimize the root mean square error between the calibrated moisture value and the true moisture verification value. When dynamically adjusting the moisture prediction model parameters using a grid search method, group optimization can also be performed based on coal type. Illustratively, the validation set can first be divided into three subsets based on coal type: lignite, bituminous coal, and anthracite. A parameter search range can then be set for each subset.

[0059] The grid search method iterates through all parameter combinations, calculates the root mean square error (RMSE) for each combination, and selects the parameter with the smallest RMSE as the optimal parameter for that coal type. This parameter adjustment process can be iterative until the RMSE meets a preset condition (e.g., less than 0.5%) or the maximum number of iterations is reached. Finally, the optimal parameters for each coal type are integrated into the moisture prediction model to form a parameter-optimized moisture prediction model, i.e., the optimized moisture model. This model has customized parameters for the characteristics of different coal types, which can further improve prediction accuracy and provide higher-precision model support for real-time moisture prediction of new coal samples.

[0060] Please refer to this section for further information. Figure 6 This application also provides a spectral analysis-based coal sample analysis value prediction device 300 for implementing the above-mentioned spectral analysis-based coal sample analysis value prediction method. The solution provided by the coal sample analysis value prediction device 300 is similar to the solution described in the above method, including: The spectral acquisition and matrix generation module 301 is used to acquire near-infrared spectrum and laser-induced breakdown spectrum of the original coal sample. By performing wavelet decomposition and dimensionality reduction on the near-infrared spectrum and laser-induced breakdown spectrum, a feature fingerprint matrix is ​​generated. The weight optimization and sample screening module 302 is used to optimize the feature weight vector of the feature fingerprint matrix based on the genetic algorithm, generate the optimized weight vector, and combine the optimized weight vector with the feature fingerprint matrix to obtain the reconstructed feature space. The gray value prediction is calculated through the reconstructed feature space, and the gray value prediction is compared with the preset gray value threshold to obtain the comparison result. Abnormal samples in the reconstructed feature space are removed according to the comparison result to obtain the screened feature matrix. The model training and model calibration module 303 is used to divide the filtered feature matrix into a training set and a validation set. The first XGBoost model and the random forest model are trained respectively through the training set to obtain the ash content prediction model and the moisture prediction model. The ash content prediction residual is calculated through the validation set. Based on the ash content prediction residual and the coal type of the original coal sample, the model parameters of the moisture prediction model are dynamically corrected to generate an optimized moisture model. The real-time spectral prediction module 304 for new coal samples is used to perform wavelet decomposition and dimensionality reduction on the real-time spectral data of new coal samples to obtain an initial feature vector. The initial feature vector is multiplied by the optimized weight vector to obtain a real-time feature vector. Based on the ash prediction model and the optimized moisture model, the real-time feature vector is predicted to obtain the real-time ash prediction value and the real-time moisture prediction value.

[0061] This application also provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the coal sample analysis value prediction method based on spectral analysis of this application. A multi-core processor is preferred to improve the system's parallel processing capability. The memory provides sufficient temporary storage space to support program execution and data processing. The memory capacity should be large enough to accommodate a large amount of supply information and computational tasks.

[0062] In summary, the coal sample analysis value prediction method, device, and computer equipment provided in this application, based on spectral analysis, acquire near-infrared and laser-induced breakdown spectra of the original coal sample during coal sample analysis and prediction. Then, wavelet decomposition and dimensionality reduction are performed to generate a feature fingerprint matrix, which effectively integrates the two spectral data and simplifies the dimensionality. This preserves the key spectral features of the organic components and inorganic elements of the coal sample, providing basic data for subsequent model training. Furthermore, by optimizing the feature weight vector of the feature fingerprint matrix using a genetic algorithm to reconstruct the feature space, and by comparing the ash content prediction with a preset threshold to remove abnormal samples, the key spectral features for predicting test values ​​can be highlighted. By eliminating interfering samples, the specificity of the feature space and the reliability of the data are improved. The filtered feature matrix is ​​divided into training and validation sets, and the first XGBoost model and the random forest model are trained respectively to obtain the ash content prediction model and the moisture prediction model. The moisture model parameters are dynamically corrected based on the ash content prediction residual and the coal type. This fully utilizes the complementarity of the two spectra and the intrinsic correlation between coal sample indicators, realizing targeted training and optimization of the model, and enhancing the model's adaptability and prediction stability for different coal types.

[0063] The technical features of the embodiments described above can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification. Furthermore, other implementation methods can be derived from the above embodiments, allowing for structural and logical substitutions and changes without departing from the scope of this disclosure.

[0064] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for predicting assay values of a coal sample based on spectral analysis, characterized by, The method for predicting coal sample test values ​​includes: Step 1: Collect near-infrared spectrum and laser-induced breakdown spectrum of the original coal sample. Generate a feature fingerprint matrix by performing wavelet decomposition and dimensionality reduction on the near-infrared spectrum and the laser-induced breakdown spectrum. Step 2: Optimize the feature weight vector of the feature fingerprint matrix based on the genetic algorithm to generate an optimized weight vector. Reconstruct the feature space based on the optimized weight vector and the feature fingerprint matrix. Calculate the gray value estimate through the reconstructed feature space and compare the gray value estimate with a preset gray value threshold to obtain a comparison result. Remove abnormal samples from the reconstructed feature space based on the comparison result to obtain the filtered feature matrix. Step 3: Divide the filtered feature matrix into a training set and a validation set. Train the first XGBoost model and the random forest model on the training set to obtain the ash content prediction model and the moisture prediction model. Calculate the ash content prediction residual through the validation set. Dynamically correct the model parameters of the moisture prediction model based on the ash content prediction residual and the coal type of the original coal sample to generate an optimized moisture model. Step 4: Perform wavelet decomposition and dimensionality reduction on the real-time spectral data of the new coal sample to obtain an initial feature vector. Multiply the initial feature vector with the optimized weight vector to obtain a real-time feature vector. Based on the ash prediction model and the optimized moisture model, predict the real-time feature vector to obtain the real-time ash prediction value and the real-time moisture prediction value.

2. The coal sample assay value prediction method according to claim 1, characterized by, In step one, near-infrared and laser-induced breakdown spectra of the original coal sample are collected. A feature fingerprint matrix is ​​generated by performing wavelet decomposition and dimensionality reduction on the near-infrared and laser-induced breakdown spectra, including: S101. The diffuse reflectance spectrum in the 350-2500nm band of the original coal sample is collected by a near-infrared spectrometer to generate a near-infrared spectral matrix; S102. The atomic emission spectrum in the 200-980nm band of the original coal sample is collected by a laser-induced breakdown spectrometer to generate a laser-induced breakdown spectral matrix. S103. The near-infrared spectral matrix and the laser-induced breakdown spectral matrix are decomposed into third-level wavelet bases using the db4 wavelet basis, and the corresponding third-level approximation coefficients are extracted. S104. The third-order approximation coefficients of the near-infrared spectral matrix and the third-order approximation coefficients of the laser-induced breakdown spectral matrix are concatenated column by column to obtain the joint feature matrix. S105. Perform principal component analysis to reduce the dimensionality of the joint feature matrix, and select the top 8 principal components whose cumulative contribution rate is greater than the preset contribution threshold to generate the feature fingerprint matrix.

3. The coal sample assay value prediction method according to claim 1, characterized by, In step two, optimizing the feature weight vector of the feature fingerprint matrix using a genetic algorithm to generate an optimized weight vector, and reconstructing the feature space based on the optimized weight vector and the feature fingerprint matrix, includes: S201. Initialize the feature weight vector of the feature fingerprint matrix, generate several random vectors, and the element values ​​of each random vector follow a uniform distribution of 0-1 and the sum of the element values ​​is 1. S202. Extract the true ash content from the test data of the original coal sample and construct an ash content label set.

4. The coal sample property prediction method according to claim 3, characterized by, For each of the aforementioned random vectors, the fitness value is calculated using the following procedure: S2021. Multiply the random vector element-wise with the feature fingerprint matrix to generate a temporary feature space; S2022. The temporary feature space and the gray label set are trained using the second XGBoost model to obtain a temporary gray prediction model. S2023. The temporary feature space is predicted using the temporary gray prediction model, and the root mean square error of gray prediction between the predicted value and the true gray value of the gray label set is calculated. S2024. The reciprocal of the root mean square error of the ash prediction is used as the fitness value of the corresponding random vector; S2025. Based on each random vector and the corresponding fitness value, perform selection, crossover, and mutation operations according to the genetic algorithm according to a preset number of iterations to obtain the final population. S2026. Extract the vector with the highest fitness value from the final population, and use the vector with the highest fitness value as the optimization weight vector; S2027. Multiply the optimized weight vector element-wise with the feature fingerprint matrix to obtain the reconstructed feature space.

5. The coal sample analysis value prediction method according to claim 3 or 4, characterized by, In step two, the reconstructed feature space is an 8-dimensional feature space. A gray value prediction is calculated using this reconstructed feature space, and the gray value prediction is compared with a preset gray value threshold to obtain a comparison result. Based on the comparison result, abnormal samples in the reconstructed feature space are removed to obtain a filtered feature matrix, including: S203. Extract the first four columns of features from the reconstructed feature space to generate a gray feature submatrix, wherein the first four columns of features are principal component features associated with the near-infrared spectrum; S204. Input the gray feature submatrix into the temporary gray prediction model to perform prediction calculation, and obtain the gray prediction value corresponding to each sample in the reconstructed feature space. S205. Compare the ash content estimates of each sample with the preset ash content threshold. When the ash content estimate is greater than the preset ash content threshold, mark the corresponding sample as the abnormal sample to obtain the comparison result. S206. Based on the comparison results, remove the row vectors of the abnormal samples from the reconstructed feature space to obtain the filtered row vectors. Arrange the filtered row vectors in their original order to obtain the filtered feature matrix.

6. The coal sample assay value prediction method according to claim 1, characterized by, In step three, the filtered feature matrix is ​​an 8-dimensional feature matrix. The filtered feature matrix is ​​divided into a training set and a validation set. The training set is used to train the first XGBoost model and the random forest model respectively, resulting in a gray content prediction model and a moisture prediction model, including: S301. Using stratified sampling, the filtered feature matrix is ​​divided into the training set and the validation set according to the ash content range. The ratio of the number of samples in the training set to the number of samples in the validation set is 6:

2. The ash content range is divided according to the metamorphism degree of the original coal sample. S302. Extract the first four columns of features from the training set, and use the first four columns of features as gray training data. The first four columns of features are principal component features associated with the near-infrared spectrum. S303. Based on the ash training data and the corresponding ash training true value of the original coal sample, train the first XGBoost model, and according to the validation set, use the optimized parameters in the 5-fold cross-validation training process to obtain the trained first XGBoost model, and use the trained first XGBoost model as the ash prediction model. S304. Extract the last four columns of features from the training set, and use the last four columns of features as water training data. The last four columns of features are principal component features associated with the laser-induced breakdown spectrum. S305. Based on the moisture training data and the actual moisture value of the corresponding original coal sample, train a random forest model and evaluate the model performance of the random forest model using out-of-bag data. When the out-of-bag data score meets the preset conditions, stop training to obtain a trained random forest model. S306. Use the trained random forest model as the water prediction model.

7. The coal sample property prediction method according to claim 6, characterized by, In step three, the step of calculating the ash content prediction residual using the validation set, and dynamically correcting the model parameters of the moisture prediction model based on the ash content prediction residual and the coal type of the original coal sample to generate an optimized moisture model includes: S307. Input the first four columns of features of the validation set into the ash prediction model to obtain the ash prediction value of each validation sample in the validation set. The first four columns of features of the validation set are principal component features associated with the near-infrared spectrum. S308. Extract the true ash content verification value from the test data of the original coal sample corresponding to the verification set, and calculate the ash content prediction residual by combining it with the ash content prediction value of each verification sample in the verification set. S309. Input the last four columns of features of the validation set into the moisture prediction model to predict moisture, and obtain the initial moisture prediction value of each validation sample in the validation set. The last four columns of features of the validation set are principal component features associated with the laser-induced breakdown spectrum. S310. Dynamically correct the initial moisture prediction value based on the ash content prediction residual to obtain the corrected moisture value. S311. Taking the minimum root mean square error between the corrected moisture value and the true moisture value of the original coal sample corresponding to the validation set as the optimization objective, the parameters of the moisture prediction model are dynamically adjusted by grid search method, and the parameters of the moisture prediction model are optimized by grouping them according to the coal type of the original coal sample until the root mean square error meets the preset condition, so as to obtain the optimized moisture prediction model. S312. The water prediction model with the optimized parameters is used as the optimized water model.

8. The coal sample property prediction method according to claim 7, characterized by, The formula for calculating the corrected moisture value is as follows: ; wherein, is the corrected moisture value, is the initial moisture prediction value, is the ash prediction residual, is a coal type correction factor, is a preset base correction coefficient, is an ash residual sensitivity coefficient.

9. A coal sample assay value prediction device based on spectral analysis, characterized by, The coal sample test value prediction device includes: a spectral acquisition and matrix generation module, a weight optimization and sample screening module, a model training and model calibration module, and a real-time spectral prediction module for new coal samples. The spectral acquisition and matrix generation module is used to acquire near-infrared spectrum and laser-induced breakdown spectrum of the original coal sample, and generate a feature fingerprint matrix by performing wavelet decomposition and dimensionality reduction processing on the near-infrared spectrum and the laser-induced breakdown spectrum. The weight optimization and sample screening module is used to optimize the feature weight vector of the feature fingerprint matrix based on a genetic algorithm, generate an optimized weight vector, and combine the optimized weight vector with the feature fingerprint matrix to obtain a reconstructed feature space. The gray value prediction is calculated through the reconstructed feature space, and the gray value prediction is compared with a preset gray value threshold to obtain a comparison result. Abnormal samples in the reconstructed feature space are removed according to the comparison result to obtain a screened feature matrix. The model training and model calibration module is used to divide the filtered feature matrix into a training set and a validation set, train the first XGBoost model and the random forest model respectively through the training set to obtain the ash content prediction model and the moisture prediction model, calculate the ash content prediction residual through the validation set, and dynamically calibrate the model parameters of the moisture prediction model based on the ash content prediction residual and the coal type of the original coal sample to generate an optimized moisture model. The real-time spectral prediction module for new coal samples is used to perform wavelet decomposition and dimensionality reduction on the real-time spectral data of new coal samples to obtain an initial feature vector. The initial feature vector is multiplied by the optimized weight vector to obtain a real-time feature vector. Based on the ash prediction model and the optimized moisture model, the real-time feature vector is predicted to obtain the real-time ash prediction value and the real-time moisture prediction value. 10.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-9. When the processor executes the computer program, it uses the coal sample test value prediction method according to any one of claims 1 to 8.