Quality parameter detection model construction method based on multi-source domain adaptation

By constructing a quality parameter detection model that adapts to multiple source domains and using feature extraction and domain alignment modules to dynamically adjust source domain weights, the problem of reduced cross-domain generalization ability caused by differences in spectral distribution among multiple source domains in mineral detection is solved, and efficient detection without a target domain is achieved.

CN121662218APending Publication Date: 2026-03-13CHINA CERTIFICATION & INSPECTION (GROUP) CO LTD HEBEI BRANCH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In mineral quality testing, existing technologies suffer from reduced cross-domain generalization ability due to differences in spectral distribution among multiple source domains, and are difficult to achieve effective prediction in the absence of target domain data.

Method used

A quality parameter detection model based on multi-source domain adaptation is constructed. The feature extraction module extracts source domain features and domain-invariant features. Combined with the source domain weight adjustment module and the domain alignment module, the contribution weights of each source domain training set are dynamically adjusted. Furthermore, a multi-layer MLP is used to perform nonlinear abstraction of spectral features and domain adversarial learning to achieve cross-domain transfer prediction.

Benefits of technology

In the absence of target domain spectral data, it improves the robustness and accuracy of quality parameter detection, solves the problem of spectral distribution heterogeneity among multiple source domains, avoids negative migration, and achieves effective cross-domain regression prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121662218A_ABST
    Figure CN121662218A_ABST
Patent Text Reader

Abstract

The invention discloses a quality parameter detection model construction method based on multi-source domain adaptation, and relates to the technical field of spectral analysis, the method comprises the following steps: constructing a quality parameter detection basic model, and constructing a multi-source spectral data set for training the quality parameter detection basic model; during model training, extracting source domain features and domain invariant features of the spectral data, and respectively predicting to obtain a source domain prediction result and a domain invariant prediction result; dynamically adjusting the contribution weight of each source domain training set to model training based on the performance of the domain invariant prediction result on each source domain training set; and determining a loss function of model training based on the domain invariant feature, the source domain prediction result and the domain invariant prediction result in combination with the contribution weight, and training by using the loss function to obtain a quality parameter detection model. According to the method, the problem of multi-source spectrum cross-domain regression prediction can be effectively solved under the condition of no target domain spectral data, and the robustness and accuracy of quality parameter detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of spectral analysis technology, and in particular to a method for constructing a quality parameter detection model based on multi-source domain adaptation. Background Technology

[0002] In recent years, non-destructive analytical techniques such as laser-induced breakdown spectroscopy (LIBS), near-infrared spectroscopy (NIRS), and X-ray fluorescence spectroscopy (XRF) have been widely used in mineral quality testing due to their high detection speed and efficiency. However, actual industrial conditions are complex, and the sampling distance between the spectrometer and the mineral sample is often difficult to maintain stably. Variations in sampling distance can lead to significant differences in signal-to-noise ratio, scattering noise, and optical path conditions among different source domains, causing domain shifts in the spectral distribution. This results in inconsistencies between the spectral distributions of the source and target domains, significantly reducing the model's cross-domain generalization ability.

[0003] To mitigate the impact of domain shift, various transfer learning and calibration methods have been proposed. For example, direct normalization (DS) and piecewise direct normalization (PDS) methods in chemometrics establish linear mappings through "co-samples"; while machine learning methods based on statistical moment matching (MMD, CORAL) or adversarial learning (DANN, CDAN) enhance generalization ability by aligning the feature distributions of the source and target domains. However, these methods are primarily designed for single-source domains and cannot fully utilize the complementary information from multi-sample distance data in industrial scenarios. Moreover, when there are significant differences in distribution among multiple source domains, introducing source domain information can negatively impact target domain prediction, leading to negative transfer problems. Furthermore, when target domain data is unavailable, most existing models struggle to achieve effective cross-domain prediction. Summary of the Invention

[0004] To address the aforementioned problems and technical requirements, this application proposes a method for constructing a quality parameter detection model based on multi-source domain adaptation. The technical solution of this application is as follows: A method for constructing a quality parameter detection model based on multi-source domain adaptation includes the following steps: A basic model for quality parameter detection is constructed for detecting the quality parameters of minerals to be tested, and a multi-source spectral dataset is constructed for training the basic model for quality parameter detection. The multi-source spectral dataset includes multiple source domain training sets. There is a domain shift in the spectral distribution between any two source domain training sets. All source domain training sets include spectral data of different mineral samples to be tested collected by a spectrometer at multiple sampling distances, as well as the quality parameter label of the mineral sample to be tested and the source domain label of the source domain to which the spectral data belongs for each spectral data. Each source domain training set includes multiple training samples. Each training sample includes spectral data of the mineral sample to be tested collected by a spectrometer and its corresponding quality parameter label and source domain label. The basic model for quality parameter detection is trained using a multi-source spectral dataset, including: For any training sample, the training sample is input into the basic model for quality parameter detection to extract the source domain features and domain-invariant features of the spectral data, and the source domain prediction result and domain-invariant prediction result are obtained respectively from the source domain features and the domain-invariant features; the source domain features include features that change with the source domain, while the domain-invariant features do not include features that change with the source domain. For all training samples, the contribution weights of each source domain training set to model training are dynamically adjusted based on the performance of the domain-invariant prediction results on each source domain training set. The loss function for model training is determined based on the domain-invariant features, source domain prediction results, and the contribution weights of each source domain training set to model training. The quality parameter detection model is then trained using the loss function.

[0005] The further technical solution is that the basic model for quality parameter detection includes a feature extraction module, a quality parameter prediction module, a source domain weight adjustment module, a domain alignment module, and a domain adversarial module; model training of the basic model for quality parameter detection includes: For any source domain training set i, the spectral data of each training sample in source domain training set i are input into the feature extraction module for multidimensional feature transformation and feature extraction to obtain source domain features. sum-field invariant features The quality parameter prediction module is based on source domain features. The source domain prediction results are obtained by performing quality parameter prediction. Source domain prediction results This includes predicted quality parameters corresponding to the spectral data of each training sample, and also, based on domain-invariant features... The domain-invariant prediction results were obtained by performing quality parameter prediction. Domain-invariant prediction results This includes predicted quality parameters corresponding to the spectral data of each training sample; the domain adversarial module is based on domain-invariant features. Source domain classification is performed to obtain source domain classification results. Source domain classification results This includes the source domain prediction value of the spectral data of each training sample; The source domain weight adjustment module dynamically adjusts the contribution weights of the source domain training set i to model training based on the performance of the domain-invariant prediction results on each source domain training set. The domain alignment module performs statistical analysis on the domain-invariant features of each source domain training set, and determines the spectral distribution difference between any two source domains by combining the contribution weights of each source domain training set to model training. The loss function for model training is determined based on the domain-invariant features of each source domain training set, the source domain prediction results, the domain-invariant prediction results, and the contribution weights of each source domain training set to model training. And by minimizing the loss function The quality parameter detection model is obtained through training; loss function ,in, It is the source domain regression loss. It is a domain-invariant regression loss. It is a domain confrontation loss. It is the domain alignment loss. It is a domain adversarial loss weight. It is the domain alignment loss weight; source domain regression loss This is used to measure the accuracy of the quality parameter prediction module in predicting source domain features. The higher the accuracy of the quality parameter prediction module in predicting source domain features, the lower the source domain regression loss. The smaller the value, the lower the domain-invariant regression loss. This is used to measure the accuracy of the quality parameter prediction module in predicting domain-invariant features. Higher accuracy in predicting domain-invariant features results in lower domain-invariant regression loss. The smaller the value, the lower the domain alignment loss. This measure assesses the degree of difference in spectral distribution across all source domains. A greater difference in spectral distribution across all source domains indicates a greater domain alignment loss. The larger the domain, the greater the domain resistance loss. This is used to measure the accuracy of a domain classifier in classifying domain-invariant features. Higher accuracy in classifying domain-invariant features indicates a higher domain adversarial loss. The smaller.

