A multi-component heavy metal spectroscopy deep learning detection method

By combining the combination of chemical probe color development and deep learning models, differentiated UV-Vis superimposed spectra are generated, and the Transformer model is used for global modeling, which solves the problems of expensive equipment, complex processes and difficult multi-component detection of traditional heavy metal detection methods, and achieves fast and high-precision multi-component heavy metal detection.

CN119935920BActive Publication Date: 2025-09-02NORTHWEST UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510439291.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2025-09-02
Estimated Expiration
2045-04-09

AI Technical Summary

Technical Problem

Traditional heavy metal detection methods require expensive instruments and equipment, the detection process is complex, it is difficult to achieve real-time rapid detection, and it cannot meet the synchronous detection requirements of multi-component heavy metals, and there are problems of cross interference and insufficient sensitivity.

Method used

The combined chemical probe color development technology is used to generate differentiated UV-Vis superimposed spectra, combined with deep learning models for multi-component heavy metal detection, global modeling is performed through the Transformer model, and a lightweight system is integrated to achieve fast and multi-component synchronous detection.

Benefits of technology

It realizes fast, high-precision and low-cost multi-component heavy metal detection, reduces detection time and equipment costs, improves detection efficiency and accuracy, and is suitable for high-precision detection of complex environmental samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119935920B_ABST
    Figure CN119935920B_ABST
Patent Text Reader

Abstract

The present invention discloses a multi-component heavy metal spectroscopy deep learning detection method and system, which belongs to the field of analytical chemistry and instrumental analysis technology. The method enhances the UV-Vis spectral differences of multi-component heavy metals by combining chemical probe color development technology, combines deep learning models to analyze complex nonlinear spectral signals, and improves the model generalization ability through data enhancement strategies. The system integrates a lightweight end-to-end detection platform, adapts to low-cost portable devices, and realizes minute-level multi-component synchronous detection. The present invention forms a closed-loop technical path through three core technologies (combination probe → spectral enhancement → deep learning), breaking through the technical bottlenecks of traditional methods in multi-component, small sample, and complex scenarios, and providing an efficient, accurate, low-cost complete solution for heavy metal pollution prevention and control. It solves the problems of expensive equipment, low detection efficiency and insufficient multi-component analysis capabilities of traditional methods, and is suitable for scenarios such as environmental monitoring and sewage treatment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of analytical chemistry and instrumental analysis technology, and specifically to a multi-component heavy metal spectroscopy deep learning detection method. Background Art

[0002] Heavy metal pollution has become an environmental issue of global concern. Many heavy metals, such as mercury, cadmium, and lead, are highly biotoxic, can persist in the environment for long periods, and accumulate through the food chain, posing serious risks to human health and ecosystems. Cases such as mercury poisoning causing neurological diseases and cadmium pollution causing kidney damage are common. Accurately detecting heavy metal levels in the environment and various samples is crucial for pollution control, risk assessment, and protecting public health. However, traditional heavy metal detection methods have many shortcomings. For example, atomic absorption spectroscopy and inductively coupled plasma mass spectrometry often require expensive instruments and equipment, with high initial investment costs. The detection process is complex, involving tedious sample pretreatment and instrument operation, and the detection cycle is long, making it difficult to achieve real-time rapid detection. Moreover, they can usually only detect a single heavy metal and cannot meet the needs of simultaneous detection of multiple heavy metal components in the actual environment.

[0003] While traditional heavy metal detection methods can provide highly accurate results, they rely on expensive and complex instrumentation, and the testing process is cumbersome and time-consuming. These methods exhibit significant limitations in the simultaneous detection of multi-component heavy metals, particularly in complex environmental samples, where they face challenges such as insufficient sensitivity, severe cross-interference, and limited spectral resolution. This results in low detection accuracy and a limited scope of application, making it difficult to meet the demand for real-time, rapid, efficient, and low-cost simultaneous multi-component detection.

[0004] Specific defects and solutions of the existing technology: (1) Insufficient optimization of heavy metal combination chemical probes: Traditional probes are designed for single heavy metals, with poor color reaction specificity, significant signal cross-interference when multiple components coexist, and low sensitivity for low-concentration detection. The present invention designs combination chemical probes to trigger heavy metal-specific complexation color development, significantly improving the multi-component signal separation capability and detection limit; (2) Limited improvement in UV-Vis spectral dimension: Traditional linear spectral analysis methods are difficult to model the complex nonlinear relationship between the absorbance and concentration of multiple components. The present invention combines combination probe color development technology to induce mixed heavy metal solutions to form broadband superposition spectra, and captures the global dependency of long wavelength sequences through the self-attention mechanism of deep learning models, breaking through the local feature extraction limitations of traditional methods; (3) Limited data volume and low degree of standardization: Traditional experimental data is small in volume and lacks diversity, which restricts the training effect of deep learning models. The present invention proposes a physical and chemical driven data enhancement strategy to improve the model generalization ability; (4) Insufficient performance of chemometric models: Traditional models have weak global feature analysis capabilities for complex spectra and cannot achieve multi-component synchronous prediction. Summary of the Invention

