A method and system for detecting rare and precious metals in bulk solid waste by fusing physical constraint dynamic correction

CN122730866BActive Publication Date: 2026-10-30TONGJI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611209449.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-11
Publication Date
2026-10-30
Estimated Expiration
2046-08-11

AI Technical Summary

Technical Problem

[0008]本发明针对大宗固废样品中主量基体元素组成差异大、场景干扰元素谱峰重叠严重、散射背景波动显著、传统X射线荧光基本参数法跨基体泛化能力不足以及纯数据驱动模型缺乏物理一致性约束等问题,提出一种融合物理约束动态校正的大宗固废中稀有稀贵金属检测方法、系统、电子设备及存储介质

Benefits of technology

本发明通过融合X射线荧光分析机理与深度学习算法,建立了基于Sherman理论的物理约束动态校正机制,有效解决了复杂基体条件下传统检测模型精度不足及物理一致性较差的问题;通过基体效应动态补偿机制显著降低复杂主量元素组成对检测结果的影响,提高复杂工业固废样品中稀有稀贵金属元素的检测精度;通过复核优先级评价与ICP-MS精确定量检测相结合,实现检测效率、检测成本及检测精度之间的优化平衡;通过在线学习及数据漂移检测机制,实现模型长期运行过程中的持续优化及自适应更新,具有检测速度快、精度高、适应性强、智能化程度高等优点,可广泛应用于赤泥、冶炼渣、电镀污泥、尾矿、粉煤灰及废催化剂等大宗固体废弃物中稀有稀贵金属元素的快速检测及资源价值评价。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122730866B_ABST
    Figure CN122730866B_ABST
Patent Text Reader

Abstract

The application provides a kind of fusion physical constraint dynamic correction method and system for detecting rare and precious metals in bulk solid waste.The sample is pretreated, X-ray fluorescence spectrum is collected, spectral features and matrix parameters are extracted, intelligent prediction model based on Sherman fluorescence quantitative mechanism is input, absorption, enhancement and scattering effects in complex matrix are dynamically compensated by physical constraint loss function, and target metal concentration and confidence are obtained.According to the prediction result, value classification is automatically carried out, and ICP-MS is triggered for accurate quantitative review of high-value or low-confidence samples.Combined with the review results and data drift, the model parameters are updated online to form a closed-loop detection process of rapid screening, accurate review and continuous optimization.The application can improve the accuracy, reliability and model interpretability of detecting rare and precious metals in complex bulk solid waste.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial solid waste resource utilization and element detection technology, specifically to a method and system for detecting rare and precious metals in bulk solid waste that integrates physical constraint dynamic correction. Background Technology

[0002] Bulk industrial solid waste (hereinafter referred to as "bulk solid waste") includes red mud, electroplating sludge, smelting slag, fly ash, tailings, and spent catalysts. Many bulk solid wastes are rich in rare and precious metals such as gallium, germanium, indium, scandium, tantalum, niobium, and rare earth elements (REEs), and their grades are often comparable to primary mineral resources, thus being regarded as "secondary resources." Achieving efficient and economical recovery of rare and precious metals from bulk solid waste is of great significance for alleviating environmental pressure.

[0003] The primary prerequisite for realizing the resource utilization of bulk solid waste is rapid, accurate, and low-cost detection and evaluation. Only by accurately grasping the types, contents, and distribution of target elements in solid waste can we formulate reasonable sorting, enrichment, and purification processes, and scientifically assess the resource value.

[0004] Currently, the detection technologies for metal elements in solid waste are mainly divided into two categories: one is laboratory chemical analysis methods, including inductively coupled plasma mass spectrometry (ICP-MS), inductively coupled plasma optical emission spectrometry (ICP-OES), and atomic absorption spectrometry (AAS). These methods have high sensitivity and accuracy, but they have drawbacks such as complex pretreatment, long processing time, high cost, and use of hazardous chemicals, making it difficult to meet the needs of rapid on-site screening; the other is on-site rapid detection technology represented by X-ray fluorescence spectrometry (XRF), which has advantages such as non-destructive nature, simple sample pretreatment, fast detection speed, and low cost. It has been initially applied in the screening of bulk solid waste, but its main technical bottleneck is the serious matrix effect problem caused by the complex composition of solid waste.

[0005] Unlike ores or alloys with relatively simple compositions, the matrix composition of bulk solid waste varies rapidly. Physical matrix effects manifest in differences in sample particle size, surface smoothness, moisture content, and mineral phase structure, directly impacting X-ray excitation and detection efficiency. Chemical matrix effects are characterized by strong absorption and enhancement of fluorescence spectra by major elements such as Fe, Al, Si, and Ca on the target rare and precious metals. For example, high Fe content in red mud strongly absorbs the fluorescence of light elements, while high Zn and Ni content in electroplating sludge severely interferes with signals from low-content rare metals. Traditional XRF quantitative methods (such as the empirical coefficient method and the basic parameter method) correct for matrix effects using simple linear or nonlinear models, but they suffer from fundamental flaws in extremely nonlinear, multi-factor coupled solid waste systems: weak model generalization ability, meaning curves established for specific batches cannot be applied to other samples; difficulty in handling high-order absorption-enhancement interactions between multiple elements; and inability to utilize historical spectra or ICP-MS feedback data for dynamic optimization.

[0006] In recent years, artificial intelligence (especially deep learning) has been attempted for XRF spectral analysis, automatically extracting nonlinear features through end-to-end training, which can theoretically compensate for complex matrix effects. However, purely data-driven AI models face new challenges: the prediction results lack physical interpretability and may deviate significantly from the true values ​​when the matrix changes unknown; they are highly dependent on massive amounts of high-quality labeled data covering various matrices, while obtaining ICP-MS ground truth is costly and time-consuming, easily leading to overfitting; and they lack dynamic adaptability, unable to use subsequent small amounts of new data (such as sampling results) for online correction, and the model performance deteriorates with data drift.

[0007] In summary, existing technologies for detecting rare and precious metals in bulk solid waste still have significant limitations: chemical analysis methods offer high accuracy but suffer from long detection cycles and high costs; XRF detection is fast but susceptible to complex matrix effects; while pure data-driven models possess strong nonlinear fitting capabilities, their physical interpretability, cross-matrix adaptability, and continuous updating capabilities remain insufficient. Therefore, current solutions struggle to simultaneously achieve rapid screening, complex matrix correction, physical consistency of detection results, and online adaptive model updates. It is necessary to combine quantitative fluorescence mechanisms with data learning methods to construct a detection technology that synergistically integrates rapid detection, accurate quantification, and dynamic correction. Summary of the Invention

[0008] This invention addresses the challenges of large variations in the main matrix element composition, severe overlap of interfering element spectral peaks, significant fluctuations in scattering background, insufficient cross-matrix generalization ability of traditional X-ray fluorescence fundamental parameter methods, and the lack of physical consistency constraints in purely data-driven models in bulk solid waste samples. It proposes a method, system, electronic equipment, and storage medium for detecting rare and precious metals in bulk solid waste by integrating physical constraint dynamic correction. This invention utilizes a multi-window feature construction, including target element characteristic peak windows, background windows, interfering element spectral peak windows, main matrix element spectral peak windows, and scattering characteristic windows. Matrix composition parameters are introduced into the Transformer attention modulation mechanism, and physical constraint error terms are constructed using Sherman fluorescence quantitative theory. Simultaneously, selective verification and incremental updates are performed using ICP-MS reference quantitative values, thereby achieving rapid screening, physical consistency correction, and continuous adaptive optimization of rare and precious metals in complex solid waste samples.

[0009] To achieve the above objectives, the present invention adopts the following technical solution: A method for detecting rare and precious metals in bulk solid waste that integrates physical constraint dynamic correction includes the following steps: Step S1, Sample Pretreatment Unit: Large-volume solid waste samples are crushed, dried, ground, and sieved to obtain uniform samples; Step S2, X-ray fluorescence spectroscopy detection unit: Collect the full spectrum of X-ray fluorescence of the homogeneous sample, and extract the spectral characteristic parameters and the main matrix elemental composition parameters; Step S3, Intelligent Prediction Unit: A matrix feature vector is generated based on the principal matrix element composition parameters; the spectral feature parameters and the principal matrix element composition parameters are input into the intelligent prediction model, and the attention weights of the Transformer are modulated using the matrix feature vector to form a target element-specific feature. Step S4, Physical constraint dynamic correction unit: A physical constraint error term is constructed based on Sherman quantitative fluorescence theory, and together with a data error term constructed based on the true value of ICP-MS detection, the intelligent prediction model is constrained to obtain the prediction result of the concentration of the analyte and the prediction confidence level. Step S5, Review Priority Evaluation Unit: Based on the concentration prediction results, prediction confidence level, market reference price of target element, technical recoverability coefficient and expected additional detection cost, calculate the comprehensive review priority score of the sample, and determine the detection path based on the comprehensive review priority score; Step S6, ICP-MS Precision Quantification Unit: When the prediction confidence level is lower than the preset confidence threshold or the resource value evaluation parameter is higher than the preset value threshold, ICP-MS detection is triggered. Step S7, Data Feedback and Model Update: The ICP-MS detection results, corresponding X-ray fluorescence data, and matrix composition parameters are written into a sliding window database, and the intelligent prediction model is incrementally updated when the prediction error or feature distribution shift meets the preset drift conditions.