[0006] A further technical solution involves the source domain weight adjustment module dynamically adjusting the contribution weights of any source domain training set i to model training. include: Based on the domain-invariant prediction results of the source domain training set i in any t-th round of model training. The performance parameters of the source domain training set i are calculated using the quality parameter labels. The performance parameters characterize the prediction performance of the quality parameter prediction module on the source domain training set i; the average prediction performance of the source domain training set i in T consecutive rounds of model training is determined. t0 is the starting round, t1 is the ending round, and t1 = t0 + T-1; Determine the overall average prediction performance of all source domains over T consecutive rounds of model training. K is the total number of source domains; when the difference between the maximum and minimum values ​​of the average prediction performance across all source domains exceeds a predetermined threshold. At that time, based on the overall predicted performance average Adjust the contribution weights of the source domain training set i to model training. .

[0007] Its further technical solution is to base the prediction on the overall average performance. Adjust the contribution weights of the source domain training set i to model training. include: The average prediction performance of the source domain training set i over T consecutive rounds of model training Less than the overall prediction performance average At that time, determine the updated weight values ​​for the source domain training set i. The average prediction performance of the source domain training set i in T consecutive rounds of model training. Not less than the average of the overall prediction performance At that time, determine the updated weight values ​​for the source domain training set i. , It is the maximum weight. It is the minimum weight. It is to increase the step size of the weight. The weight decreases by a step size; Normalizing the updated weight values ​​yields the contribution weights of the source domain training set i to the model training. .

[0008] The further technical solution is that the quality parameter prediction module includes a parallel source domain prediction network and a domain-invariant prediction network. The source domain prediction network predicts quality parameters based on source domain features to obtain source domain prediction results, which include the predicted quality parameter values ​​corresponding to the spectral data of each training sample. The domain-invariant prediction network predicts quality parameters based on domain-invariant features to obtain domain-invariant prediction results, which include the predicted quality parameter values ​​corresponding to the spectral data of each training sample. The source domain regression loss is determined based on the source domain prediction results and quality parameter labels. Minimize the source domain regression loss during the forward propagation of model training. The goal is to optimize the network parameters of the source domain prediction network and minimize the source domain regression loss during backpropagation of model training. To optimize the network parameters of the feature extraction module; source domain regression loss , It is the source domain prediction result of the source domain training set i. The source domain prediction result of the k-th training sample. is the quality parameter label of the k-th training sample in the source domain training set i. It is the mean square error of the source domain prediction results and the quality parameter labels. It is the mean absolute error between the source domain prediction results and the quality parameter labels; The domain-invariant regression loss is determined based on the domain-invariant prediction results and quality parameter labels. Minimize the domain-invariant regression loss during the forward propagation of model training. By optimizing the network parameters of the domain-invariant prediction network, the domain-invariant regression loss is minimized during backpropagation of model training. To optimize the network parameters of the feature extraction module; domain-invariant regression loss. , It is the domain-invariant prediction result of the source domain training set i. The domain-invariant prediction result of the k-th training sample. is the quality parameter label of the k-th training sample in the source domain training set i. It is the mean square error of the domain-invariant prediction results and the quality parameter labels. It is the mean absolute error between the domain-invariant prediction results and the quality parameter labels. It is the mean square error weight. It is the average absolute error weight, and K is the total number of source domains. It is the total number of training samples in the source domain training set i.

[0009] A further technical solution involves using a domain alignment module to calculate the mean of the domain-invariant features of any source domain training set i, after the domain-invariant features output by the feature extraction module are processed by the domain alignment module. Calculate the standard deviation of the domain-invariant features of any source domain training set i. , It is the k-th domain-invariant feature of the source domain training set i. This represents the total number of training samples in the source domain training set i; the domain alignment loss is determined based on the mean and standard deviation of the domain invariant features of each source domain training set. Minimize the domain alignment loss during the forward propagation of model training. By optimizing the network parameters of the domain-invariant prediction network, the domain alignment loss is minimized during backpropagation of model training. To optimize the network parameters of the feature extraction module; Domain alignment loss In this context, the feature alignment loss between the source domain training set i and the source domain training set j is used. , It is the mean of the domain-invariant features of the source domain training set j. It is the standard deviation of the domain-invariant features of the source domain training set j. It is the mean square error of the domain-invariant feature mean of the source domain training set i and the domain-invariant feature mean of the source domain training set j. It is the mean square error of the standard values ​​of the domain-invariant features of the source domain training set i and the standard deviations of the domain-invariant features of the source domain training set j. These are the domain-invariant features of the source domain training set i. Domain-invariant features of the source domain training set j The maximum mean difference , , All are weighting coefficients.

[0010] A further technical solution involves a domain adversarial module comprising a domain classifier. The domain-invariant features output by the feature extraction module are then used by the domain classifier to predict the source domain of each training sample's spectral data in the arbitrary source domain training set i. Based on the source domain prediction value and the source domain label of each training sample's spectral data, the domain adversarial loss is determined. Minimize the domain adversarial loss during the forward propagation of model training. To optimize the network parameters of the domain classifier and maximize the domain adversarial loss during backpropagation of model training. To optimize the network parameters of the feature extraction module; Domain confrontation loss , It is the source domain prediction value of the spectral data of the k-th training sample in the source domain training set i, output by the domain classifier. It is the source domain label of the k-th training sample in the source domain training set i. The cross-entropy loss is the sum of the predicted values ​​from the source domain and the labels from the source domain, where K is the total number of source domains. It is the total number of training samples in the source domain training set i.

[0011] A further technical solution involves a domain classifier that includes a gradient inversion layer, based on the proportion of the current training epoch to the total number of epochs. progress Determine the gradient scaling factor And during backpropagation of model training, the gradient scaling factor is used. Controlling the intensity of gradient inversion in the gradient inversion layer , It is the original gradient strength output by the gradient inversion layer.

[0012] A further technical solution involves determining the proportion of the current training epoch within the total number of epochs. progress Determine the domain adversarial loss weights Determine the domain alignment loss weights .

[0013] The further technical solution is that the feature extraction module includes a spectral data preprocessing module, a source domain feature extraction module, and a domain-invariant feature extraction module; the spectral data preprocessing module performs multi-dimensional feature transformation to obtain the spectral features of each spectral data, and stacks the spectral features of each spectral data along the channel dimension to obtain the spectral feature matrix of the source domain training set i. The source domain feature extraction module extracts the spectral feature matrix. Feature extraction is performed to obtain source domain features. The domain-invariant feature extraction module extracts source domain features. To filter out features that change with the source domain, we obtain domain-invariant features. ; The spectral data preprocessing module performs multidimensional feature transformation, including: applying Savitzky-Golay filtering to each spectral data point in the source domain training set i to obtain the absorption peak structure features of the source domain training set i. The SNV standard normal variable transformation is performed on each spectral data of the source domain training set i to obtain the standardized features of the source domain training set i. The original spectral matrix is ​​formed by the spectral data of each spectral data in the source domain training set i. With absorption peak structural characteristics Standardization characteristics The spectral feature matrix of the source domain training set i is obtained by stacking along the channel dimension. The spectral characteristics of spectral data include absorption peak structure characteristics and normalization characteristics; The source domain feature extraction module uses a three-layer MLP for feature extraction and dimensionality reduction to obtain source domain features. The domain-invariant feature extraction module uses a two-layer fully connected network to extract features from the source domain. Extracting domain-invariant features .

[0014] The beneficial technical effects of this application are: This application discloses a method for constructing a quality parameter detection model based on multi-source domain adaptation, used for cross-domain migration prediction of spectral data without a target domain. Through a data preprocessing module, the original spectrum, SG filtering for noise reduction, and SNV normalization-derived spectral features are simultaneously input into the feature extraction module, effectively suppressing noise, scattering interference, and amplitude differences, thus solving the problem of unstable spectral data quality in industrial scenarios. The feature extraction module utilizes a multi-layer MLP to achieve nonlinear abstraction and enhancement of spectral features, addressing the insufficient feature representation capability of the original spectral data. Based on a multi-head regression structure, a collaborative optimization mechanism between the source domain prediction network and the domain-invariant prediction network balances the model's fitting accuracy in the source domain and its generalization ability in the target domain, solving the problem that a single regression head cannot simultaneously address "source domain adaptation" and "cross-domain migration." Combined with domain alignment and domain adversarial learning that fuses statistical features, the distribution differences between multiple source domains are effectively reduced, solving the problem of spectral distribution heterogeneity caused by multiple sampling distances. Simultaneously, a source domain weight adjustment module is introduced to adaptively allocate the contribution weights of each source domain's training set based on its real-time prediction performance. This avoids the negative transfer phenomenon caused by easily learnable source domains dominating training while difficult-to-learn source domains are neglected, and solves the problem of uneven loss distribution in multi-source domain collaboration. Through the collaborative training of each module, the problem of multi-source spectral cross-domain regression prediction is effectively solved even without target domain spectral data, significantly improving the robustness and accuracy of quality parameter detection. Attached Figure Description