[0005] The present invention aims to provide a multi-component heavy metal spectroscopy deep learning detection method. At the analytical detection method level, the present invention aims to achieve differentiated characterization of multi-component colorimetric signals by combining chemical probes with superimposed spectroscopy technology, addressing the severe cross-interference and low sensitivity issues of traditional probes. At the model level, the global modeling capabilities of deep learning models overcome the local feature limitations of traditional spectral analysis, constructing an end-to-end deep learning model to accurately analyze complex nonlinear spectral signals. At the application level, the invention integrates a lightweight system to achieve rapid, simultaneous multi-component detection and improves on-site detection efficiency through automated operation, providing an intelligent and scalable solution for environmental monitoring. Through a closed-loop technical path of "combined chemical probe colorimetric development-data enhancement-global modeling-lightweight system integration," the present invention deeply integrates chemical mechanisms with deep learning, suppressing cross-interference and enhancing spectral characterization dimensions, ultimately forming a rapid, high-precision, and low-cost multi-component heavy metal detection system. The core goal of the present invention is to address the bottlenecks of traditional methods in detection efficiency, multi-component analysis, equipment cost, and data dependency, promoting the upgrading of environmental monitoring technology to intelligent and portable technologies, and providing real-time, reliable technical support for scenarios such as sewage treatment and river monitoring.

[0006] The present invention is achieved through the following technical solutions:

[0007] The present invention provides a multi-component heavy metal spectroscopy deep learning detection method, comprising the following steps:

[0008] The multi-component heavy metal dispersion system is configured with combinatorial chemical probes. Through orthogonal experiments, the colorimetric ratio and reaction conditions are screened to trigger the specific colorimetric reaction of the multi-component heavy metals and generate differentiated UV-Vis superposition spectra.

[0009] High-throughput acquisition of UV-Vis superposition spectra of multi-component heavy metal dispersions, with data enhancement through Gaussian noise and spectral mixing techniques;

[0010] Data standardization and dataset preparation: Gaussian noise addition, spectral mixing, and standardization are performed on the original spectral data based on physical and chemical mechanisms to generate an extended training dataset;

[0011] Development of a deep learning model for multi-component heavy metal dispersions. This model uses an end-to-end design and a Transformer model. By inputting a standardized absorbance sequence and embedding sine-cosine position encoding, it achieves automated analysis of the entire process from raw spectral data input to multi-component concentration output.

[0012] Model performance evaluation uses a variety of regression evaluation indicators, including root mean square error (RMSE), determination coefficient (R2 ) and mean absolute error (MAE).

[0013] A rapid and synchronous detection platform for multi-component heavy metal solutions has been developed. By directly inputting the absorbance of the metal mixed solution, the concentration of the metal contained in the sample can be directly predicted end-to-end.

[0014] Furthermore, the chromogenic agents of the combinatorial chemical probe were selected from at least two of the thioamide, azo, or porphyrin classes. Orthogonal experiments were used to optimize the reaction conditions, including a pH range of 6.0-8.5, a reaction temperature of 20-40°C, and a reaction time of 5-30 minutes. A variety of heavy metal ions were selected as target analytes, and multiple chromogenic agents were screened based on their chemical properties. These agents had different specificities and reactivity characteristics, capable of forming colorimetric reactions with different heavy metal ions. Next, these chromogenic agents were randomly combined to form multiple combinatorial chemical probes to improve their responsiveness to multi-component heavy metals. Subsequently, the configured combinatorial chemical probes were mixed with a single heavy metal solution in a multiwell plate, and the colorimetric reaction was observed. During this process, the sensitivity, selectivity, and stability of the colorimetric reaction were evaluated by comparing the reactions of different combinatorial probes with metals. Ultimately, the metal and chromogenic agent combination with the best colorimetric effect was selected to ensure optimal colorimetric signal and minimal interference in multi-metal samples.

[0015] Furthermore, the Gaussian noise parameters used in data augmentation can be quantitatively set based on spectral characteristics, and the spectral mixing ratio α follows a uniform distribution. To improve model training performance and generalization, the raw data undergoes systematic augmentation and preprocessing. To overcome the limitations of small sample sizes, a data augmentation strategy based on physicochemical mechanisms is designed. This strategy adds Gaussian noise and combines spectral mixing techniques to generate diverse samples. The absorbance data is then normalized to eliminate dimensional differences. To address the skewed distribution of heavy metal concentration data, a natural logarithm transformation is used to compress the numerical span of high-concentration samples, enhancing the model's ability to resolve low-concentration regions.

[0016] Furthermore, the Transformer model includes three levels of cascaded encoders. Each level of encoder is equipped with a multi-head self-attention mechanism and uses the ReLU activation function and layer normalization operation. The model directly receives the standardized absorbance sequence and outputs the concentration values ​​of various heavy metals through self-learning feature extraction and analysis. To solve the problem that deep learning models are insensitive to sequence position, the position encoding layer uses the sine-cosine function to embed wavelength sequence information. The formula is as follows:

[0017] (1)

[0018] (2)

[0019] Where pos is the wavelength position index and i is the encoding dimension;

[0020] The model stacks multiple encoder layers, each with a multi-head self-attention mechanism. This mechanism uses scaled dot-product attention (Formula 3) to resolve global dependencies between wavelengths. A feedforward network further nonlinearly maps features, supplemented by residual connections and layer normalization to stabilize the training process. After a global average pooling layer compresses the sequence dimensions, a fully connected layer outputs a multidimensional logarithmically transformed concentration vector. Ultimately, the true concentration value is restored through an inverse exponential transformation (Formula 4). The attention (Formula 3) and exponential transformation (Formula 4) are as follows:

[0021] Attention(Q,K,V)=softmax( )V (3)

[0022] Among them, Q, K, V are query matrix, key matrix and value matrix respectively, d k is the key matrix dimension, Attention(Q,K,V) is the result of self-attention calculation, and T represents the matrix transpose operation;

[0023] (4)

[0024] Among them, y log is the standardized value, y pred is the value after inverse transformation;

[0025] The Transformer model consists of a 4-level encoder, each equipped with a 6-head self-attention mechanism, a head dimension of 128, a feedforward network dimension of 512, and an activation function of GeLU; the position encoding dimension d = 256, covering the full wavelength range of 230-780 nm; the output layer integrates an adaptive weighting mechanism, and the weight calculation formula is:

[0026]

[0027] Among them C i is the concentration of the i-th heavy metal.

[0028] Furthermore, in order to evaluate the performance of the model, a variety of regression evaluation indicators were used, including root mean square error (RMSE), coefficient of determination (R 2 ) and mean absolute error (MAE), which are used to measure the prediction accuracy and error size of the model on the test set. In addition, the prediction effect of the model is further verified by drawing a scatter plot of the true concentration and the predicted concentration. The root mean square error (RMSE), the coefficient of determination (R 2 ) and the mean absolute error (MAE) are given by:

[0029] (5)

[0030] Among them, R 2 is the coefficient of determination, is the summation symbol, which means the sum of samples 1 to N, where N is the total number of samples. represents the true value of the independent variable of the i-th sample, is the sample mean of the independent variable x, represents the true value of the dependent variable of the i-th sample, is the sample mean of the independent variable y.

[0031] (6)

[0032] Where RMSE is the root mean square error, n is the number of samples, represents the true value of the dependent variable of the i-th sample, represents the model prediction value of the i-th sample, is the summation symbol, which means the summation of samples 1 to n.

[0033] (7)

[0034] Among them, MAE is the mean absolute error, n is the number of samples, represents the true value of the dependent variable of the i-th sample, Represents the model prediction value of the i-th sample. is the absolute value of the residual of the i-th sample, is the summation symbol.

[0035] Furthermore, the training strategy data of the deep learning model is divided into a training set and a test set at an 8:2 ratio. The training subset is further divided into a validation set at a 9:1 ratio to dynamically adjust the hyperparameters. The Adam optimizer is used, and the mean absolute error MAE (Formula 7) is used as the loss function.

[0036] Furthermore, the multi-component heavy metal solution rapid synchronous detection platform can directly predict the concentration of metals contained in the sample end-to-end by directly inputting the absorbance of the metal mixed solution.

[0037] A multi-component heavy metal spectroscopy deep learning detection system, comprising:

[0038] Combinatorial chemical probe configuration module: used to screen colorimetric reagent combinations and trigger multi-component heavy metal-specific colorimetric reactions;

[0039] UV-Vis spectrum acquisition module: equipped with a high-throughput UV-Vis scanning system to achieve rapid acquisition of wide-band superposition spectra;

[0040] Data processing module: performs data enhancement, standardization and natural logarithm transformation operations;

[0041] Deep learning model module: Analyzes the global features of the spectrum based on the Transformer architecture and outputs concentration prediction results;

[0042] Integrated detection platform: The model is embedded in a portable UV-Vis spectrometer to provide a visual operation interface and real-time detection reports.

[0043] Furthermore, the integrated detection platform supports one-click operation, and the interface modules include a spectral data import module, a model prediction trigger module, a 3D spectral visualization module, and a concentration result export module.

[0044] Furthermore, the training strategy of the deep learning model module is: Adam optimizer is used, and the learning rate is set to 1×10 -4 , using mean absolute error (MAE) as the loss function, and improving generalization performance through dynamic learning rate decay and Dropout regularization.

[0045] The present invention has the following beneficial effects:

[0046] 1. Breakthrough in multi-dimensional detection capabilities

[0047] Specific color enhancement: Based on a ternary probe combination of thioamide, azo, and porphyrin compounds, the reaction conditions are optimized through orthogonal experiments to significantly improve the sensitivity and selectivity of multi-component heavy metal color development reactions and solve the cross-interference problem of traditional single probes.

[0048] Anti-interference from complex matrices: Combining masking agent technology with the synergistic effect of combined probes, high-precision detection is achieved in complex environmental samples (such as wastewater containing organic matter), with errors much lower than traditional spectrophotometry.

[0049] 2. Innovation in UV-VIS spectral analysis

[0050] Data dimension expansion: Through noise injection, spectral mixing and dynamic normalization strategies, we can break through the limitations of small samples, enhance the model's robustness to instrument fluctuations and noise, and cover the entire concentration gradient scenario.

[0051] Efficient use of wide bands: High-resolution scanning over a wide wavelength range (UV-visible light) fully captures multi-component spectral features and improves information utilization.

[0052] 3. Deep Learning Global Modeling

[0053] End-to-end accurate prediction: Based on the self-attention mechanism of the Transformer architecture, it analyzes the global dependencies of spectral sequences and achieves high-precision modeling of complex nonlinear signals. The prediction accuracy is significantly better than traditional chemometric methods.