[0010] Preferably, in step S2, the target element characteristic peak window, background window, interference element spectrum peak window, principal matrix element spectrum peak window, and scattering characteristic window are divided according to the energy positions of the element to be measured, the interfering element, and the scattering peak. The spectral characteristic parameters include the target element peak intensity, peak area, peak width, peak-to-background ratio, spectral peak position, interference peak intensity, Compton scattering peak intensity, Rayleigh scattering peak intensity, and adjacent background intensity. In step S3, a convolutional neural network is used to extract target peak features, background features, and interference features to obtain a high-dimensional spectral feature vector. The principal matrix element composition parameters are encoded into a matrix feature vector, and the matrix feature vector is used to modulate the attention weights of the Transformer to fuse the high-dimensional spectral feature vector to form a target element-specific feature.

[0011] Preferably, in step S3, the intelligent prediction model generates an absorption correction factor based on the content of principal matrix elements and scene interference elements, the energy of the characteristic spectral peak of the target element, and the corresponding mass absorption coefficient; wherein, the principal matrix elements include one or more of Fe, Al, Si, Ca, Mg, and Ti, and the scene interference elements include one or more of Zn, Ni, and Cu, or include a set of interference elements pre-configured according to the type of solid waste; an enhancement correction factor is generated based on the secondary excitation contribution of the principal matrix elements and scene interference elements to the fluorescence spectral line of the target element, and a scattering background correction amount is generated based on the Compton scattering peak intensity, Rayleigh scattering peak intensity, and adjacent background intensity; the measured net peak intensity of the characteristic spectral line of the target element is additively subtracted using the scattering background correction amount, and the net peak intensity after subtracting the scattering background is multiplicatively corrected using the absorption correction factor and the enhancement correction factor to obtain the matrix compensation spectral line intensity.

[0012] Preferably, the training objective function of the intelligent prediction model is: ; in, This is the data error term between the predicted elemental concentration and the corresponding ICP-MS reference quantification value. The term represents the physical constraint error between the theoretical fluorescence intensity calculated based on the Sherman equation and the matrix-compensated spectral line intensity. λ is a weighting coefficient, ranging from 0.05 to 1.0, with initial values ​​set based on matrix complexity, and determined according to... and The physical error contribution ratio and the validation set prediction error are adaptively adjusted, wherein the physical error contribution ratio r satisfies: .

[0013] Preferably, in step S6, the preset confidence threshold is determined based on the error distribution between historical X-ray fluorescence prediction results and corresponding ICP-MS reference quantitative values. When the predicted confidence of a sample is lower than the preset confidence threshold, the integration time is extended according to the signal-to-noise ratio of the target element's characteristic spectral peaks, and the tube voltage and tube current are adjusted according to the target element's characteristic spectral line energy and detector count rate. X-ray fluorescence data are then reacquired, and the predicted confidence is re-obtained. When the re-obtained predicted confidence is still lower than the preset confidence threshold, or the sample's resource value evaluation parameter is higher than a preset value threshold and the predicted confidence is lower than a preset high confidence threshold, or the relative deviation between repeated sampling detection results exceeds the allowable deviation threshold, ICP-MS detection is triggered.

[0014] Preferably, in step S7, the sliding window database is used to store sample information, X-ray fluorescence data, matrix composition parameters, prediction results, ICP-MS reference quantitative values, prediction errors, and drift indicators; low-confidence samples with ICP-MS reference quantitative values, samples with resource value evaluation parameters higher than a preset value threshold, abnormal samples from repeated detections, and sampled samples are written into the sliding window database; data drift is determined based on the matrix composition distribution, scattering feature distribution, target spectral peak feature distribution, spectral peak position drift, spectral peak fitting residual, unsupervised reconstruction error, and prediction residual distribution between the sliding window samples and the benchmark training samples; when the unsupervised drift signal meets the preset weak supervision triggering condition, the ICP-MS sampling ratio of the corresponding sample is increased; when the prediction residual drift or input distribution drift meets the preset triggering condition, and the number of newly labeled samples reaches the preset minimum update number, the basic feature extraction parameters of the convolutional neural network and Transformer are frozen, and the element concentration prediction parameters, matrix effect compensation parameters, and weight coefficients of the physical constraint error term are updated.

[0015] This invention also provides a physical constraint-based dynamic positive detection system for rare and precious metals in bulk solid waste, comprising a sample pretreatment unit, an X-ray fluorescence rapid detection unit, an ICP-MS precise quantification unit, a data storage unit, an intelligent prediction unit, and a central control unit. The sample pretreatment unit homogenizes the bulk solid waste sample. The X-ray fluorescence rapid detection unit acquires the full-spectrum X-ray fluorescence data of the sample. The intelligent prediction unit extracts spectral and matrix composition features and outputs the predicted concentration and confidence level of the analyte based on a physical constraint-based intelligent prediction model. The ICP-MS precise quantification unit obtains the ICP-MS reference quantitative value of the sample. The data storage unit stores sample information, X-ray fluorescence data, ICP-MS reference quantitative values, and model parameters. The central control unit communicates with each of the above units, controls the detection path based on the prediction confidence level and resource value evaluation parameters, and feeds back the ICP-MS reference quantitative value to the intelligent prediction unit for model correction and updating.

[0016] Preferably, the intelligent prediction unit includes a spectral window segmentation module, a convolutional neural network feature extraction module, a matrix effect compensation module, a Transformer feature fusion module, a physical constraint correction module, and an element concentration prediction module; The matrix effect compensation module encodes the spectral peak features and composition parameters of the principal matrix elements into matrix feature vectors, and uses the matrix feature vectors to modulate the attention weights of the Transformer, while performing element-wise multiplicative correction on the spectral feature vectors output by the convolutional neural network. The physical constraint correction module constructs a physical constraint between theoretical fluorescence intensity and measured fluorescence intensity based on Sherman quantitative fluorescence theory.

[0017] Preferably, the central control unit adjusts the integration time, tube voltage, and tube current of the X-ray fluorescence rapid detection unit based on the matrix interference intensity, the signal-to-noise ratio of the target element's characteristic spectral peak, the prediction confidence level, and the resource value evaluation parameters. When the matrix interference intensity exceeds a preset interference threshold or the signal-to-noise ratio of the target element's characteristic spectral peak is lower than a preset signal-to-noise ratio threshold, the integration time is extended, and the tube voltage or tube current is adjusted when the detector count rate is lower than a preset upper limit. When the adjusted prediction confidence level is still lower than a preset confidence threshold, or the resource value evaluation parameters are higher than a preset value threshold and the prediction confidence level is lower than a preset high confidence threshold, or the deviation of repeated detection results exceeds the allowable deviation threshold, the ICP-MS detection process is triggered or an ICP-MS verification instruction is generated.

[0018] Preferably, the intelligent prediction unit further includes an online learning and update module, which is used to determine data drift based on the matrix composition distribution, spectral feature distribution, unsupervised drift signal and prediction residual distribution between the sliding window sample and the benchmark training sample, and to perform incremental update when the data drift meets the preset triggering condition and the number of newly labeled samples reaches the preset minimum update number. Specifically, when performing incremental updates, the basic convolutional layers of the convolutional neural network and the encoding layers of the Transformer network are frozen, and only the prediction layer parameters of the element concentration prediction module, the output layer parameters of the matrix effect compensation module, and the weight parameters of the physical constraint correction module are updated.