[0015] Figure 1 This is a flowchart of the method for constructing a quality parameter detection model.

[0016] Figure 2 This is a structural diagram of the basic model for quality parameter detection.

[0017] Figure 3 This is a t-SNE visualization comparison chart of the feature distribution.

[0018] Figure 4 It is a scatter plot of the predicted MAD and the actual MAD.

[0019] Figure 5 This is a distribution chart of the actual Mad index along with the sample index.

[0020] Figure 6 This is a graph showing the distribution of relative prediction error as a function of the sample index. Detailed Implementation

[0021] The specific embodiments of this application will be further described below with reference to the accompanying drawings.

[0022] This application discloses a method for constructing a quality parameter detection model based on multi-source domain adaptation. Please refer to [the relevant documentation]. Figure 1 The flowchart shown is an embodiment of the method, and the specific steps of the method are as follows: Step 1: Construct a basic model for quality parameter detection to detect the quality parameters of the minerals to be tested, and construct a multi-source spectral dataset for training the basic model for quality parameter detection.

[0023] First, a multi-source spectral dataset needs to be constructed by collecting spectral data of the mineral samples to be tested using a spectrometer. The multi-source spectral dataset includes multiple source domain training sets. There is a domain shift in the spectral distribution between any two source domain training sets, meaning there is a significant deviation in the spectral distribution between any two source domains. All source domain training sets include spectral data of different mineral samples to be tested collected by the spectrometer at multiple sampling distances, as well as the quality parameter label of the mineral sample to be tested and the source domain label of the spectral data for each spectral data point. Each source domain training set includes multiple training samples, and each training sample includes the spectral data of the mineral sample to be tested collected by the spectrometer, along with its corresponding quality parameter label and source domain label.

[0024] Because variations in sampling distance lead to significant differences in signal-to-noise ratio, scattering noise, and optical path conditions among the source domains, causing domain shifts in the spectral distribution, all spectral data collected at each sampling distance belong to the same source domain, while all spectral data collected at different sampling distances belong to different source domains. The multi-source spectral dataset contains at least two source domain training sets, corresponding to two sampling distances. Furthermore, to verify the prediction performance of the trained quality parameter detection model, an additional series of spectral data at one sampling distance is collected as a validation set; all spectral data at this sampling distance belong to the target domain. It is crucial to ensure that the spectral data from each source domain in the multi-source spectral dataset exhibit significant differences in signal-to-noise ratio, scattering noise, and optical path conditions, meaning that the spectral distribution of all source domain training sets shows a domain shift. Moreover, the spectral distribution of the target domain validation set also needs to differ significantly from that of each source domain to effectively verify the domain shift effect.

[0025] The minerals to be tested are selected according to the actual application needs, such as coal and bauxite, which have spectra such as laser-induced breakdown spectroscopy (LIBS), near-infrared spectroscopy (NIRS), or X-ray fluorescence spectroscopy (XRF). The spectrometer is selected according to the type of mineral to be tested and the type of spectrum to be collected. This application uses the near-infrared spectral data of coal as a training sample for illustration. Commercial coal samples provided by China Certification & Inspection Group were used, and the spectral data of each commercial coal sample were collected at four different sampling distances using a MicroNIRPro handheld near-infrared spectrometer. The sampling distances were 5 mm, 10 mm, 15 mm, and 20 mm, respectively. The sampling distance refers to the distance between the spectrometer probe and the surface of the coal sample. The main parameters of the collected spectral data include: wavelength range 908-1676 nm, spectral resolution <10 nm, dynamic range 1000:1, minimum sampling integration time 10 ms (adjustable), and signal-to-noise ratio >8000:1. To reduce scattering interference during data acquisition and obtain high-quality spectral data, the following acquisition conditions were determined through multiple experiments: 1) Instrument settings: sampling interval of 6.2 nm, totaling 125 wavelength points; 2) Sample condition: coal sample particle size of 0.2 mm; 3) Acquisition settings: scanning the spectra at 5 different locations on the sample and taking the average spectrum. For each coal sample in the source region, the standard values ​​of quality parameters need to be determined according to the national standard "Industrial Analysis Methods for Coal" (GB / T 212) as quality parameter labels. The quality parameters are selected according to actual application requirements; for example, coal quality parameters can be moisture, volatile matter, calorific value, etc.

[0026] Each training sample's spectral data corresponds to a quality parameter label and a source domain label. The source domain label distinguishes which source domain each spectral data belongs to, and the label type can be customized, such as using letters or numbers 1, 2, 3. Three sampling distances are selected from the collected spectral data samples as source domains (with labels), denoted as... Each source domain contains an input space. and an output space , i = 1, 2, 3, represent the source domain label. This represents a source domain spectral dataset with a sampling distance of 5 mm. This represents the source domain training set with a sampling distance of 10mm. This represents the source domain training set with a sampling distance of 20mm, where each source domain... Include There are 781 training samples in total. Each training sample includes spectral data and quality parameter labels, denoted as . ,in, This represents the spectral data of the k-th training sample in source domain i, which is 125-dimensional and corresponds to the 125 bands of NIRS, with a wavelength range of 908-1676 nm. The quality parameter label (e.g., moisture content) of the k-th training sample in source domain i. Target domain This represents the target domain validation set with a sampling distance of 15 mm, which contains only spectral data and has no quality parameter labels, denoted as . , This represents the spectral data of the k-th training sample in the target domain, and is also 125-dimensional. It represents the total number of samples in the target domain.

[0027] The quality parameter detection model used to detect the quality parameters of the mineral to be tested is trained based on the basic quality parameter detection model. In one embodiment, the model structure of the constructed basic quality parameter detection model is as follows: Figure 2 As shown, the basic model for quality parameter detection includes a feature extraction module, a quality parameter prediction module, a source domain weight adjustment module, a domain alignment module, and a domain adversarial module. The feature extraction module extracts source domain features and domain-invariant features from the spectral data. Source domain features include features that vary with the source domain, while domain-invariant features do not; they only include features shared by all source domains. The quality parameter prediction module predicts quality parameters based on source domain features and domain-invariant features. The source domain weight adjustment module dynamically adjusts the contribution weights of each source domain training set to the model training. The domain alignment module aligns the features of each source domain to reduce the distribution differences between source domains. The domain adversarial module guides the model to learn domain-invariant features, providing a robust feature foundation for target domain prediction.

[0028] Step 2 involves training the basic model for quality parameter detection using a multi-source spectral dataset. This includes: for any training sample, inputting the training sample into the basic model for quality parameter detection to extract source domain features and domain-invariant features from the spectral data, and predicting source domain prediction results and domain-invariant prediction results for the source domain features and domain-invariant features respectively; for all training samples, dynamically adjusting the contribution weights of each source domain training set to model training based on the performance of the domain-invariant prediction results on each source domain training set; determining the loss function for model training based on the domain-invariant features, source domain prediction results, and the contribution weights of each source domain training set to model training, and using the loss function to train the quality parameter detection model.

[0029] based on Figure 2 The basic model for quality parameter detection shown, in one embodiment, includes training the model by: (1) For any source domain training set i, input the spectral data of each training sample of source domain training set i into the feature extraction module to perform multidimensional feature transformation and feature extraction to obtain source domain features. sum-field invariant features .