[0054] Adaptive concentration adaptation: Through dynamic loss weight design, the detection performance of high and low concentration areas is simultaneously optimized to ensure the consistency of prediction across the entire range.

[0055] 4. Commercial application value highlights

[0056] Low-cost and portability: Integrating a miniature spectrometer with a lightweight model, the equipment cost is only 30% of that of large instruments, and the detection efficiency is improved to the minute level, adapting to the needs of rapid on-site detection.

[0057] Full-process automation: The one-click operation platform realizes the closed loop of the entire process of "spectral acquisition-concentration prediction-report generation", promoting the intelligentization and universalization of environmental monitoring technology.

[0058] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 This is a flow chart of the deep learning detection method for multi-component heavy metal spectra;

[0060] Figure 2 This is a diagram of the deep learning model architecture;

[0061] Figure 3 Screening graphs for combinatorial chemical probes;

[0062] Figure 4 This is a schematic diagram of the integrated detection platform operation interface;

[0063] Figure 5 The scatter plots of predicted and true values ​​for five metals are shown below;

[0064] Figure 6 This is a table of five metal evaluation indicators;

[0065] Figure 7 Schematic diagram of the integrated detection platform operation interface. DETAILED DESCRIPTION

[0066] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0067] Example

[0068] See also Figure 1-7This invention provides a technical solution: a multi-component heavy metal spectroscopy deep learning detection method. Using a five-component mixed heavy metal sample (antimony, iron, nickel, cadmium, and copper) as the detection target, this method, using a Transformer model and following the method of the invention, successfully achieves rapid and simultaneous prediction of multi-component heavy metal concentrations. By combining chemical probe color development, superimposed spectral acquisition, data enhancement, and deep learning modeling, this method significantly reduces detection cost and time while maintaining high accuracy, demonstrating the practicality and scalability of the technology. The method includes the following steps:

[0069] The configuration of combinatorial chemical probes for multi-component heavy metal dispersions was carried out by screening the colorimetric reagent ratios and reaction conditions through orthogonal experiments. This triggered specific color development reactions of the multi-component heavy metals and generated differentiated UV-Vis superposition spectra. First, antimony (Sb), iron (Fe), nickel (Ni), cadmium (Cd), and copper (Cu) were selected as target analytes, and multiple combinatorial chemical probes were screened based on their chemical properties. Subsequently, the configured combinatorial chemical probes were mixed with a single metal solution to observe their color development effects. By comparing and analyzing the color difference values ​​corresponding to each combinatorial chemical probe, the combinatorial chemical probe 1 with the best color difference performance was selected.

[0070] High-throughput acquisition of UV-Vis superposition spectra of multi-component heavy metal dispersions. Data enhancement was performed using Gaussian noise and spectral mixing techniques. Sb, Fe, Ni, Cd, and Cu metals were randomly mixed in volume to achieve different concentration gradients, and the mixed solution was stored in a test tube. The metal mixed solution in the test tube was then transferred to a multi-well plate, and the pre-screened combination chemical probe 1 was added. The last well was set as the control group (pure water + combination chemical probe 1). The sample was then optically characterized using a UV-Vis spectrometer. A wide-band detection range of 230-780 nm was set (covering the UV-visible characteristic absorption region), and high-resolution spectra were collected at 2 nm intervals. During the scanning process, the absorbance data of 276 wavelength nodes were calculated for each sample well using formula (8), and a two-dimensional absorbance matrix (number of samples × number of wavelengths) was constructed. The final absorbance data set A was formed. The formula for absorbance data set A is as follows:

[0071] (8)

[0072] Where A(λ) is the absorbance at wavelength λ, is the molar absorption coefficient of the i-th heavy metal, c i is the concentration and l is the optical path length.

[0073] Data standardization and data set preparation: Based on the physical and chemical mechanism, the original spectral data is subjected to Gaussian noise addition, spectral mixing and standardization to generate an extended training data set. The original absorbance data and concentration data are first enhanced by adding Gaussian noise (Formula 9) and combining spectral mixing technology (Formula 10). Then, the absorbance data is standardized using Formula (11), and then the natural logarithm transformation (Formula 12) is used to improve the skewed distribution of the data. Finally, the absorbance data set Az and the concentration data set Cz ( Figure 4 B), the Gaussian noise formula (Formula 9), the spectral mixing technology formula (Formula 10), the absorbance data normalization formula (11) and the natural logarithm transformation formula (Formula 12) are as follows:

[0074] (9)

[0075] (10)

[0076] (11)

[0077] (12)

[0078] Among them, A noisy A is the data after adding noise, orig is the original spectral data, N is Gaussian noise with mean b and standard deviation a, A1 and A2 are two randomly selected spectral samples, α is the mixing ratio, X scaled is the standardized data, X is the original input data (feature or label), μ is the mean absorbance, σ is the standard deviation, y is the original concentration value, y log are the values ​​after logarithmic transformation.