[0019] Compared with the prior art, the present invention has the following beneficial effects: This invention establishes a physical constraint dynamic correction mechanism based on Sherman theory by integrating X-ray fluorescence analysis mechanism and deep learning algorithm, effectively solving the problems of insufficient accuracy and poor physical consistency of traditional detection models under complex matrix conditions. Through a matrix effect dynamic compensation mechanism, it significantly reduces the influence of complex major element composition on detection results, improving the detection accuracy of rare and precious metals in complex industrial solid waste samples. By combining priority evaluation with precise quantitative detection by ICP-MS, it achieves an optimal balance between detection efficiency, detection cost, and detection accuracy. Through online learning and data drift detection mechanisms, it achieves continuous optimization and adaptive updates during long-term model operation. It has advantages such as fast detection speed, high accuracy, strong adaptability, and high degree of intelligence, and can be widely applied to the rapid detection and resource value assessment of rare and precious metals in bulk solid wastes such as red mud, smelting slag, electroplating sludge, tailings, fly ash, and spent catalysts. Attached Figure Description

[0020] Figure 1 A flowchart of the overall process for detecting rare and precious metals in bulk solid waste using a method that integrates physical constraint dynamic correction, provided for embodiments of the present invention. Figure 2 An internal module architecture diagram of an intelligent prediction model that integrates physical constraints, provided for an embodiment of the present invention; Figure 3 A schematic diagram of a multi-scale feature fusion network structure based on CNN and Transformer provided for embodiments of the present invention; Figure 4 A schematic diagram illustrating the collaborative optimization of data error terms and physical constraint error terms in the joint loss function provided for embodiments of the present invention; Figure 5 A schematic diagram of an online incremental learning and drift detection mechanism based on a sliding window, provided for an embodiment of the present invention; Figure 6A hardware module composition and communication relationship diagram of the central control unit provided for embodiments of the present invention; Figure 7 A comparison chart of detection results for typical bulk solid waste application scenarios provided for embodiments of the present invention; Figure 8 A flowchart for verifying the long-term online learning mechanism of the system provided in the embodiments of the present invention. Detailed Implementation

[0021] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0022] like Figure 1 As shown in this embodiment, a method for detecting rare and precious metals in bulk solid waste integrating physical constraint dynamic correction is provided. This method is applicable to the rapid detection and accurate quantitative analysis of rare and precious metal elements in various complex industrial solid wastes such as red mud, electroplating sludge, smelting slag, fly ash, tailings, and spent catalysts. The entire detection process is jointly completed by a sample pretreatment unit, an X-ray fluorescence spectroscopy detection unit, an intelligent prediction unit, a physical constraint dynamic correction unit, a verification priority evaluation unit, an ICP-MS accurate quantification unit or an ICP-MS detection data interface, and a central control unit, realizing a closed-loop detection process from sample detection, model prediction, verification decision-making, data feedback to model updating.

[0023] Step S1, Sample Pretreatment Unit: The samples to be tested first enter the sample pretreatment unit. In order to reduce the impact of sample particle size differences, moisture content and component inhomogeneity on the test results, the bulk solid waste samples are crushed, dried, ground and sieved to obtain homogeneous samples.

[0024] Specifically, the original solid waste sample was first crushed to a particle size of less than 2 mm using a jaw crusher, and then dried in a 105℃ constant temperature drying oven until the sample mass remained constant to eliminate the attenuation effect of moisture on X-ray fluorescence intensity. The dried sample was then thoroughly ground using a planetary ball mill at a ball-to-material ratio of 6:1 and a rotation speed of 350 r / min for 30–45 min, until the sample particle size reached below 75 μm. Subsequently, the sample was sieved using a 200-mesh standard sieve, and a quartering method was used for sample reduction. Finally, approximately 50 g of sample was placed in an automatic tablet press and compressed under a pressure of 20–30 MPa to form a standard test sample with a diameter of 32 mm and a thickness of approximately 4 mm, ensuring uniform density and stable test repeatability. It should be noted that the above-mentioned crushing particle size, drying temperature, grinding time, tableting pressure, and tablet size are preferred implementation parameters; provided that the repeatability requirements of X-ray fluorescence detection are met, they can be adjusted according to the type of solid waste sample, moisture content, hardness, and sample chamber specifications of the X-ray fluorescence spectrometer.

[0025] Step S2, X-ray fluorescence spectroscopy detection unit (XRP): After sample pretreatment, the compressed sample is sent to the X-ray fluorescence spectroscopy detection unit for rapid detection. This embodiment uses an energy-dispersive X-ray fluorescence spectrometer as the detection device, and the excitation conditions are automatically adjusted according to the target element type during detection. When detecting elements such as Ga and In, the tube voltage is preferably set to 50 kV and the tube current is preferably set to 600 μA; when detecting noble metal elements such as Au, Ag, and Pd, the tube voltage can be increased to 60 kV to improve the excitation efficiency of high-energy characteristic X-rays. The filter is automatically switched according to the energy range of the target element; an Al filter can be used for light element detection, and a Cu filter can be used for heavy element detection. Simultaneously, the integration time is automatically adjusted according to the sample complexity, preferably set to 60–300 s to ensure a high signal-to-noise ratio. The above-mentioned tube voltage, tube current, filter, and integration time are preferred parameters and can be adjusted according to the characteristic spectral line energy of the target element, the detector count rate, and the sample matrix composition.

[0026] For trace precious metals such as Au, Ag, and Pd in ​​electroplating sludge, since the Au L-line has proximity, overlap, or background interference with the characteristic spectral lines of interfering elements such as Cu, Zn, and Ni, overlapping peak separation and interfering element spectral line subtraction are employed. In this embodiment, the limit of detection (LOD) of the target element is determined by three times the standard deviation of the repeated detection results of blank samples or low-content standard samples, and the limit of quantitation (LOQ) is determined by ten times the standard deviation. When the predicted concentration of the target element is lower than the LOQ, the overlap factor between the characteristic peak of the target element and the interfering peak exceeds a preset threshold, or the spectral peak fitting residual exceeds a preset residual threshold, the central control unit does not directly output the final quantitative result, but instead triggers the ICP-MS detection process or generates an ICP-MS verification command.

[0027] After acquisition, the X-ray fluorescence full spectrum data of the sample is obtained. The central control unit first performs energy calibration, dead time correction, SNIP background subtraction, peak fitting, and overlapping peak separation on the X-ray fluorescence full spectrum data. Peak fitting can be performed using Gaussian function, Voigt function, or linear background joint fitting method to extract the net peak area of ​​the target element characteristic peak, interfering element peak, principal matrix element characteristic peak, and scattering peak.

[0028] Based on the energy positions of the analyte, interfering elements, and scattering peaks, the target element characteristic peak window, background window, interfering element spectral peak window, principal matrix element spectral peak window, and scattering characteristic window are divided. Subsequently, the peak areas are normalized, and spectral characteristic parameters and principal matrix element composition parameters are extracted. These spectral characteristic parameters include the target element peak intensity, peak area, peak width, peak-to-background ratio, peak position, interfering peak intensity, Compton scattering peak intensity, Rayleigh scattering peak intensity, and adjacent background intensity. Simultaneously, based on the rapid quantitative analysis results, the content information of principal matrix elements such as Fe, Al, Si, Ca, Ti, and Mg, as well as the content information of scene interfering elements such as Zn, Ni, and Cu pre-configured according to the solid waste type, are obtained. The aforementioned spectral characteristics, principal matrix element composition, and scene interfering element composition are used together as input data for the intelligent prediction model.

[0029] Step S3: Intelligent prediction unit integrating physical constraints: The intelligent prediction unit employs a hybrid deep learning model that combines convolutional neural networks (CNNs) and Transformer networks to predict the concentration of target elements. The CNNs extract target peak features, background features, and interference features to obtain a high-dimensional spectral feature vector. The principal matrix element composition parameters are encoded into matrix feature vectors, and these matrix feature vectors are used to modulate the attention weights of the Transformer. The high-dimensional spectral feature vectors are then fused to form specific features for the target elements.

[0030] like Figure 2As shown, the intelligent prediction model that integrates physical constraints includes a spectral window partitioning module, a convolutional neural network feature extraction module, a matrix effect compensation module, a Transformer feature fusion module, a physical constraint correction module, and an element concentration prediction module. The matrix effect compensation module sets up a data-driven feature compensation branch and a physical intensity correction branch in parallel, which serve the feature fusion and physical constraint calculation, respectively.

[0031] The convolutional neural network (CNN) is primarily responsible for extracting local spectral peak features. It learns the shape, width, and local background variations of the target element's spectral peaks through continuous one-dimensional convolutional operations. The network comprises four convolutional modules, each consisting of a one-dimensional convolutional layer, a batch normalization layer, a ReLU activation layer, and a pooling layer. The kernel sizes are set to 5, 3, 3, and 3, respectively, and the number of convolutional channels increases sequentially to 64, 128, 256, and 512, thereby gradually obtaining richer high-level semantic features. After a final global average pooling layer, a high-dimensional feature vector containing the main spectral information of the sample is obtained.