[0030] To fully extract the spectral features of the original spectral data, this application designs a three-channel feature representation method. First, the original spectral data is converted into a multi-channel representation containing different information dimensions. Based on this, more accurate source domain features and domain-invariant features can be extracted. Specifically, the feature extraction module includes a spectral data preprocessing module, a source domain feature extraction module, and a domain-invariant feature extraction module. The spectral data preprocessing module performs multi-dimensional feature transformations to obtain the spectral features of each spectral data point, and then stacks the spectral features of each spectral data point along the channel dimension to obtain the spectral feature matrix of the source domain training set i. .

[0031] The spectral data preprocessing module performs multidimensional feature transformation, including: applying Savitzky-Golay (SG) filtering to each spectral data point in the source domain training set i to obtain the absorption peak structure features of the source domain training set i. The SNV standard normal variable transformation is performed on each spectral data of the source domain training set i to obtain the standardized features of the source domain training set i. The original spectral matrix is ​​formed by the spectral data of each spectral data in the source domain training set i. With absorption peak structural characteristics Standardization characteristics The spectral feature matrix of the source domain training set i is obtained by stacking along the channel dimension. The spectral characteristics of spectral data include absorption peak structure characteristics and normalization characteristics. , L This refers to the number of bands in the spectral data. The original spectrum retains all physical information, including subtle peak shape differences and background trends. SG filtering emphasizes true absorption peaks and suppresses high-frequency noise, making it suitable for extracting spectral structures related to quality parameters. SNV normalization "straightens and flattens" each spectrum, significantly reducing the influence of scattering, graininess, and measurement conditions, allowing spectral lines at different distances to fall on a comparable scale. Specific details of the SG filtering and SNV normalization methods can be found in existing technologies and will not be elaborated upon here.

[0032] Because spectral data contains source-domain specific features related to sampling conditions, as well as domain-invariant features related to chemical information, source-domain specific features characterize noise patterns appearing at a specific sampling distance. While these features can improve the fit to a particular source domain, they do not have cross-domain transfer significance. Therefore, accurately extracting source-domain features and domain-invariant features is of great importance for improving the accuracy of quality parameter prediction.

[0033] The source domain feature extraction module extracts the spectral feature matrix. Feature extraction is performed to obtain source domain features. The domain-invariant feature extraction module extracts source domain features. To filter out features that change with the source domain, we obtain domain-invariant features. In spectral tasks, there is strong correlation and redundant information between bands. Directly using the original high-dimensional input for cross-domain alignment will amplify inter-domain differences and lead to unstable training. The source domain feature extraction module uses a three-layer MLP for feature extraction and dimensionality reduction, mapping the physical band space to a latent feature space related to the quality parameter prediction task, thus obtaining the source domain features. Performing subsequent predictions and domain adaptation tasks in this space is beneficial for improving the model's expressive power and the feasibility of cross-domain alignment.

[0034] The domain-invariant feature extraction module uses a two-layer fully connected network to extract features from the source domain. Extracting domain-invariant features Source domain features sum-field invariant features All dimensions are The source domain features contain abstract features that include source domain-specific information and information shared between source domains. These features are then further projected and filtered through a two-layer fully connected network to highlight domain-invariant features shared across domains. Since the fully connected layer can perform non-linear projections in a high-dimensional feature space, and since it is trained on all source domains, if a feature appears in all source domains, the two-layer fully connected network can strengthen that feature representation, thus preserving common features across multiple source domains, i.e., domain-invariant features.

[0035] The spectral data distribution results obtained by the feature extraction module after the above feature extraction are as follows: Figure 3 As shown, from left to right, the figure displays the feature distribution of the original spectral data, the source domain feature distribution after processing by the source domain feature extraction module, and the domain-invariant feature distribution after processing by the domain-invariant feature extraction module. In the figure, the red dot set represents the source domain training set with a sampling distance of 5 mm, the blue dot set represents the source domain training set with a sampling distance of 10 mm, the green dot set represents the source domain training set with a sampling distance of 15 mm, and the yellow dot set represents the source domain training set with a sampling distance of 20 mm. Figure 3 As can be seen, after feature extraction, the feature distribution gradually becomes disordered, indicating that the model gradually learns a robust domain-invariant representation. Moreover, the disorder of the domain-invariant features is significantly higher than that of the source domain features, proving the cross-domain sharing property of the domain-invariant features, which does not change with the source domain.

[0036] (2) The quality parameter prediction module is based on source domain features The source domain prediction results are obtained by performing quality parameter prediction. Source domain prediction results This includes predicted quality parameters corresponding to the spectral data of each training sample, and also, based on domain-invariant features... The domain-invariant prediction results were obtained by performing quality parameter prediction. Domain-invariant prediction results This includes the predicted quality parameters corresponding to the spectral data of each training sample.

[0037] In multi-source spectra, each ranging domain exhibits both common patterns and significant systematic shifts. Using only a single prediction network can either lead to overfitting to a specific source domain, resulting in poor generalization to the target domain, or excessive constraints, causing poor fitting across all source domains. To address this, this application splits the prediction task into two parts: "source domain-specific calibration" and "domain-invariant shared mapping." Through collaborative training of dual prediction networks, it fully utilizes the quality parameter labels of each source domain to improve fitting accuracy, while simultaneously forcing the model to extract cross-domain stable spectral-quality parameter relationships, thereby achieving a balance between source domain fitting and target domain generalization.

[0038] The quality parameter prediction module comprises a parallel source domain prediction network and a domain-invariant prediction network. The source domain prediction network, based on source domain features (containing source domain-specific information) extracted by the feature extraction module, learns task mappings within the source domain, ensuring the model's fitting accuracy across each source domain and providing a stable task foundation for cross-domain learning. The domain-invariant prediction network, based on domain-invariant features (excluding source domain-specific information), learns shared task mapping relationships across all source domains, improving the model's generalization ability in the target domain. The source domain prediction network, based on source domain features, performs quality parameter prediction to obtain source domain prediction results, which include the predicted quality parameter values ​​corresponding to the spectral data of each training sample. The domain-invariant prediction network, based on domain-invariant features, performs quality parameter prediction to obtain domain-invariant prediction results, which also include the predicted quality parameter values ​​corresponding to the spectral data of each training sample. Specifically, the source domain prediction network and the domain-invariant prediction network can employ two fully connected layers with identical structural designs, an input dimension of 64, and an output dimension of 1. These two prediction networks are trained in different feature spaces. The source domain prediction network performs the quality parameter prediction task, fitting the quality parameter labels of each source domain, while the domain-invariant prediction network learns the most general spectrum-quality parameter mapping for the target domain prediction task.

[0039] (3) Domain adversarial module based on domain invariant features Source domain classification is performed to obtain source domain classification results. Source domain classification results This includes the source domain prediction value of the spectral data of each training sample. The domain adversarial module includes a domain classifier. The domain-invariant features output by the feature extraction module are used by the domain classifier to predict the source domain prediction value of the spectral data of each training sample in the training set i for any source domain.

[0040] (4) The domain alignment module performs statistical analysis on the domain-invariant features of each source domain training set and determines the spectral distribution difference between any two source domains by combining the contribution weights of each source domain training set to the model training.

[0041] The true absorption characteristics of minerals are stable; what changes is the additional domain information brought about by the sampling distance. The domain alignment module directly constrains the statistics of each source domain to be close in the domain-invariant feature space, stripping away the sampling distance information in the feature space, allowing the model to pay more attention to the spectral changes caused by changes in quality parameters, guiding the model to learn the true domain-invariant features, and providing a robust feature foundation for target domain prediction.

[0042] By weighting the mean, standard deviation, and multi-scale MMD (maximum mean difference), the first-, second-, and higher-order statistical features of each source domain are aligned. The first-order statistic represents the spectral mean, reflecting information such as the overall light intensity level and optical path attenuation. Aligning the mean can eliminate the overall light intensity differences between different source domains, making the "average scale" of the features consistent. The second-order statistic represents the spectral variance, reflecting the cooperative variation patterns between bands and the absorption peak shape changes caused by changes in quality parameters. Aligning the second-order statistic can eliminate the spectral shape fluctuation differences between different source domains. Higher-order statistics represent the nonlinear changes in spectral peak shape and the complex deviations in high-noise regions in different domains. MMD can capture the distribution tails and shape differences that the mean and variance cannot describe. The combination of these three statistical features can achieve complete cross-domain alignment.