[0079] A deep learning model for multi-component heavy metal dispersions was developed. Using a deep learning model, the model employs an end-to-end design and employs a Transformer model. The model inputs a standardized absorbance sequence and embeds sine-cosine position encoding, automating the entire process from raw spectral data input to multi-component concentration output. The Transformer model was trained on the absorbance dataset Az and the concentration dataset Cz. The model input is a standardized absorbance sequence corresponding to 275 consecutive absorbance measurements in the wavelength range of 230-780 nm. The output is the predicted concentration values ​​(mg / L) for five heavy metals: Sb, Fe, Ni, Cd, and Cu. The model architecture explicitly embeds wavelength order information through a sine-cosine position encoding layer (Formulas 6-7), overcoming the traditional Transformer's lack of sensitivity to sequence position. The core processing module comprises a three-stage cascaded encoder, each integrating a four-head self-attention mechanism (head dimension 64). Scaled dot-product attention (Equation 8) is used to establish global correlation across wavelengths. A 256-dimensional feedforward network (with ReLU activation) performs nonlinear feature mapping, and residual connections and layer normalization (LayerNorm) ensure stable gradient propagation. The feature decoding stage uses global average pooling to compress the sequence dimension. After the fully connected layer outputs a logarithmic-transformed concentration vector, the true concentration value is restored using an inverse exponential transform (Equation 9).

[0080] In terms of training strategy, stratified random sampling was used to divide the original data set into training set, validation set and test set at a ratio of 8:1:1. The Adam optimizer (learning rate 1×10 -4 ), using the mean absolute error (MAE, Formula 10) as the loss function, and improving generalization ability through three mechanisms: dynamic learning rate decay, early stopping mechanism and Dropout regularization (ratio 0.1). The training batch is set to 16, and the maximum iteration round is limited to 200 rounds.

[0081] Finally, the trained Transformer model can directly predict the concentration of each metal in the solution based on the absorbance of the metal mixture solution.

[0082] Model performance evaluation uses a variety of regression evaluation indicators, including root mean square error (RMSE), determination coefficient (R 2 ) and mean absolute error (MAE). For each metal concentration prediction task, R2, MAE and RMSE were used to evaluate the model prediction performance. Figure 5The Transformer model's prediction results for the absorbance dataset Az and the concentration dataset Cz are presented. As can be seen, the linear fit between the predicted values ​​and the true values ​​for each metal in the test set is excellent. Table 2 shows the model's average R², MAE, and RMSE on the test set were 0.919, 0.058, and 0.146, respectively. These results demonstrate that the model achieves high prediction accuracy across all designed concentration gradients.