[0032] To mitigate the absorption, enhancement, and scattering effects caused by complex matrices, this embodiment includes a matrix effect compensation module. The mass fractions of major matrix elements such as Fe, Al, Si, Ca, Ti, and Mg, as well as scene interference elements such as Zn, Ni, and Cu, are obtained by the X-ray fluorescence rapid detection unit using the basic parameter method combined with the standard sample calibration curve. The sets of major matrix elements and scene interference elements can be pre-configured according to the solid waste type, such as red mud, electroplating sludge, smelting slag, fly ash, tailings, or spent catalysts.

[0033] The intelligent prediction model generates an absorption correction factor based on the content of principal matrix elements and scene interference elements, the energy of the characteristic spectral peaks of the target element, and the corresponding mass absorption coefficients. The principal matrix elements include one or more of Fe, Al, Si, Ca, Mg, and Ti, and the scene interference elements include one or more of Zn, Ni, and Cu, or a pre-configured set of interference elements based on the type of solid waste. An enhancement correction factor is generated based on the secondary excitation contribution of the principal matrix elements and scene interference elements to the fluorescence spectral lines of the target element. A scattering background correction is generated based on the Compton scattering peak intensity, Rayleigh scattering peak intensity, and the intensity of the adjacent background. The measured net peak intensity of the characteristic spectral lines of the target element is additively subtracted using the scattering background correction, and the absorption correction factor and enhancement correction factor are multiplicatively corrected to obtain the matrix-compensated spectral line intensity.

[0034] The matrix input vector is composed of the principal matrix element content, the scene interference element content, the target element characteristic spectral peak energy, the weighted mass absorption coefficients of each matrix element and interference element at that energy, the intensity ratio of the Compton scattering peak to the Rayleigh scattering peak, and the background intensity near the target spectral peak. The principal matrix element content, scene interference element content, and weighted mass absorption coefficients are Z-score normalized using the training set mean and standard deviation. The scattering and background intensities are first transformed using log(1+x) and then Z-score normalized. The target spectral peak energy is normalized to 0-1 according to the instrument's effective energy range.

[0035] The matrix compensation network employs a multilayer perceptron structure. The input layer dimension is din, the first hidden layer contains 64 neurons, the second hidden layer contains 128 neurons, and the output layer contains 512 neurons. Here, din represents the dimension of the matrix input vector, determined based on the configured number of principal matrix elements and scene interference elements. The hidden layers use the ReLU activation function, and the output layer uses the Sigmoid function linearly mapped to 0.5–1.5. The outputs are dynamic correction coefficients that correspond one-to-one with the 512-dimensional spectral features of the final layer of the convolutional neural network. The calculation process is as follows:

[0036] In the formula, F represents the 512-dimensional original spectral feature vector extracted by the convolutional neural network; k represents the 512-dimensional dynamic correction coefficient output by the matrix compensation network; ⊙ represents the element-wise multiplication operation; and F′ represents the spectral features after matrix compensation.

[0037] It should be noted that the matrix effect compensation module is set up with two interrelated but different computational objects: the first is a data-driven feature compensation branch, which uses the 512-dimensional dynamic correction coefficients output by the matrix compensation network to perform element-wise correction on the 512-dimensional spectral feature vector extracted by the CNN, and the correction result is used for Transformer feature fusion and element concentration prediction; the second is a physical intensity correction branch, which does not use the abstract features output by the convolutional neural network as the physical constraint object, but directly performs scattering background subtraction, absorption correction, enhancement correction and instrument response normalization on the measured net peak intensity of the target element feature spectral line to obtain a corrected measured fluorescence intensity that can be compared with the theoretical fluorescence intensity of the Sherman equation at the same intensity scale.

[0038] For the i-th characteristic spectral line of the target element, the raw spectral data output by the X-ray fluorescence spectrometer is sequentially processed through energy calibration, dead time correction, SNIP background subtraction, peak fitting, and overlapping peak separation to obtain the original net peak intensity. Then, the background correction amount is determined based on the Compton scattering peak, Rayleigh scattering peak, and the background near the target peak. The matrix multiplicative correction factor is generated based on the principal matrix element content, target peak energy, and corresponding mass absorption coefficient. Thus, the corrected measured fluorescence intensity is obtained. The calculation relationship is expressed as follows:

[0039] In the formula, This represents the net peak intensity of the i-th characteristic spectral line of the target element after energy calibration, dead time correction, background subtraction, and spectral peak fitting. This represents the additive background correction amount estimated from the scattering peak and the adjacent background; This represents the multiplicative matrix correction coefficient obtained by combining the absorption correction factor and the enhancement correction factor; This represents the measured net fluorescence intensity after corrections for scattering background, matrix effects, and instrument response. Independent of the 512-dimensional spectral feature vector output by the CNN, the former is used for physical constraint error calculation, while the latter is used for data-driven concentration prediction.

[0040] Among them, the comprehensive correction coefficient t is the fixed instrument response coefficient determined by the standard sample. With learnable residuals Composition, namely: = +Δ Fixed items To ensure that the calibrated measured fluorescence intensity is on the same intensity scale as the Sherman theoretical fluorescence intensity, the residual term can be learned. The mass absorption coefficient is kept differentiable to support the physical constraint error term. Backpropagation; thus avoiding the physical branches from degenerating into a pure parametric method and being affected by data error terms. They compete with each other.

[0041] After matrix compensation, the target element feature peak window, neighboring background window, interfering element spectral peak window, and scattering feature window are encoded as 512-dimensional window tokens. These tokens are then input into the Transformer multi-scale feature fusion module after being encoded according to their center energy. The matrix feature vector is linearly mapped to generate attention biases, which are then superimposed on the attention scores between each window token. This ensures that principal elements and interfering element windows that have absorption, secondary enhancement, or spectral overlap with the tested element receive corresponding weights. In this embodiment, the Transformer includes two encoding layers, each with eight attention heads, and a feedforward network dimension of 1024. This forms dedicated fusion features for each tested element's target peak, background, interference, matrix, and scattering, rather than simply concatenating the CNN outputs.

[0042] like Figure 3 As shown, the element-specific fusion features of the Transformer target element are fed into the element concentration prediction module after global average pooling (GAP). The prediction module adopts a two-layer fully connected network prediction module [first layer: fully connected + ReLU] -> [second layer: fully connected + Softplus]. The first layer uses the ReLU activation function, and the second layer uses the Softplus activation function to output non-negative concentration prediction values. During inference, the Dropout layer is kept on and the forward calculation is repeated 20 times (i.e., Monte Carlo Dropout inference (with Dropout on, repeat the forward calculation 20 times)) to obtain 20 prediction results [y1, y2, ..., y20]. The statistical index is calculated using the mean of the 20 prediction results as the final concentration prediction value and the variance as the uncertainty. Then, based on the correspondence between the prediction variance (monotonically calibrated (correspondence in the validation set)) and the actual relative error in the validation set, monotonically calibrated, the uncertainty is converted into a prediction confidence level Q (range 0~1) in the range of 0 to 1.

[0043] Step S4, Physical constraint dynamic correction unit: To ensure that the model prediction results conform to the basic physical laws of X-ray fluorescence analysis, this invention further constructs a physical constraint dynamic correction unit. A physical constraint error term is constructed based on Sherman quantitative fluorescence theory, and together with a data error term constructed based on the true value of ICP-MS detection, constrains the intelligent prediction model to obtain the predicted concentration of the analyte and its prediction confidence level. This module uses classical Sherman quantitative fluorescence theory as its physical basis, substituting the target element concentration, principal matrix element composition parameters, and instrument excitation parameters predicted by the model into the Sherman model to calculate the theoretical fluorescence intensity Iicalc of each characteristic spectral line of the target element. This is then compared with the corrected measured fluorescence intensity Ii(obs,corr) output by the physical intensity correction branch, thereby constraining the concentration output of the intelligent prediction model to conform to the laws of fluorescence generation, absorption, and secondary enhancement. The Sherman physical model can be expressed as:

[0044] In the formula, This represents the theoretical fluorescence intensity corresponding to element i; Indicates the target element concentration; K represents the overall instrument correction factor; and These represent the mass absorption coefficients of the incident X-rays and the characteristic fluorescence of the element, respectively. and These represent the angle of incidence and the angle of detection, respectively. This represents the fluorescence enhancement coefficient produced by element j on element i. This model comprehensively considers fluorescence absorption, secondary excitation, and enhancement effects, making the theoretical calculation results more consistent with the actual detection process.