[0043] (5) The source domain weight adjustment module dynamically adjusts the contribution weight of source domain training set i to model training based on the performance of the domain-invariant prediction results on each source domain training set. .

[0044] In multi-range spectral data, source domains exhibit significant differences in signal-to-noise ratio, scattering noise, and optical path conditions. Traditional source domain weighting approaches typically assign higher weights to "good-performing" source domains, but this leads to excessive model reliance on domains with lower noise and easier fitting, resulting in insufficient generalization ability when encountering complex measurement conditions in real-world industrial scenarios. To enhance the model's robustness to complex measurement environments, this application employs a reverse dynamic weighting mechanism: increasing the weight of poor-performing source domains and decreasing the weight of good-performing source domains. By increasing the training contribution of difficult source domains, the model is forced to learn stable features across distances, thereby achieving stronger cross-domain generalization ability. Simultaneously, reducing the weight of simple source domains effectively suppresses their overfitting tendency, preventing the model from achieving high accuracy only in a few simple domains but failing to adapt to complex real-world conditions.

[0045] In one embodiment, the source domain weight adjustment module dynamically adjusts the contribution weights of any source domain training set i to model training. include: First, the contribution weights of each source domain are initialized to 1. The current fitting performance of the domain-invariant prediction network in each source domain is evaluated to provide a basis for weight adjustment. Specifically, the weights are adjusted based on the domain-invariant prediction results of the source domain training set i in any t-th round of model training. The performance parameters of the source domain training set i are calculated using the quality parameter labels. The performance parameters characterize the prediction performance of the quality parameter prediction module on the source domain training set i. The performance parameters to be calculated can be selected according to the actual application scenario, such as using the coefficient of determination. ,at this time , It is the output space of the source domain training set i, i.e., the quality parameter labels. and The closer the value is to 1, the better; every T rounds, determine the average prediction performance of the source domain training set i over T consecutive rounds of model training. t0 is the starting round, t1 is the ending round and t1 = t0 + T - 1, the value of T is determined based on experimental results, and this application sets T = 30; Determine the overall average prediction performance of all source domains over T consecutive rounds of model training. K is the total number of source domains; when the difference between the maximum and minimum values ​​of the average prediction performance across all source domains exceeds a predetermined threshold. At this point, if no weight adjustment is made, the loss will decrease rapidly, but cross-domain generalization learning will not converge. Therefore, based on the overall average prediction performance... Adjust the contribution weights of the source domain training set i to model training. .

[0046] Based on the overall predicted performance average Adjust the contribution weights of the source domain training set i to model training. include: The average prediction performance of the source domain training set i over T consecutive rounds of model training Less than the overall prediction performance average At that time, determine the updated weight values ​​for the source domain training set i. The average prediction performance of the source domain training set i in T consecutive rounds of model training. Not less than the average of the overall prediction performance At that time, determine the updated weight values ​​for the source domain training set i. , It is the maximum weight. It is the minimum weight. It is to increase the step size of the weight. It is a step size that decreases the weight. , The value is set based on experimental results; this application sets it accordingly. =2.0, =0.5; To ensure training stability, the weight update values ​​are normalized to obtain the contribution weights of the source domain training set i to the model training. Normalization is used to ensure that the sum of the contribution weights of each source domain training set to the model training is equal to the total number of source domains, K. Training weights are adaptively allocated based on the real-time prediction performance of each source domain, avoiding the negative transfer phenomenon where easily learned domains dominate training while difficult-to-learn domains are neglected, and solving the problem of unbalanced loss distribution in multi-source domain collaboration.

[0047] The loss function for model training is determined based on the domain-invariant features of each source domain training set, the source domain prediction results, the domain-invariant prediction results, and the contribution weights of each source domain training set to model training. And by minimizing the loss function The quality parameter detection model was trained.

[0048] loss function ,in, It is the source domain regression loss. It is a domain-invariant regression loss. It is a domain confrontation loss. It is the domain alignment loss. It is a domain adversarial loss weight. It is the domain alignment loss weight; source domain regression loss This is used to measure the accuracy of the quality parameter prediction module in predicting source domain features. The higher the accuracy of the quality parameter prediction module in predicting source domain features, the lower the source domain regression loss. The smaller the value, the lower the domain-invariant regression loss. This is used to measure the accuracy of the quality parameter prediction module in predicting domain-invariant features. Higher accuracy in predicting domain-invariant features results in lower domain-invariant regression loss. The smaller the value, the lower the domain alignment loss. This measure assesses the degree of difference in spectral distribution across all source domains. A greater difference in spectral distribution across all source domains indicates a greater domain alignment loss. The larger the domain, the greater the domain resistance loss. This is used to measure the accuracy of a domain classifier in classifying domain-invariant features. Higher accuracy in classifying domain-invariant features indicates a higher domain adversarial loss. The smaller.

[0049] In order to enable the model to learn relevant features that are beneficial to the prediction task in the early stages, and to avoid directly and excessively learning domain-invariant features, which would lead to a deterioration in prediction performance in the target domain, the model training is based on the proportion of the current training epoch in the total number of epochs. progress Determine the domain adversarial loss weights Determine the domain alignment loss weights As the number of training rounds increases, the weights of domain adversarial loss and domain alignment loss gradually increase.

[0050] Based on the joint loss constraints of each module, the gradient descent algorithm is used to optimize all parameters of the model, so that the model achieves the optimal balance in the three dimensions of source domain fitting, cross-domain generalization and distribution alignment, and finally realizes accurate prediction of the quality parameters of the target domain.

[0051] Each round of model training consists of two phases: forward propagation and backward propagation. For the source domain prediction network, the source domain regression loss is determined based on the source domain prediction results and the quality parameter labels. Minimize the source domain regression loss during the forward propagation of model training. The goal is to optimize the network parameters of the source domain prediction network and minimize the source domain regression loss during backpropagation of model training. To optimize the network parameters of the feature extraction module; source domain regression loss , It is the source domain prediction result of the source domain training set i. The source domain prediction result of the k-th training sample. is the quality parameter label of the k-th training sample in the source domain training set i. It is the mean square error of the source domain prediction results and the quality parameter labels. It is the mean absolute error between the source domain prediction results and the quality parameter labels.

[0052] For the domain-invariant prediction network, the domain-invariant regression loss is determined based on the domain-invariant prediction results and the quality parameter labels. Minimize the domain-invariant regression loss during the forward propagation of model training. By optimizing the network parameters of the domain-invariant prediction network, the domain-invariant regression loss is minimized during backpropagation of model training. To optimize the network parameters of the feature extraction module; domain-invariant regression loss. , It is the domain-invariant prediction result of the source domain training set i. The domain-invariant prediction result of the k-th training sample. is the quality parameter label of the k-th training sample in the source domain training set i. It is the mean square error of the domain-invariant prediction results and the quality parameter labels. It is the mean absolute error between the domain-invariant prediction results and the quality parameter labels. It is the mean square error weight. It is the average absolute error weight, and K is the total number of source domains. It is the total number of training samples in the source domain training set i; , The specific values ​​are set customarily based on experimental results and experience. This application sets... =0.7, =0.3.

[0053] For the domain alignment module, the domain-invariant features output by the feature extraction module are processed by the domain alignment module to calculate the mean of the domain-invariant features of any source domain training set i. Calculate the standard deviation of the domain-invariant features of any source domain training set i. , It is the k-th domain-invariant feature of the source domain training set i. This represents the total number of training samples in the source domain training set i; the domain alignment loss is determined based on the mean and standard deviation of the domain invariant features of each source domain training set. Minimize the domain alignment loss during the forward propagation of model training. By optimizing the network parameters of the domain-invariant prediction network, the domain alignment loss is minimized during backpropagation of model training. To optimize the network parameters of the feature extraction module; domain alignment loss In this context, the feature alignment loss between the source domain training set i and the source domain training set j is used. , It is the mean of the domain-invariant features of the source domain training set j. , It is the standard deviation of the domain-invariant features of the source domain training set j. , It is the k-th domain-invariant feature of the source domain training set j. It is the total number of training samples in the source domain training set j; It is the mean square error of the domain-invariant feature mean of the source domain training set i and the domain-invariant feature mean of the source domain training set j. It is the mean square error of the standard values ​​of the domain-invariant features of the source domain training set i and the standard deviations of the domain-invariant features of the source domain training set j. These are the domain-invariant features of the source domain training set i. Domain-invariant features of the source domain training set j The maximum mean difference; , , All are weighting coefficients, and K is the total number of source domains. , , The values ​​are set customarily based on experimental results and experience; in this application, they are set to 0.3, 0.2, and 0.3 respectively. For specific calculation methods of mean squared error and maximum mean difference (MMD), please refer to existing technologies; these will not be elaborated upon here.