[0083] Furthermore, the colorimetric reagents of the combinatorial chemical probe are selected from at least two of thioamide, azo or porphyrin compounds, and the reaction conditions are optimized by orthogonal experiments, including a pH range of 6.0-8.5, a reaction temperature of 20-40°C and a reaction time of 5-30 minutes. A variety of heavy metal ions are selected as target analytes, and a plurality of colorimetric reagents are screened according to their chemical properties. These colorimetric reagents have different specificities and reaction characteristics and can form color reactions with different heavy metal ions. Next, these colorimetric reagents are randomly combined into multiple combinatorial chemical probes to improve their response ability to multi-component heavy metals. Subsequently, the configured combinatorial chemical probes are mixed with a single heavy metal solution in a multi-well plate to observe the colorimetric reaction effect. The colorimetric reagent ratio is screened by L9(3^4) orthogonal experiments, the colorimetric reagent concentration gradient is 0.1-1.0 mM, and the buffer is 0.05-0.2 M phosphate buffer; spectral shift (±5 The researchers used a combination of wavelength shift (nm wavelength shift) and concentration interpolation techniques to match the noise level to the instrument signal-to-noise ratio (SNR ≥ 30 dB). Model training employed a Box-Cox transformation (λ = 0.3-0.7) to optimize the concentration data distribution. During this process, the sensitivity, selectivity, and stability of the colorimetric reaction were evaluated by comparing the reactivity of different probe-metal combinations. Ultimately, the metal and colorimetric reagent combination with the best colorimetric performance was selected to ensure optimal colorimetric signal and minimize interference in multi-metal samples.

[0084] Furthermore, the Gaussian noise parameters used in data augmentation were set to mean b=0, standard deviation a=0.01-0.1, and the spectral mixing ratio α was uniformly distributed between 0.2 and 0.8. To improve model training and generalization, the raw data underwent systematic augmentation and preprocessing. To overcome the limitations of small sample sizes, a data augmentation strategy based on physical and chemical mechanisms was designed, generating diverse samples by adding Gaussian noise and combining spectral mixing techniques. The absorbance data was then normalized (Z-score) to eliminate dimensional differences. To address the skewed distribution of heavy metal concentration data, a natural logarithmic transformation was used to compress the numerical span of high-concentration samples, enhancing the model's ability to resolve low-concentration regions.

[0085] Furthermore, the Transformer model includes a three-level cascade encoder, each encoder is configured with a four-head self-attention mechanism, the attention head dimension is 64, the feedforward network dimension is 256, and the ReLU activation function and layer normalization operation are used. The model directly receives the standardized absorbance sequence, and outputs the concentration values ​​of various heavy metals through self-learning feature extraction and analysis. To solve the problem that deep learning models are insensitive to sequence position, the position encoding layer uses the sine-cosine function to embed wavelength sequence information. The formula is as follows:

[0086] (1)

[0087] (2)

[0088] Where pos is the wavelength position index, i is the encoding dimension (0~31, a total of 64 dimensions);

[0089] The model stacks multiple encoder layers, each with a multi-head self-attention mechanism. This mechanism uses scaled dot-product attention (Formula 3) to resolve global dependencies between wavelengths. A feedforward network further nonlinearly maps features, supplemented by residual connections and layer normalization (LayerNorm) to stabilize the training process. After a global average pooling layer compresses the sequence dimensions, a fully connected layer outputs a multidimensional logarithmically transformed concentration vector. Ultimately, the true concentration value is restored through an inverse exponential transformation (Formula 4). The attention (Formula 3) and exponential transformation (Formula 4) are as follows:

[0090] (3)

[0091] Among them, Q, K, V are query matrix, key matrix and value matrix respectively, d k is the key matrix dimension, Attention(Q,K,V) is the result of self-attention calculation, and T represents the matrix transpose operation.

[0092] (4)

[0093] Among them, y log is the standardized value, y pred is the value after inverse transformation.

[0094] Furthermore, in order to evaluate the performance of the model, a variety of regression evaluation indicators were used, including root mean square error (RMSE), coefficient of determination (R 2 ) and mean absolute error (MAE). These indicators are used to measure the prediction accuracy and error size of the model on the test set. In addition, the prediction effect of the model is further verified by drawing a scatter plot of the actual concentration and the predicted concentration. The root mean square error (RMSE), the coefficient of determination (R 2 ) and the mean absolute error (MAE) are given by:

[0095] (5)

[0096] Among them, R 2 is the coefficient of determination, is the summation symbol, which means the sum of samples 1 to N, where N is the total number of samples. represents the true value of the independent variable of the i-th sample, is the sample mean of the independent variable x, represents the true value of the dependent variable of the i-th sample, is the sample mean of the independent variable y.

[0097] (6)

[0098] Where RMSE is the root mean square error, n is the number of samples, represents the true value of the dependent variable of the i-th sample, represents the model prediction value of the i-th sample, is the summation symbol, which means the summation of samples 1 to n.

[0099] (7)

[0100] Among them, MAE is the mean absolute error, n is the number of samples, represents the true value of the dependent variable of the i-th sample, represents the model prediction value of the i-th sample, is the absolute value of the residual of the i-th sample, is the summation symbol.

[0101] Furthermore, the training strategy data of the deep learning model is divided into a training set and a test set at an 8:2 ratio. The training subset is further divided into a validation set at a 9:1 ratio to dynamically adjust the hyperparameters. The Adam optimizer is used, and the mean absolute error MAE (Formula 7) is used as the loss function.

[0102] Furthermore, the multi-component heavy metal solution rapid synchronous detection platform can directly predict the concentration of metals contained in the sample end-to-end by directly inputting the absorbance of the metal mixed solution.

[0103] A multi-component heavy metal spectroscopy deep learning detection system, comprising:

[0104] Combinatorial chemical probe configuration module: used to screen colorimetric reagent combinations and trigger multi-component heavy metal-specific colorimetric reactions.

[0105] UV-Vis spectrum acquisition module: equipped with a high-throughput UV-Vis scanning system to achieve rapid batch acquisition of wide-band superposition spectra.

[0106] Data processing module: performs data enhancement, standardization and natural logarithm transformation operations.

[0107] Deep learning model module: Analyzes the global features of the spectrum based on the Transformer architecture and outputs concentration prediction results.

[0108] Integrated detection platform: The model is embedded in a portable UV-Vis device, providing a visual operation interface and real-time detection reports.

[0109] Furthermore, the integrated detection platform supports one-click operation, and the interface modules include a spectral data import module, a model prediction trigger module, a 3D spectral visualization module, and a concentration result export module.

[0110] Furthermore, the training strategy of the deep learning model module is: Adam optimizer is used, and the learning rate is set to 1×10 -4 , using mean absolute error (MAE) as the loss function, and improving generalization performance through dynamic learning rate decay and Dropout regularization.

[0111] 1. Ultraviolet-Visible (UV-Vis): This spectrum covers the ultraviolet (UV) and visible (Vis) regions of the electromagnetic spectrum. In spectral analysis, many substances have specific absorption or reflection characteristics for different wavelengths of UV-Vis light. By measuring these characteristics, relevant information such as concentration and composition can be obtained. In this paper, UV-Vis superposition spectroscopy is used to detect heavy metal liquid dispersions.

[0112] 2. Transformer model: A deep learning model based on the self-attention mechanism, initially applied to natural language processing, has recently gained widespread application in other fields. It effectively processes sequence data and captures long-range dependencies between elements in a sequence. In this paper, it is used to analyze and predict the UV-Vis superposition spectra of multicomponent heavy metal liquid dispersions.

[0113] 3. High-throughput colorimetric reaction experiments: This method allows for simultaneous colorimetric reactions on a large number of samples. By using specialized experimental equipment, multiple samples can be processed and tested in a short period of time, greatly improving experimental efficiency. In this paper, it was used to achieve batch acquisition of mixed heavy metal UV-Vis superposition spectra.

[0114] 4. Data augmentation: In machine learning and deep learning, new training data is generated through a series of data transformation and augmentation techniques (such as adding noise, rotation, and scaling) to increase the diversity and quantity of training data. This helps improve the generalization and robustness of the model and prevents overfitting. In this paper, data augmentation techniques are used to meet the large-scale training data requirements of deep learning models.

[0115] Molar absorptivity: In spectral analysis, this is a physical quantity that characterizes a substance's ability to absorb light of a specific wavelength. It, along with other factors such as the substance's concentration and optical path length, determines absorbance. Its value reflects the substance's efficiency in absorbing light. The molar absorptivity is a key parameter when calculating the relationship between absorbance and concentration.

[0116] Abandoning the traditional simple and low-dimensional single spectrum analysis steps, the multi-component superposition spectrum is directly analyzed, the detection time is shortened to minutes, and the synchronous prediction accuracy is improved by more than 30%, meeting the needs of rapid and high-precision detection of complex environmental samples.

[0117] Through physical and chemical driven data enhancement technology, the diversity and coverage of model training data are significantly expanded, the robustness to instrument fluctuations and noise interference is improved, and stable predictions are achieved in full concentration gradient scenarios.

[0118] The integrated lightweight end-to-end system is compatible with low-cost portable devices, lowers the detection threshold, provides a one-click operation platform for non-professionals, and promotes the upgrading of environmental monitoring technology to intelligence and portability.

[0119] It provides real-time and reliable technical support for various heavy metal monitoring and detection scenarios, assists in pollution prevention and control, protects public health, and promotes green and sustainable development.

[0120] The preferred embodiments of the present invention disclosed above are intended only to help illustrate the present invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the present invention to the specific embodiments described. Obviously, many modifications and variations are possible based on the content of this specification. These embodiments are selected and described in detail in this specification to better explain the principles and practical applications of the present invention, thereby enabling those skilled in the art to better understand and utilize the present invention. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A multi-component heavy metal spectroscopy deep learning detection method, characterized in that: The following steps are involved: The multi-component heavy metal dispersion system is configured with combinatorial chemical probes. Through orthogonal experiments, the colorimetric ratio and reaction conditions are screened to trigger the specific colorimetric reaction of the multi-component heavy metals and generate differentiated UV-Vis superposition spectra. High-throughput acquisition of UV-Vis superposition spectra of multi-component heavy metal dispersions, with data enhancement through Gaussian noise and spectral mixing techniques; Data standardization and dataset preparation: Gaussian noise addition, spectral mixing, and standardization are performed on the original spectral data based on physical and chemical mechanisms to generate an extended training dataset; The deep learning model for multi-component heavy metal dispersions was developed. Through the deep learning model, an end-to-end design was adopted, using the Transformer model, inputting a standardized absorbance sequence, and embedding sine-cosine position encoding to achieve full-process automated analysis from raw spectral data input to multi-component concentration output; the model performance was evaluated using a variety of regression evaluation indicators, including root mean square error (RMSE), coefficient of determination (R 2 ) and mean absolute error (MAE); the colorimetric reagents of the combinatorial chemical probe are selected from at least two of thioamide, azo or porphyrin compounds, and the reaction conditions are optimized by orthogonal experiments, including a pH range of 6.0-8.5, a reaction temperature of 20-40°C and a reaction time of 5-30 minutes. A variety of heavy metal ions are selected as target analytes, and a plurality of colorimetric reagents are screened according to their chemical properties. These colorimetric reagents have different specificities and reaction characteristics and can form color reactions with different heavy metal ions. Next, these colorimetric reagents are randomly combined into multiple A combinatorial chemical probe is designed to improve its response ability to multi-component heavy metals. Subsequently, the configured combinatorial chemical probe is mixed with a single heavy metal solution in a multi-well plate to observe its color reaction effect. The color developer of the combinatorial chemical probe is a ternary combination of thioamide, azo and porphyrin compounds with a mass ratio ranging from 1:1:1 to 1:2:

3. The color reaction conditions are optimized by L9 (3^4) orthogonal experiment, specifically including: pH 6.5-8.0, reaction temperature 25-35℃, reaction time 10-20 minutes, color sensitivity ≤0.01 mg / L, suitable for the specific detection of five heavy metals: antimony, cadmium, copper, nickel and iron. In this process, the sensitivity, selectivity and stability of the color reaction are evaluated by comparing the reaction effects of different combinatorial probes with metals. Finally, the metal and color developer combination with the best color development effect is selected to ensure that the best color development signal and the lowest interference can be obtained in multi-metal samples.

2. The multi-component heavy metal spectroscopy deep learning detection method according to claim 1, characterized in that: The Gaussian noise parameters in the data enhancement can be quantitatively set according to the spectral characteristics, and the spectral mixing ratio α obeys a uniform distribution. In order to improve the model training effect and generalization ability, the original data undergoes systematic enhancement and preprocessing operations. To overcome the limitation of small samples, a data enhancement strategy based on physical and chemical mechanisms is designed. By adding Gaussian noise and combining spectral mixing technology to generate diverse samples, the absorbance data is then standardized to eliminate dimensional differences. In view of the skewed distribution characteristics of heavy metal concentration data, a natural logarithmic transformation is used to compress the numerical span of high-concentration samples and enhance the model's ability to resolve low-concentration areas. The standard deviation of the Gaussian noise ranges from 0.05 to 0.08, and the spectral mixing ratio α obeys a Beta distribution (α=2, β=5). The number of enhanced samples generated is 5-10 times that of the original data. Data normalization adopts a dynamic Z-score algorithm, and the local mean and standard deviation are calculated based on a sliding window with a window width of 10%-20% of the total number of wavelengths.

3. The multi-component heavy metal spectroscopy deep learning detection method according to claim 1, characterized in that: The Transformer model includes three levels of cascaded encoders. Each level of encoder is equipped with a multi-head self-attention mechanism and uses the ReLU activation function and layer normalization operation. The model directly receives the standardized absorbance sequence and outputs the concentration values ​​of various heavy metals through self-learning feature extraction and analysis. To solve the problem that deep learning models are insensitive to sequence position, the position encoding layer uses the sine-cosine function to embed wavelength sequence information. The formula is as follows: (1) (2) Where pos is the wavelength position index and i is the encoding dimension (0~31, a total of 64 dimensions); the model stacks multiple layers of encoders, each layer contains a multi-head self-attention mechanism, and the global dependency between wavelengths is analyzed by scaling the dot product attention (Formula 3). The feedforward network further nonlinearly maps the features, supplemented by residual connections and layer normalization to stabilize the training process. After the global average pooling layer compresses the sequence dimension, the fully connected layer outputs a multi-dimensional logarithmic transformation concentration vector, and finally restores the true concentration value through the exponential inverse transformation (Formula 4). The attention (Formula 3) and exponential change (Formula 4) are as follows: Attention(Q,K,V)=softmax( )V (3) Where Q, K, V are query matrix, key matrix and value matrix respectively, d k is the key matrix dimension, Attention(Q,K,V) is the result of self-attention calculation, and T represents the matrix transpose operation; (4) Where y log is the standardized value, y pred is the value after inverse transformation; the Transformer model contains a 4-level encoder, each level is equipped with a 6-head self-attention mechanism, the head dimension is 128, the feedforward network dimension is 512, the activation function is GeLU, the position encoding dimension d=256, and covers the full wavelength sequence of 230-780 nm; the output layer integrates an adaptive weighting mechanism, and the weight calculation formula is: Among them C i is the concentration of the i-th heavy metal.

4. The multi-component heavy metal spectroscopy deep learning detection method according to claim 1, characterized in that: The model performance evaluation adopts a variety of regression evaluation indicators, including root mean square error (RMSE), determination coefficient (R 2 ) and mean absolute error (MAE), which are used to measure the prediction accuracy and error size of the model on the test set. In addition, the prediction effect of the model is further verified by drawing a scatter plot of the true concentration and the predicted concentration. The root mean square error (RMSE), the coefficient of determination (R 2 ) and the mean absolute error (MAE) are given by: (5) Among them, R 2 is the coefficient of determination, is the summation symbol, which means the sum of samples 1 to N, where N is the total number of samples. represents the true value of the independent variable of the i-th sample, is the sample mean of the independent variable x, represents the true value of the dependent variable of the i-th sample, is the sample mean of the independent variable y; (6) Where RMSE is the root mean square error, n is the number of samples, represents the true value of the dependent variable of the i-th sample, represents the model prediction value of the i-th sample, is the summation symbol, which means the summation of samples 1 to n; (7) Where MAE is the mean absolute error, n is the number of samples, represents the true value of the dependent variable of the i-th sample, Represents the model prediction value of the i-th sample; is the absolute value of the residual of the i-th sample, is the summation symbol.

5. The multi-component heavy metal spectroscopy deep learning detection method according to claim 1, characterized in that: The training strategy data of the deep learning model is divided into a training set and a test set at an 8:2 ratio. The training subset is further divided into a validation set at a 9:1 ratio to dynamically adjust hyperparameters. The Adam optimizer is used, and the mean absolute error (MAE) (Formula 7) is used as the loss function.

6. The multi-component heavy metal spectroscopy deep learning detection method according to claim 1, characterized in that: It also includes the development of a rapid synchronous detection platform for multi-component heavy metal solutions, which can directly predict the concentration of metals contained in the sample end-to-end by directly inputting the absorbance of the metal mixed solution.

7. A multi-component heavy metal spectrum deep learning detection system, characterized in that: include: Combinatorial chemical probe configuration module: used to screen colorant combinations and trigger multi-component heavy metal-specific color development reactions; UV-Vis spectrum acquisition module: configured with a high-throughput UV-Vis scanning system to achieve rapid acquisition of wide-band superposition spectra; data processing module: performs data enhancement, standardization and natural logarithmic transformation operations; deep learning model module: analyzes the global characteristics of the spectrum based on the Transformer architecture and outputs concentration prediction results; integrated detection platform: embeds the model into a portable UV-Vis device to provide a visual operation interface and real-time detection reports; the integrated detection platform includes a micro spectrometer, an embedded GPU module and a touch operation interface; the software module includes a real-time spectral calibration algorithm, a model lightweight compression technology and an outlier detection module.

8. The multi-component heavy metal spectroscopy deep learning detection system according to claim 7, characterized in that: The integrated detection platform supports one-click operation, and the interface modules include a spectral data import module, a model prediction trigger module, a 3D spectral visualization module, and a concentration result export module.

9. The multi-component heavy metal spectroscopy deep learning detection system according to claim 7, characterized in that: The training strategy of the deep learning model module is: Adam optimizer is used, and the learning rate is set to 1×10 -4 , using mean absolute error (MAE) as the loss function, and improving generalization performance through dynamic learning rate decay and Dropout regularization.

Citation Information

Patent Citations

  • Sketch face recognition method and device

    CN117095433A

  • Multi-element antibiotic rapid detection method based on high-throughput array spectrum and deep learning

    CN119780411A