[0045] Furthermore, in the absence of sufficient ICP-MS labeled data or when the online learning module is not enabled, the intelligent prediction unit can degenerate into a classic Sherman fundamental parameter method (FP) implementation: using the net peak area obtained from energy calibration, SNIP background subtraction, and Voigt peak fitting as input, the theoretical fluorescence intensity of each element is calculated in the forward direction according to the Sherman equation. ∝ ·( The concentration is iteratively updated until the normalized intensity converges (tolerance 1e-7, maximum 80 iterations). At this point, the physical constraint error term is naturally satisfied (theoretical intensity is FP positive intensity), and λ is set to zero.

[0046] This degraded implementation corresponds to an existing workable implementation of the project (xraylib physics simulator + SNIP preprocessing + Voigt multi-peak fitting + FP iteration), which is used to demonstrate the feasibility of the present invention under unlabeled conditions, and constitutes a progressive technical solution with the full implementation of deep learning.

[0047] Because the layer-by-layer integration computation of the complete Sherman model is quite large, this embodiment employs a numerically simplified form for training while preserving the absorption, enhancement, and instrument response terms. For each training sample, the theoretical fluorescence intensity is first calculated based on the model's predicted concentration. Then, the calibrated measured fluorescence intensity obtained from the XRF full spectrum data of the same sample was read. The physical constraint error term is constructed based on the difference between the two, and together with the data error term corresponding to the true ICP-MS concentration, a joint loss function is formed:

[0048] The data fitting error is defined as follows:

[0049] The physical constraint error is defined as:

[0050] Where y represents the true value of the target element concentration measured by ICP-MS. This represents the predicted concentration of the target element output by the intelligent prediction model; Indicates will The theoretical fluorescence intensity of the i-th characteristic spectral line of the target element is calculated by substituting the main matrix element composition parameters and incident X-ray parameters into the Sherman equation. This represents the corrected measured net fluorescence intensity of the i-th characteristic spectral line obtained from the XRF full spectrum data of the same sample after energy calibration, dead time correction, SNIP background subtraction, peak fitting, overlapping peak separation, scattering background subtraction, and matrix multiplicative correction; λ is the physical constraint weighting coefficient. Both the theoretical fluorescence intensity and the corrected measured fluorescence intensity are normalized using the instrument response coefficient determined by the standard sample, and converted to a unified count rate scale using the same integration time, tube voltage, and tube current to ensure consistency in their dimensions and numerical scales. In this embodiment, the matrix complexity is first determined based on the weighted mass absorption coefficient of the sample: when it is below the 75th percentile of the training sample, the initial value of λ is set to 0.1; when it reaches or exceeds this percentile, the initial value of λ is set to 0.2. During the training process, the mean error of the validation set data is calculated every 5 cycles. and the mean of physical error And calculate the physical error contribution ratio. When r is below 10% and the mean relative error of the validation set does not increase, λ is increased by 20%, but not exceeding 0.2; when r is above 30% or the mean relative error of the validation set increases for two consecutive evaluation periods, λ is decreased by 20%, but not below 0.1; otherwise, it remains unchanged. This makes the setting of λ simultaneously constrained by the matrix complexity, the validation set prediction error, and the proportion of physical error.

[0051] like Figure 4 As shown, in the joint loss function, the data error term Ldata drives the model to fit the true ICP-MS concentration, while the physical constraint error term Lphy constrains the prediction results to satisfy Sherman fluorescence quantitative theory. By calculating the physical error contribution ratio r and the dynamic weighting coefficient λ, the model maintains its data-driven fitting ability while satisfying the physical consistency of X-ray fluorescence analysis. Combining the joint loss function, network gradient updates and data are performed to achieve dual-driven optimization by data and physics.

[0052] Step S5, Review Priority Evaluation Unit: After completing the concentration prediction, the central control unit calculates the comprehensive review priority score of the sample based on the predicted concentration, prediction confidence level, market reference price of the target element, technical recoverability coefficient, and expected additional detection cost, and determines the detection path based on the comprehensive review priority score.

[0053] Specifically, the central control unit establishes a comprehensive resource value and review priority score based on predicted concentration, predicted confidence level, target element recovery value, and estimated detection cost. First, the theoretical recoverable value V of the target element is calculated, and then V and the estimated additional detection cost are compared. The historical sample interval normalization is performed, and the scoring formula is as follows: ; = ·N(V)+ ·(1-Q)- ·N( ) In the formula, This represents the predicted concentration of the i-th target element. This indicates the market reference price of the element. The coefficient for technical recyclability is represented by Q, and the prediction confidence level is calibrated using the validation set. This represents the estimated additional testing cost required for extended XRF detection, resampling, and ICP-MS verification. N(·) represents a 0-1 normalization based on the upper and lower limits of historical samples. , and These are weights for value, confidence level, and detection cost, respectively, and the sum of these three is 1. In this embodiment, the preferred weight is... =0.60、 =0.25、 =0.15, and the weight can be adjusted by a weighted objective of the false negative rate of high-value samples on the validation set and the cost of ICP-MS verification. The higher the score, the greater the resource value of the sample or the greater the necessity of verification.

[0054] The central control unit determines the confidence threshold based on the distribution of prediction confidence and ICP-MS relative error in historical samples. The lowest confidence level corresponding to the 95th percentile of the relative error not exceeding the allowable error threshold is taken as... When Q≥ Furthermore, if the ValueScore is lower than the preset scoring threshold, the XRF prediction result is output directly; if Q < At this point, the integration time is extended by the square of the ratio of the target signal-to-noise ratio to the measured signal-to-noise ratio, and the tube voltage is increased based on the characteristic spectral lines or absorption edge energy of the target element. If the detector count rate is below 80% of the saturation count rate, the tube current is increased, and the detection is repeated. If Q is still below [a certain value] after re-detection... If the ValueScore reaches a preset scoring threshold and Q is lower than a high confidence threshold, or if the relative deviation between repeated sampling results exceeds an allowable deviation threshold, then ICP-MS precise quantitative detection is triggered. After ICP-MS completes the detection, it writes the true value, sample number, corresponding XRF spectrum number, detection parameters, principal element content, prediction results, and confidence correlation into a sliding window database for updating the confidence-error mapping relationship and subsequent incremental model training. To control the cost of obtaining the true value for ICP-MS, the system sets the upper limit for obtaining samples with true values ​​at 15% of the daily detection volume, supplemented by unsupervised reconstruction error and spectral peak position drift as weak supervision drift signals; only when the weak supervision signal is triggered is the ICP-MS sampling ratio increased to the minimum update sample size Nmin requirement, thereby reducing the dependence of closed-loop on expensive true values.

[0055] Step S6, ICP-MS Precise Quantitative Detection Unit: The preset reliability threshold is determined based on the error distribution between historical X-ray fluorescence prediction results and corresponding ICP-MS reference quantitative values; when Q ≥ When the ValueScore is lower than the preset scoring threshold, the XRF prediction result is directly output. When the prediction confidence of the sample is lower than the preset confidence threshold, the integration time is extended according to the signal-to-noise ratio of the target element's characteristic spectral peak, and the tube voltage and tube current are adjusted according to the target element's characteristic spectral line energy and detector count rate. X-ray fluorescence data is reacquired and the prediction confidence is obtained again. When the re-obtained prediction confidence is still lower than the preset confidence threshold, or the sample's resource value evaluation parameter is higher than the preset value threshold and the prediction confidence is lower than the preset high confidence threshold, or the relative deviation between repeated sampling detection results exceeds the allowable deviation threshold, ICP-MS detection is triggered. To control the cost of ICP-MS true value acquisition, the system sets the upper limit of the acquisition of samples with true values ​​to 15% of the daily detection volume, and supplements it with unsupervised reconstruction error and spectral peak position drift as weak supervision drift signals. Only when the weak supervision signal is triggered is the ICP-MS sampling ratio increased to the minimum update sample volume Nmin requirement, thereby reducing the dependence of the closed loop on expensive true values.

[0056] Step S7, Data Feedback and Model Update: To adapt the model to bulk solid waste samples from different sources and with different compositions, the central control unit establishes a sliding window database. ICP-MS detection results, corresponding X-ray fluorescence data, and matrix composition parameters are written into the sliding window database, and the intelligent prediction model is incrementally updated when the prediction error or characteristic distribution shift meets preset drift conditions.

[0057] like Figure 5As shown, the sliding window database continuously receives ICP-MS detection results and corresponding XRF data and matrix composition parameters, performs real-time drift monitoring, monitors the drift of the predicted residuals using the CUSUM algorithm, and evaluates the drift of the input distribution using MMD. When the drift meets the preset triggering conditions and the number of newly labeled samples reaches the preset minimum update number Nmin, the basic feature extraction parameters of the convolutional neural network CNN and Transformer are frozen, and the element concentration prediction parameters, matrix effect compensation parameters, and weight coefficients of the physical constraint error term are updated to complete the dynamic update of the model.

[0058] The sliding window database stores sample information, X-ray fluorescence data, matrix composition parameters, prediction results, ICP-MS reference quantitative values, prediction errors, and drift indicators. Low-confidence samples with ICP-MS reference quantitative values, samples with resource value evaluation parameters exceeding a preset value threshold, abnormal samples from repeated testing, and sampled samples are written into the sliding window database. Data drift is determined based on the matrix composition distribution, scattering characteristic distribution, target spectral peak characteristic distribution, spectral peak position drift, spectral peak fitting residual, unsupervised reconstruction error, and prediction residual distribution between the sliding window samples and the benchmark training samples. When the unsupervised drift signal meets a preset weak supervision trigger condition, the ICP-MS sampling ratio of the corresponding sample is increased. When the prediction residual drift or input distribution drift meets a preset trigger condition, and the number of newly labeled samples reaches a preset minimum update quantity, the basic feature extraction parameters of the convolutional neural network and Transformer are frozen, and the elemental concentration prediction parameters, matrix effect compensation parameters, and weight coefficients of the physical constraint error term are updated.

[0059] The model parameters are updated using incremental gradient descent, and the parameter update process can be expressed as follows:

[0060] In the formula, θ represents the model parameters to be updated, η represents the learning rate, L represents the joint loss function, and t represents the current update count. In this embodiment, the learning rate is set to 0.0001, and a minimum update sample size threshold is set. . The minimum number of samples required to validate a 95% confidence interval width of no more than 2 percentage points for the mean relative error of the validation set was determined by bootstrap sampling of newly added ICP-MS labeled samples. Under the data conditions of this embodiment Take 10 groups. Only when the number of newly labeled samples reaches... Incremental updates are performed only when the data drift condition is met. During updates, the CNN convolutional layers and Transformer coding layers are frozen, and only the output layer parameters of the element concentration prediction layer and matrix compensation network, as well as the physical constraint correction parameters and weight coefficients λ, are fine-tuned. The updated model replaces the original model only when the average relative error on the independent validation set is lower than that of the original model and the physical constraint error is no higher than 105% of that of the original model, in order to reduce the risk of model drift or catastrophic forgetting caused by small-sample updates.

[0061] During online learning, the central control unit simultaneously monitors the prediction residuals and the input feature distribution. The relative error is calculated for samples with true ICP-MS values. = The cumulative sum CUSUM algorithm is used for drift detection, and its statistics are calculated as follows:

[0062] In the formula, This represents the current CUSUM statistic. This indicates the previous statistic. This represents the average relative error of the current batch of tests, where ν represents the reference error value. The mean is calculated based on the errors of the model benchmark validation set. and standard deviation and set ν= +0.5 CUSUM threshold h=5 Each testing batch must contain at least 10 samples with true ICP-MS values; when If three consecutive batches of tests exceed h, the predicted residual is determined to have drifted and a drift flag is set.

[0063] Meanwhile, the Maximum Mean Discrepancy (MMD) is used to evaluate the difference in input distribution between the current sliding window and the model's baseline training set. The calculation only includes invariants that do not change with the model version, such as the content of major elements, scattering characteristics, and net intensity of the original spectral peaks. Target element-specific fusion features are not used (as they change with incremental model updates and are inconsistent across versions). The calculation formula is as follows:

[0064] In the formula, This represents the spectral feature samples in the current sliding window. Represents the original training set samples. This represents the kernel space mapping function. When the MMD value exceeds a preset threshold, it indicates that the current distribution of detected samples has significantly deviated from the distribution of training samples. The central control unit automatically calls the latest labeled samples in the sliding window database and retrains the model by combining them with historical representative samples. This allows the model to quickly adapt to the new solid waste composition and improves the prediction accuracy and stability under long-term operating conditions.

[0065] In the formula, x represents the feature sample in the current sliding window, y represents the model benchmark training set sample, and φ represents the kernel space mapping function. 1000 equal-capacity Bootstrap samples are performed using the benchmark training set, and the 95th percentile of the resulting MMD distribution is used as the MMD threshold. When the MMD exceeds the threshold for two consecutive sliding windows, the input distribution is considered to have drifted; if the newly added samples with the true ICP-MS value have not yet reached the threshold... The central control unit increases the ICP-MS sampling rate for the corresponding samples until the required sample size for updating is met. This occurs when either the CUSUM or MMD condition is met and the number of newly labeled samples reaches a certain threshold. At that time, the sliding window sample is invoked to perform incremental updates within a limited parameter range.

[0066] like Figure 6The diagram shows the hardware module composition and communication relationships of the central control unit. The central control unit (e.g., an industrial computer / embedded system), as the core control module of the entire detection system, is responsible for coordinating data interaction and task scheduling between the sample pretreatment unit, X-ray fluorescence detection unit, ICP-MS detection unit, intelligent prediction unit, and data storage unit. The data acquisition and preprocessing module connects to the spectrometer (e.g., XRF / LIBS) via USB, connects to the sensor group (e.g., temperature / pressure) via analog I / O, and communicates with the central control unit via Ethernet. The human-machine interface (HMI) interacts with the central control unit via Ethernet. The power management and status monitoring module is connected to the central control unit via RS485. The material conveying system control module is scheduled by the central control unit via Ethernet. The result output and sorting actuators are driven by the central control unit via digital I / O. The network communication module connects to the central control unit via Ethernet and interfaces with the cloud / server. The physical constraint calculation acceleration module (e.g., GPU / FPGA) is connected to the central control unit via USB / PCIe. After the system starts, the operator first inputs the type of solid waste to be tested and the target detection element on the human-machine interface. The central control unit automatically calls the corresponding detection model and detection parameters, and controls the robotic arm to sequentially complete sample transfer, spectral acquisition, data analysis, and output of detection results. During the detection process, each functional unit achieves high-speed communication through industrial Ethernet or EtherCAT bus to ensure real-time transmission of detection data and synchronous control of equipment. The central control unit also records information such as detection time, sample number, detection result, prediction confidence level, value score, model version, and equipment operating status in real time, and stores them uniformly in the database, providing complete data support for subsequent quality traceability and model optimization.

[0067] In addition, the central control unit also has anomaly detection and intelligent alarm functions. When the prediction error of multiple consecutive samples exceeds the set threshold, the system automatically prompts that the model may drift; when the count rate of the X-ray fluorescence detector drops significantly, it automatically prompts that the detector is contaminated or the sample preparation is abnormal; when the ICP-MS detection results show abnormal fluctuations, it automatically prompts that the instrument is drifting and suggests recalibration; when the communication module detects that the equipment is offline or that the communication is abnormal, it immediately suspends the detection process and issues an alarm message, thereby ensuring the long-term stable operation of the entire detection system.

[0068] To verify the detection performance of this invention, six types of actual industrial solid waste—red mud, electroplating sludge, smelting slag, fly ash, tailings, and spent catalysts—were selected. Twenty samples were randomly selected from each type, and the ICP-MS detection results were used as the true concentration values. The same test sample was detected using the traditional XRF basic parameter quantification method, a CNN model without Sherman physical constraints and online update mechanisms, and the method of this invention, respectively.

[0069] like Figure 7As shown, for six typical bulk solid wastes—red mud, electroplating sludge, smelting slag, fly ash, tailings, and spent catalysts—the method of this invention significantly reduces the average relative error compared to the traditional XRF fundamental parameter quantitative method (FP) and the ordinary CNN model without Sherman physical constraints (DL-only). A comparison of the three quantitative analysis methods reveals: 1. The traditional FP method (XRF fundamental parameter method) suffers from large interference in complex matrices, leading to a relatively large relative error (limited prediction accuracy); 2. The ordinary DL-only model (pure data-driven CNN) lacks physical constraints, resulting in a relatively high relative error (prone to overfitting / weak generalization); 3. The method of this invention employs dynamic correction based on physical constraints, achieving a dual-drive approach of physics and data, significantly reducing the average relative error. Conclusion: This invention demonstrates the best accuracy in the detection of rare and precious metals in complex solid wastes.

[0070] Evaluation metrics include mean relative error (MRE), root mean square error (RMSE), and coefficient of determination (R²). 2 The 95th percentile of the relative error was recorded; the number of low-confidence triggers and the ICP-MS verification hit rate were also recorded. The verification hit rate is the ratio of the number of samples that triggered verification, whose XRF prediction relative error exceeded the allowable error threshold or whose resource value level changed as confirmed by ICP-MS, to the total number of samples that triggered verification. The verification hit rates in Tables 2 and 3 adopt the above unified definition, and the denominator is the total number of samples that actually completed ICP-MS verification under each statistical caliber: Table 2 is statistically analyzed by solid waste type, and Table 3 is the full statistics of continuous operation (including three types of triggers: low-confidence, high-value, and repeated sampling). The settings of various types of samples and target elements are shown in Table 1.

[0071] Table 1 Industrial validation sample and target element settings

[0072] The quantitative results of each method were statistically analyzed according to the items listed in Table 2. Exemplary statistical results show that the average relative error of the method of this invention in six types of solid waste samples is 4.6%–7.8%, lower than the 12.4%–19.2% of the traditional XRF method and the 7.1%–12.6% of the ordinary CNN model. Specifically, the average relative error for Sc, Y, La, and Ce in red mud is 4.6%, for Ga, In, and Ge in smelting slag it is 5.5%, and for Au, Ag, and Pd in ​​electroplating sludge it is 7.4%. The hit rate of low-confidence triggered samples after ICP-MS verification is 80.0%–88.9%, indicating that the confidence triggering mechanism can relatively effectively identify high-error or high-value verification samples.

[0073] Table 2 Statistical results of different detection methods

[0074] Further continuous industrial operation validation was conducted, with six types of solid waste samples randomly mixed and 3000 sets of samples continuously tested. During operation, 386 low-confidence triggers occurred, and 492 sets of ICP-MS verifications were completed, including low-confidence trigger verifications, high-value trigger verifications, verifications of repeated sampling anomalies, and verifications of sampled samples. The low-confidence trigger verification hit rate was 81.5%. CUSUM and MMD identified drift events 7 and 5 times respectively, with some events simultaneously meeting both criteria, ultimately triggering 8 incremental model updates. The average relative error before the model update was 7.2%, which decreased to 5.4% after the update. The above data are used to illustrate the closed-loop relationship between detection path switching, drift identification, and incremental updates of limiting parameters. Figure 8 As shown, after the system enters long-term operation mode, it first continuously collects real-time solid waste flow data (data sources include sensors, SCADA, monitoring systems, etc.) for feature extraction and monitoring (covering data preprocessing, feature engineering, and status monitoring). Then, the drift detection subsystem (using drift detection algorithms such as ADWIN and DDM) determines whether concept drift has been triggered. If triggered, model correction and rapid adaptation are performed; otherwise, standard online incremental learning (continuously updating the model) is executed, and model prediction errors (such as MAE, RMSE, MAPE, etc.) are calculated. Simultaneously, the system records data (time, error, drift events, stored in a time-series database / file) for validation analysis to evaluate model performance and drift impact. It constructs an "error-time-drift" curve (visualized data processing and feature annotation), analyzes the error variation over time (identifying trends, cycles, and abrupt changes), and concludes that the online learning effectiveness has been validated, assessing the model's robustness and adaptability. This completes the validation cycle.

[0075] Table 3 Statistical Items for Continuous Industrial Operation Verification

[0076] As can be seen from the exemplary data shown in Tables 2 and 3, the average relative error of the method of the present invention in six types of solid waste is lower than that of the two comparative methods, and the ICP-MS verification after low confidence triggering has a high hit rate; during continuous operation, the average relative error of the model decreased from 7.2% to 5.4% after the limited parameter incremental update.

[0077] In addition, this embodiment also provides a rare and precious metal detection system for bulk solid waste integrating physical constraint dynamic correction, including a sample pretreatment unit, an X-ray fluorescence rapid detection unit, an ICP-MS precise quantification unit, a data storage unit, an intelligent prediction unit, and a central control unit. The sample pretreatment unit is used to homogenize the bulk solid waste sample. The X-ray fluorescence rapid detection unit is used to collect the full spectrum of X-ray fluorescence data of the sample. The intelligent prediction unit is used to extract spectral features and matrix composition features, and output the predicted concentration of the analyte and the prediction confidence level based on the physical constraint intelligent prediction model. The ICP-MS precise quantification unit is used to obtain the ICP-MS reference quantitative value of the sample. The data storage unit is used to associate and store sample information, X-ray fluorescence data, ICP-MS reference quantitative value, and model parameters. The central control unit is communicatively connected to each of the above units, and is used to control the detection path according to the prediction confidence level and resource value evaluation parameters, and to feed back the ICP-MS reference quantitative value to the intelligent prediction unit for model correction and model update.

[0078] Specifically, the intelligent prediction unit includes a spectral window segmentation module, a convolutional neural network feature extraction module, a matrix effect compensation module, a Transformer feature fusion module, a physical constraint correction module, and an elemental concentration prediction module. The matrix effect compensation module encodes the principal matrix element spectral peak features and composition parameters into a matrix feature vector, and uses the matrix feature vector to modulate the attention weights of the Transformer, while performing element-wise multiplicative correction on the spectral feature vector output by the convolutional neural network. The physical constraint correction module constructs a physical constraint between the theoretical fluorescence intensity and the measured fluorescence intensity based on Sherman fluorescence quantitative theory.

[0079] The central control unit adjusts the integration time, tube voltage, and tube current of the X-ray fluorescence rapid detection unit based on the matrix interference intensity, the signal-to-noise ratio of the target element's characteristic spectral peak, the prediction confidence level, and the resource value evaluation parameters. When the matrix interference intensity exceeds a preset interference threshold or the signal-to-noise ratio of the target element's characteristic spectral peak is lower than a preset signal-to-noise ratio threshold, the integration time is extended, and the tube voltage or tube current is adjusted when the detector count rate is lower than a preset upper limit. When the adjusted prediction confidence level is still lower than a preset confidence threshold, or the resource value evaluation parameters are higher than a preset value threshold and the prediction confidence level is lower than a preset high confidence threshold, or the deviation of repeated detection results exceeds the allowable deviation threshold, the ICP-MS detection process is triggered or an ICP-MS verification instruction is generated.

[0080] The intelligent prediction unit also includes an online learning and update module. This module determines data drift based on the matrix composition distribution, spectral feature distribution, unsupervised drift signal, and prediction residual distribution between the sliding window samples and the benchmark training samples. It performs incremental updates when the data drift meets preset triggering conditions and the number of newly labeled samples reaches a preset minimum update number. During incremental updates, the basic convolutional layers of the convolutional neural network and the encoding layers of the Transformer network are frozen, and only the prediction layer parameters of the element concentration prediction module, the output layer parameters of the matrix effect compensation module, and the weight parameters of the physical constraint correction module are updated.

[0081] This embodiment also provides an electronic device and a storage medium. The electronic device includes a processor, a memory, and a computer program stored in the memory. When the processor executes the computer program, it implements the above-described method for detecting rare and precious metals in bulk solid waste with integrated physical constraint dynamic correction. A computer-readable storage medium, which is non-transitory, stores a computer program. When the computer program is executed by the processor, it implements the above-described method for detecting rare and precious metals in bulk solid waste with integrated physical constraint dynamic correction.

[0082] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," and "counterclockwise," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0083] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0084] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for detecting rare and precious metals in bulk solid waste by integrating physical constraint dynamic correction, characterized in that, Includes the following steps: Step S1, Sample Pretreatment Unit: Large-volume solid waste samples are crushed, dried, ground, and sieved to obtain uniform samples; Step S2, X-ray fluorescence spectroscopy detection unit: Collect the full spectrum of X-ray fluorescence of the homogeneous sample, and extract the spectral characteristic parameters and the main matrix elemental composition parameters; Among them, the target element characteristic peak window, background window, interference element spectral peak window, principal matrix element spectral peak window and scattering characteristic window are divided according to the energy position of the element to be measured, the interfering element and the scattering peak; The spectral characteristic parameters include the target element peak intensity, peak area, peak width, peak-to-background ratio, spectral peak position, interference peak intensity, Compton scattering peak intensity, Rayleigh scattering peak intensity, and adjacent background intensity. Step S3, Intelligent Prediction Unit: A matrix feature vector is generated based on the principal matrix element composition parameters; the spectral feature parameters and the principal matrix element composition parameters are input into the intelligent prediction model, and the attention weights of the Transformer are modulated using the matrix feature vector to form a target element-specific feature. The intelligent prediction model generates an absorption correction factor based on the content of principal matrix elements and scene interference elements, the characteristic peak energy of the target element, and the corresponding mass absorption coefficient. The principal matrix elements include one or more of Fe, Al, Si, Ca, Mg, and Ti, and the scene interference elements include one or more of Zn, Ni, and Cu, or a pre-configured set of interference elements based on the type of solid waste. An enhancement correction factor is generated based on the secondary excitation contribution of the principal matrix elements and scene interference elements to the fluorescence spectral lines of the target element, and a scattering background correction is generated based on the Compton scattering peak intensity, Rayleigh scattering peak intensity, and adjacent background intensity. The measured net peak intensity of the target element's characteristic spectral lines is additively subtracted using the scattering background correction, and the absorption correction factor and enhancement correction factor are multiplicatively corrected to obtain the matrix-compensated spectral line intensity. Step S4, Physical constraint dynamic correction unit: A physical constraint error term is constructed based on Sherman quantitative fluorescence theory, and together with a data error term constructed based on the true value of ICP-MS detection, the intelligent prediction model is constrained to obtain the prediction result of the concentration of the analyte and the prediction confidence level. Step S5, Review Priority Evaluation Unit: Based on the concentration prediction results, prediction confidence level, market reference price of target element, technical recoverability coefficient and expected additional detection cost, calculate the comprehensive review priority score of the sample, and determine the detection path based on the comprehensive review priority score; Step S6, ICP-MS Precision Quantification Unit: When the prediction confidence level is lower than the preset confidence threshold or the resource value evaluation parameter is higher than the preset value threshold, ICP-MS detection is triggered. Step S7, Data Feedback and Model Update: The ICP-MS detection results, corresponding X-ray fluorescence data, and matrix composition parameters are written into a sliding window database, and the intelligent prediction model is incrementally updated when the prediction error or feature distribution shift meets the preset drift conditions.

2. The method according to claim 1, characterized in that, In step S3, a convolutional neural network is used to extract target peak features, background features, and interference features to obtain a high-dimensional spectral feature vector. The principal matrix element composition parameters are encoded into a matrix feature vector, and the matrix feature vector is used to modulate the attention weights of the Transformer to fuse the high-dimensional spectral feature vector to form a target element-specific feature.

3. The method according to claim 2, characterized in that, The training objective function of the intelligent prediction model is: ; in, This is the data error term between the predicted elemental concentration and the corresponding ICP-MS reference quantitative value. The physical constraint error term between the theoretical fluorescence intensity calculated according to the Sherman equation and the matrix-compensated spectral line intensity is represented by λ, which is a weighting coefficient ranging from 0.05 to 1.

0. The initial value is set based on the matrix complexity and is determined according to the formula... and The physical error contribution ratio and the validation set prediction error are adaptively adjusted, wherein the physical error contribution ratio r satisfies: .

4. The method according to claim 1, characterized in that, In step S6, the preset confidence threshold is determined based on the error distribution between historical X-ray fluorescence prediction results and corresponding ICP-MS reference quantitative values. When the predicted confidence of a sample is lower than the preset confidence threshold, the integration time is extended according to the signal-to-noise ratio of the target element's characteristic spectral peaks, and the tube voltage and tube current are adjusted according to the target element's characteristic spectral line energy and detector count rate. X-ray fluorescence data are reacquired, and the predicted confidence is obtained again. When the re-obtained predicted confidence is still lower than the preset confidence threshold, or the sample's resource value evaluation parameter is higher than a preset value threshold and the predicted confidence is lower than a preset high confidence threshold, or the relative deviation between repeated sampling detection results exceeds the allowable deviation threshold, ICP-MS detection is triggered.

5. The method according to claim 1, characterized in that, In step S7, the sliding window database is used to store sample information, X-ray fluorescence data, matrix composition parameters, prediction results, ICP-MS reference quantitative values, prediction errors, and drift indicators. Low-confidence samples with ICP-MS reference quantitative values, samples with resource value evaluation parameters higher than a preset value threshold, abnormal samples from repeated detections, and sampled samples are written into the sliding window database. Data drift is determined based on the matrix composition distribution, scattering feature distribution, target spectral peak feature distribution, spectral peak position drift, spectral peak fitting residual, unsupervised reconstruction error, and prediction residual distribution between the sliding window samples and the benchmark training samples. When the unsupervised drift signal meets a preset weak supervision trigger condition, the ICP-MS sampling ratio of the corresponding sample is increased. When the prediction residual drift or input distribution drift meets a preset trigger condition, and the number of newly labeled samples reaches a preset minimum update quantity, the basic feature extraction parameters of the convolutional neural network and Transformer are frozen, and the elemental concentration prediction parameters, matrix effect compensation parameters, and weight coefficients of the physical constraint error term are updated.

6. A system for detecting rare and precious metals in bulk solid waste based on the method for integrating physical constraint dynamic correction as described in any one of claims 1-5, characterized in that, The system includes a sample pretreatment unit, an X-ray fluorescence rapid detection unit, an ICP-MS precise quantification unit, a data storage unit, an intelligent prediction unit, and a central control unit. The sample pretreatment unit homogenizes bulk solid waste samples. The X-ray fluorescence rapid detection unit acquires full-spectrum X-ray fluorescence data of the samples. The intelligent prediction unit extracts spectral and matrix composition features and outputs predicted concentrations and confidence levels of the analytes based on a physically constrained intelligent prediction model. The ICP-MS precise quantification unit obtains ICP-MS reference quantitative values ​​for the samples. The data storage unit stores sample information, X-ray fluorescence data, ICP-MS reference quantitative values, and model parameters. The central control unit communicates with each of the above units, controls the detection path based on the prediction confidence level and resource value evaluation parameters, and feeds back the ICP-MS reference quantitative values ​​to the intelligent prediction unit for model correction and updates.

7. The system according to claim 6, characterized in that, The intelligent prediction unit includes a spectral window segmentation module, a convolutional neural network feature extraction module, a matrix effect compensation module, a Transformer feature fusion module, a physical constraint correction module, and an element concentration prediction module. The matrix effect compensation module encodes the spectral peak features and composition parameters of the principal matrix elements into matrix feature vectors, and uses the matrix feature vectors to modulate the attention weights of the Transformer, while performing element-wise multiplicative correction on the spectral feature vectors output by the convolutional neural network. The physical constraint correction module constructs a physical constraint between theoretical fluorescence intensity and measured fluorescence intensity based on Sherman quantitative fluorescence theory.

8. The system according to claim 6, characterized in that, The central control unit adjusts the integration time, tube voltage, and tube current of the X-ray fluorescence rapid detection unit based on the matrix interference intensity, the signal-to-noise ratio of the target element's characteristic spectral peak, the prediction confidence level, and the resource value evaluation parameters. When the matrix interference intensity exceeds a preset interference threshold or the signal-to-noise ratio of the target element's characteristic spectral peak is lower than a preset signal-to-noise ratio threshold, the integration time is extended, and the tube voltage or tube current is adjusted when the detector count rate is lower than a preset upper limit. When the adjusted prediction confidence level is still lower than a preset confidence threshold, or the resource value evaluation parameters are higher than a preset value threshold and the prediction confidence level is lower than a preset high confidence threshold, or the deviation of repeated detection results exceeds the allowable deviation threshold, the ICP-MS detection process is triggered or an ICP-MS verification instruction is generated.

9. The system according to claim 6, characterized in that, The intelligent prediction unit also includes an online learning and update module. The online learning and update module is used to determine data drift based on the matrix composition distribution, spectral feature distribution, unsupervised drift signal and prediction residual distribution between the sliding window sample and the benchmark training sample, and to perform incremental update when the data drift meets the preset triggering condition and the number of newly labeled samples reaches the preset minimum update number. Specifically, when performing incremental updates, the basic convolutional layers of the convolutional neural network and the encoding layers of the Transformer network are frozen, and only the prediction layer parameters of the element concentration prediction module, the output layer parameters of the matrix effect compensation module, and the weight parameters of the physical constraint correction module are updated.

Citation Information

Patent Citations

  • Laser spectrum data processing method for analyzing uranium polymetallic ore elements

    CN119741998A

  • Water quality heavy metal detection system based on energy dispersion

    CN121186101A