[0054] MMD measures the consistency of feature distributions between two source domains, achieved by the distance between the embeddings of the two distributions in the Hilbert high-dimensional feature space of the reproducing kernel. The formula for calculating the MMD loss is:

[0055] in, It is the k-th domain-invariant feature of the source domain training set i. The i-th training set of the source domain l Domain-invariant features It is the k-th domain-invariant feature of the source domain training set j. It is the first generation of the source domain training set j. l Let n be a field-invariant feature. The total number of features, where m is the number of domain-invariant features. The total number of features; This is a kernel function used to calculate the similarity between domain-invariant features and source domain features in a high-dimensional feature space. If the two distributions are consistent, the mean intra-domain similarity and the mean inter-domain similarity are equal, and the MMD value approaches 0. This application uses a multi-scale Gaussian kernel:

[0056] Among them, the number of cores G=5, , It is an adaptive bandwidth parameter. The Gaussian kernel function is essentially a similarity measure; when two features... and The closer the data is to each other, the closer the kernel function value is to 1; the farther apart the data are, the closer the kernel function value is to 0. The Gaussian kernel implicitly maps the data to an infinite-dimensional space, enabling it to capture complex nonlinear relationships in the data. Multi-scale Gaussian kernels can capture distribution characteristics at different scales, with large bandwidth capturing the overall macroscopic distribution structure and small bandwidth capturing the microscopic local details.

[0057] For the domain adversarial module, the domain adversarial loss is determined based on the source domain prediction value and source domain label of the spectral data of each training sample. Minimize the domain adversarial loss during the forward propagation of model training. To optimize the network parameters of the domain classifier and maximize the domain adversarial loss during backpropagation of model training. To optimize the network parameters of the feature extraction module; the domain adversarial loss is the domain classification loss of the domain classifier on the current feature: when the feature is fixed, the more accurate the domain classifier is, the smaller the domain adversarial loss; however, in adversarial training, the feature extraction module is updated in the direction of increasing this loss through the gradient reversal layer, thereby learning domain-invariant features that are difficult to be distinguished by the domain classifier.

[0058] Domain confrontation loss , It is the source domain prediction value of the spectral data of the k-th training sample in the source domain training set i, output by the domain classifier. It is the source domain label of the k-th training sample in the source domain training set i. , The cross-entropy loss is the sum of the predicted values ​​from the source domain and the labels from the source domain, where K is the total number of source domains. is the total number of training samples in the source domain training set i. For the calculation method of cross-entropy loss, please refer to existing techniques.

[0059] The domain classifier consists of a gradient inversion layer, two fully connected layers, and a softmax layer. The output data dimension is K, and the output of the last softmax layer is the probability that the training sample belongs to each source domain. ,in, These are features of the gradient inversion layer output. , All are weights. This represents the ReLU activation function. , This is the bias constant. The gradient reversal layer does not change the input during forward propagation, but multiplies the input by the negative gradient strength during backpropagation. It uses sigmoid scheduling, based on the proportion of the current training epoch to the total number of epochs. progress Determine the gradient scaling factor And during backpropagation of model training, the gradient scaling factor is used. Controlling the intensity of gradient inversion in the gradient inversion layer , It is the original gradient strength output by the gradient inversion layer.

[0060] After training, the quality parameter detection model can be obtained using only the feature extraction module and the domain-invariant prediction network, which can then be used for the subsequent inference process of quality parameter detection.

[0061] To further verify the effectiveness of the quality parameter detection model constructed in this application, experiments were conducted. The multi-source spectral dataset included coal sample spectral data collected at four sampling distances: 5 mm, 10 mm, 15 mm, and 20 mm. Each sampling distance had 781 training samples across 125 bands. The datasets with sampling distances of 5, 10, and 20 mm were used as the training set, and the results were tested on the dataset with a 15 mm sampling distance. The coefficient of determination (R²), root mean square error (RMSE), and mean absolute error (MAE) were used as evaluation metrics in the experimental section.

[0062] Training and inference were performed on a single NVIDIA GeForce RTX 4090 (24GB) GPU using the PyTorch framework. Experiments were conducted on a Linux operating system, with Python 3.10 as the development environment. The total number of training epochs was set to 1000. The Adam optimizer was used during training, with weight decay set to 1e-3. A fixed learning rate of 1e-3 was maintained, and no learning rate scheduler was used.

[0063] In the experiments, two source domain training sets corresponding to three sampling distances were first randomly selected as source domains for a two-source domain adaptation comparison experiment. Then, a three-source domain adaptation comparison experiment was conducted using the source domain training sets corresponding to three sampling distances as source domains. Next, ablation experiments demonstrated the importance of the quality parameter prediction module, domain alignment module, domain adversarial module, and source domain weight adjustment module in the proposed method. The effectiveness of the proposed method in two-source domain adaptation and three-source domain adaptation was compared. The proposed method was compared with existing techniques such as DANN (Adversarial multiple source domain adaptation), MMD (Akernel two-sample test), CORAL (Deep coral: Correlation alignment for deepdomain adaptation), CDAN (Conditional adversarial domain adaptation), MDD (Bridging theory and algorithm for domain adaptation), SHOT (Do we really need to access the source data? source hypothesis transfer for unsupervised domain adaptation), ADDA (Adversarial discriminative domain adaptation), and DIRT-T (A dirt-t approach to unsupervised domain adaptation) in two-source domain adaptation and three-source domain adaptation.

[0064] Tables 1, 2, and 3 show the results of the dual-source domain adaptive comparison experiment, and Table 4 shows the results of the three-source domain adaptive comparison experiment. Table 1 shows the results of the adaptive comparison experiment using source domain training sets with sampling distances of 10mm and 20mm as dual-source domain training sets; Table 2 shows the results of the adaptive comparison experiment using source domain training sets with sampling distances of 5mm and 10mm as dual-source domain training sets; Table 3 shows the results of the adaptive comparison experiment using source domain training sets with sampling distances of 5mm and 20mm as dual-source domain training sets; and Table 4 shows the results of the adaptive comparison experiment using source domain training sets with sampling distances of 5mm, 10mm, and 20mm as dual-source domain training sets.

[0065] Table 1. Experimental Results of Dual-Source Domain Adaptive Comparison from 10mm+20mm->15mm

[0066] Table 2. Experimental Results of Dual-Source Domain Adaptive Comparison from 5mm+10mm->15mm

[0067] Table 3. Experimental Results of Dual-Source Domain Adaptive Comparison from 5mm+20mm->15mm

[0068] Table 4. Results of the three-source domain adaptive comparison experiment from 5mm+10mm+20mm->15mm

[0069] As shown in Table 1, the quality parameter detection model constructed in this application achieves the best overall performance under the dual-source domain settings of 10 mm and 20 mm, outperforming all baseline methods. This indicates that the domain-invariant representation learned by this model is more comprehensive and has stronger transferability. According to the experimental results in Table 2 with 5 mm and 10 mm as source domains, since the sampling distances of the two source domains are both smaller than the sampling distance of the target domain (15 mm), their spectral distributions are relatively similar, and they lack long-distance sampling information. Therefore, the generalization ability of the learned domain-invariant features is weak, leading to a slight decrease in performance. Nevertheless, the framework proposed in this application still significantly outperforms all baseline methods, demonstrating that it can still capture stable task-related representations even with limited domain diversity. According to the experimental results in Table 3 with 5 mm and 20 mm as source domains, this setting shows the largest source domain difference, representing the extreme case of distance offset. Although this setting covers a wider measurement range, the significant spectral difference between the 5 mm and 20 mm datasets increases the difficulty of domain alignment. Therefore, compared with the (10 mm + 20 mm) setting, the model performance is robust but slightly lower. This phenomenon indicates that excessive domain differences may hinder effective domain-invariant feature learning, but the dynamic weighting mechanism proposed in this application can still effectively balance the contributions of multiple source domains. Table 4 shows the R2, RMSE, and MAE performance of each method in the three-source-domain scenario. As can be seen from Table 4, the model proposed in this application achieves the best overall performance after being extended to three source domains. Fusing the three source domains allows the model to fully utilize complementary spectral information, expand the domain feature coverage, and thus enhance its generalization ability to the target domain.

[0070] Further analysis was conducted using comparative results from ablation experiments. Table 5 presents the comparative results of the three-source-domain adaptive ablation experiments. Here, Source represents the source domain prediction network, Shared represents the domain-invariant prediction network, Domain represents the domain adversarial module, and Align represents the domain alignment module. The w / o-* indicates the removal of the source domain weight adjustment module. w / o-* indicates the absence of this module. Specifically, w / o-Source means removing the source domain prediction network, w / o-Shared means removing the domain-invariant prediction network, w / o-Domain means removing the domain adversarial module, w / o-Align means removing the domain alignment module, and w / o-ω means removing the source domain weight adjustment module.

[0071] Table 5. Results of the Three-Source Domain Adaptive Comparison Experiment

[0072] Ablation experiments revealed that removing any module led to a decrease in model performance, indicating that each module contributes positively to improving overall performance. The removal of the domain alignment module resulted in the most significant performance drop, demonstrating that distribution alignment is crucial for reducing inter-domain differences and improving cross-domain generalization ability. Meanwhile, other modules also made significant contributions to improving model stability and prediction accuracy. In conclusion, the model achieves optimal performance only when all modules work collaboratively, fully validating the rationality and necessity of the proposed overall architecture design.

[0073] Finally, the prediction results of the quality parameter detection model trained on the 5mm, 10mm, and 20mm three-source domain training sets were visualized, as shown in the figure. Figure 4 , 5 As shown in Figure 6. Figure 4 This is a scatter plot of the true MAD (Absolute Median Difference) and predicted MAD values ​​on the validation set of the target domain. The red dashed line in the figure is the ideal fit line, and the green shading represents the interval of "true value ± root mean square error (RMSE)". The scatter points represent the distribution of all training samples, and the color of the scatter points represents the absolute error (|predicted value - true value|). Figure 5 This is a distribution chart of the true MAD value with the sample index. The green dotted line in the chart represents the distribution of the true MAD value, the blue dotted line represents the distribution of the predicted MAD value, and the pink shading represents the error range between the predicted value and the true value (i.e., |predicted value - true value|). Figure 6 This is a distribution chart of relative prediction error with sample index. In the chart, the red dotted lines represent the actual prediction error value of each sample, the green dashed lines represent the reference line where the error is 0, the orange dashed lines represent the "positive line of mean absolute error (MAE)" and the "negative line of mean absolute error (MAE)" respectively, the red dotted lines represent the "positive line of 2 times the mean absolute error" and the "negative line of 2 times the mean absolute error" respectively, the green shaded area represents the MAE interval, and the red crosses represent large error samples that exceed "2×MAE".

[0074] This application addresses the domain shift problem in mineral spectra under multiple measurement conditions. Existing methods often fail to fully utilize complementary information from multiple sources, rely heavily on target domain data, and cannot effectively balance source domain fitting and cross-domain generalization capabilities. Therefore, this application employs three-channel feature preprocessing and MLP feature extraction to fully integrate original spectral information, denoised information, and standardized information. A dual-prediction network collaborative mechanism and dynamic weight strategy are designed to ensure source domain fitting while enhancing cross-domain shared feature learning. Through feature alignment and domain adversarial training, the distribution differences among multiple source domains are effectively reduced. Experimental results demonstrate the superiority of the proposed method, highlighting its application potential in rapid and robust coal quality parameter detection without target domain data.

[0075] The above descriptions are merely preferred embodiments of this application, and this application is not limited to the above embodiments. It is understood that other improvements and variations that can be directly derived or conceived by those skilled in the art without departing from the spirit and concept of this application should be considered to be included within the protection scope of this application.

Claims

1. A method for constructing a quality parameter detection model based on multi-source domain adaptation, characterized in that, The method for constructing the quality parameter detection model includes: A basic model for quality parameter detection is constructed for detecting the quality parameters of the minerals to be tested, and a multi-source spectral dataset is constructed for training the basic model for quality parameter detection. The multi-source spectral dataset includes multiple source domain training sets. The spectral distribution of any two source domain training sets has a domain shift. All source domain training sets include spectral data of different mineral samples to be tested collected by a spectrometer at multiple sampling distances, as well as the quality parameter label of the mineral sample to be tested corresponding to each spectral data and the source domain label of the source domain to which the spectral data belongs. Each source domain training set includes multiple training samples. Each training sample includes spectral data of the mineral sample to be tested collected by a spectrometer and its corresponding quality parameter label and source domain label. The basic model for quality parameter detection is trained using a multi-source spectral dataset, including: For any training sample, the training sample is input into the basic model for quality parameter detection to extract the source domain features and domain-invariant features of the spectral data, and the source domain prediction result and domain-invariant prediction result are obtained respectively from the source domain features and the domain-invariant features; the source domain features include features that change with the source domain, and the domain-invariant features do not include features that change with the source domain. For all training samples, the contribution weights of each source domain training set to model training are dynamically adjusted based on the performance of the domain-invariant prediction results on each source domain training set. The loss function for model training is determined based on the domain-invariant features, source domain prediction results, and the contribution weights of each source domain training set to model training. The quality parameter detection model is then trained using the loss function.

2. The method for constructing a quality parameter detection model according to claim 1, characterized in that, The basic model for quality parameter detection includes a feature extraction module, a quality parameter prediction module, a source domain weight adjustment module, a domain alignment module, and a domain adversarial module. Model training for the basic model of quality parameter detection includes: For any source domain training set i, the spectral data of each training sample in source domain training set i are input into the feature extraction module for multidimensional feature transformation and feature extraction to obtain source domain features. sum-field invariant features The quality parameter prediction module is based on source domain features. The source domain prediction results are obtained by performing quality parameter prediction. Source domain prediction results This includes predicted quality parameters corresponding to the spectral data of each training sample, and also, based on domain-invariant features... The domain-invariant prediction results were obtained by performing quality parameter prediction. Domain-invariant prediction results This includes predicted quality parameters corresponding to the spectral data of each training sample; the domain adversarial module is based on domain-invariant features. Source domain classification is performed to obtain source domain classification results. Source domain classification results This includes the source domain prediction value of the spectral data of each training sample; The source domain weight adjustment module dynamically adjusts the contribution weights of the source domain training set i to model training based on the performance of the domain-invariant prediction results on each source domain training set. The domain alignment module performs statistical analysis on the domain-invariant features of each source domain training set, and determines the spectral distribution difference between any two source domains by combining the contribution weights of each source domain training set to model training. The loss function for model training is determined based on the domain-invariant features of each source domain training set, the source domain prediction results, the domain-invariant prediction results, and the contribution weights of each source domain training set to model training. And by minimizing the loss function The quality parameter detection model is obtained through training; the loss function ,in, It is the source domain regression loss. It is a domain-invariant regression loss. It is a domain confrontation loss. It is the domain alignment loss. It is a domain adversarial loss weight. It is the domain alignment loss weight; source domain regression loss This is used to measure the accuracy of the quality parameter prediction module in predicting source domain features. The higher the accuracy of the quality parameter prediction module in predicting source domain features, the lower the source domain regression loss. The smaller the value, the lower the domain-invariant regression loss. This is used to measure the accuracy of the quality parameter prediction module in predicting domain-invariant features. Higher accuracy in predicting domain-invariant features results in lower domain-invariant regression loss. The smaller the value, the lower the domain alignment loss. This measure assesses the degree of difference in spectral distribution across all source domains. A greater difference in spectral distribution across all source domains indicates a greater domain alignment loss. The larger the domain, the greater the domain resistance loss. This is used to measure the accuracy of a domain classifier in classifying domain-invariant features. Higher accuracy in classifying domain-invariant features indicates a higher domain adversarial loss. The smaller.

3. The method for constructing a quality parameter detection model according to claim 2, characterized in that, The source domain weight adjustment module dynamically adjusts the contribution weights of any source domain training set i to model training. include: Based on the domain-invariant prediction results of the source domain training set i in any t-th round of model training. The performance parameters of the source domain training set i are calculated using the quality parameter labels. The performance parameters characterize the prediction performance of the quality parameter prediction module on the source domain training set i; the average prediction performance of the source domain training set i in T consecutive rounds of model training is determined. t0 is the starting round, t1 is the ending round, and t1 = t0 + T-1; Determine the overall average prediction performance of all source domains over T consecutive rounds of model training. K is the total number of source domains; when the difference between the maximum and minimum values ​​of the average prediction performance across all source domains exceeds a predetermined threshold. At that time, based on the overall predicted performance average Adjust the contribution weights of the source domain training set i to model training. .

4. The method for constructing a quality parameter detection model according to claim 3, characterized in that, The overall predicted performance average Adjust the contribution weights of the source domain training set i to model training. include: The average prediction performance of the source domain training set i over T consecutive rounds of model training Less than the overall prediction performance average At that time, determine the updated weight values ​​for the source domain training set i. The average prediction performance of the source domain training set i in T consecutive rounds of model training. Not less than the average of the overall prediction performance At that time, determine the updated weight values ​​for the source domain training set i. , It is the maximum weight. It is the minimum weight. It is to increase the step size of the weight. The weight decreases by a smaller step size; Normalizing the updated weight values ​​yields the contribution weights of the source domain training set i to the model training. .

5. The method for constructing a quality parameter detection model according to claim 2, characterized in that, The quality parameter prediction module includes a source domain prediction network and a domain-invariant prediction network in parallel. The source domain prediction network predicts quality parameters based on source domain features to obtain source domain prediction results, which include the predicted quality parameter values ​​corresponding to the spectral data of each training sample. The domain-invariant prediction network predicts quality parameters based on domain-invariant features to obtain domain-invariant prediction results, which include the predicted quality parameter values ​​corresponding to the spectral data of each training sample. The source domain regression loss is determined based on the source domain prediction results and quality parameter labels. Minimize the source domain regression loss during the forward propagation of model training. The goal is to optimize the network parameters of the source domain prediction network and minimize the source domain regression loss during backpropagation of model training. To optimize the network parameters of the feature extraction module; the source domain regression loss , It is the source domain prediction result of the source domain training set i. The source domain prediction result of the k-th training sample. is the quality parameter label of the k-th training sample in the source domain training set i. It is the mean square error of the source domain prediction results and the quality parameter labels. It is the mean absolute error between the source domain prediction results and the quality parameter labels; The domain-invariant regression loss is determined based on the domain-invariant prediction results and quality parameter labels. Minimize the domain-invariant regression loss during the forward propagation of model training. By optimizing the network parameters of the domain-invariant prediction network, the domain-invariant regression loss is minimized during backpropagation of model training. To optimize the network parameters of the feature extraction module; the domain-invariant regression loss , It is the domain-invariant prediction result of the source domain training set i. The domain-invariant prediction result of the k-th training sample. is the quality parameter label of the k-th training sample in the source domain training set i. It is the mean square error of the domain-invariant prediction results and the quality parameter labels. It is the mean absolute error between the domain-invariant prediction results and the quality parameter labels. It is the mean square error weight. It is the average absolute error weight, and K is the total number of source domains. It is the total number of training samples in the source domain training set i.

6. The method for constructing a quality parameter detection model according to claim 5, characterized in that, The domain-invariant features output by the feature extraction module are processed by the domain alignment module to calculate the mean of the domain-invariant features of any source domain training set i. Calculate the standard deviation of the domain-invariant features of any source domain training set i. , It is the k-th domain-invariant feature of the source domain training set i. This represents the total number of training samples in the source domain training set i; the domain alignment loss is determined based on the mean and standard deviation of the domain invariant features of each source domain training set. Minimize the domain alignment loss during the forward propagation of model training. By optimizing the network parameters of the domain-invariant prediction network, the domain alignment loss is minimized during backpropagation of model training. To optimize the network parameters of the feature extraction module; The domain alignment loss In this context, the feature alignment loss between the source domain training set i and the source domain training set j is used. , It is the mean of the domain-invariant features of the source domain training set j. It is the standard deviation of the domain-invariant features of the source domain training set j. It is the mean square error of the domain-invariant feature mean of the source domain training set i and the domain-invariant feature mean of the source domain training set j. It is the mean square error of the standard values ​​of the domain-invariant features of the source domain training set i and the standard deviations of the domain-invariant features of the source domain training set j. These are the domain-invariant features of the source domain training set i. Domain-invariant features of the source domain training set j The maximum mean difference , , All are weighting coefficients.

7. The method for constructing a quality parameter detection model according to claim 2, characterized in that, The domain adversarial module includes a domain classifier. The domain-invariant features output by the feature extraction module are used by the domain classifier to predict the source domain of the spectral data of each training sample in the arbitrary source domain training set i. Based on the source domain prediction value and the source domain label of the spectral data of each training sample, the domain adversarial loss is determined. Minimize the domain adversarial loss during the forward propagation of model training. To optimize the network parameters of the domain classifier and maximize the domain adversarial loss during backpropagation of model training. To optimize the network parameters of the feature extraction module; The domain adversarial loss , It is the source domain prediction value of the spectral data of the k-th training sample in the source domain training set i, output by the domain classifier. It is the source domain label of the k-th training sample in the source domain training set i. The cross-entropy loss is the sum of the predicted values ​​from the source domain and the labels from the source domain, where K is the total number of source domains. It is the total number of training samples in the source domain training set i.

8. The method for constructing a quality parameter detection model according to claim 7, characterized in that, The domain classifier includes a gradient inversion layer, which is based on the proportion of the current training iteration to the total number of iterations. progress Determine the gradient scaling factor And during backpropagation of model training, the gradient scaling factor is used. Controlling the intensity of gradient inversion in the gradient inversion layer , It is the original gradient strength output by the gradient inversion layer.

9. The method for constructing a quality parameter detection model according to claim 2, characterized in that, Based on the proportion of the current training round in the total number of rounds. progress Determine the domain adversarial loss weights Determine the domain alignment loss weights .

10. The method for constructing a quality parameter detection model according to claim 2, characterized in that, The feature extraction module includes a spectral data preprocessing module, a source domain feature extraction module, and a domain-invariant feature extraction module. The spectral data preprocessing module performs multi-dimensional feature transformation to obtain the spectral features of each spectral data, and stacks the spectral features of each spectral data along the channel dimension to obtain the spectral feature matrix of the source domain training set i. The source domain feature extraction module extracts the spectral feature matrix. Feature extraction is performed to obtain source domain features. The domain-invariant feature extraction module extracts source domain features. To filter out features that change with the source domain, we obtain domain-invariant features. ; The spectral data preprocessing module performs multidimensional feature transformation, including: applying Savitzky-Golay filtering to each spectral data point in the source domain training set i to obtain the absorption peak structure features of the source domain training set i. The SNV standard normal variable transformation is performed on each spectral data of the source domain training set i to obtain the standardized features of the source domain training set i. The original spectral matrix is ​​formed by the spectral data of each spectral data in the source domain training set i. With absorption peak structural characteristics Standardization characteristics The spectral feature matrix of the source domain training set i is obtained by stacking along the channel dimension. The spectral characteristics of spectral data include absorption peak structure characteristics and normalization characteristics; The source domain feature extraction module uses a three-layer MLP for feature extraction and dimensionality reduction to obtain source domain features. The domain-invariant feature extraction module uses a two-layer fully connected network to extract features from the source domain. Extracting domain-invariant features .