Multi-component heavy metal spectrum deep learning detection method and system

By combining chemical probes and superimposed spectroscopy technology combined with deep learning models, traditional heavy metal detection methods are solved in terms of high equipment costs, complex detection processes, long cycles and inability to meet the multi-component synchronous detection requirements, and achieve fast, high-precision and low-cost multi-component heavy metal detection.

CN119935920AActive Publication Date: 2025-05-06NORTHWEST UNIV

Patent Information

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

AI Technical Summary

Technical Problem

Traditional heavy metal detection methods have problems such as high equipment cost, complex testing process, long cycle, low sensitivity and inability to meet the needs of multi-component synchronous testing.

Method used

Using combined chemical probes and superimposed spectroscopy technology, combined with deep learning models, differentiated characterization of multi-component color-producing signals and global modeling of complex nonlinear spectral signals, an end-to-end deep learning detection system is built.

Benefits of technology

Fast and multi-component synchronous detection is realized, the detection accuracy and efficiency are improved, the equipment cost is reduced, and the bottlenecks of traditional methods in detection efficiency, multi-component analysis, equipment cost and data dependence are solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119935920A_ABST
    Figure CN119935920A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-component heavy metal spectrum deep learning detection method and system, and belongs to the technical field of analytical chemistry and instrument analysis. According to the method, the UV-Vis spectral difference of multi-component heavy metals is enhanced through a combined chemical probe color development technology, complex nonlinear spectral signals are analyzed in combination with a deep learning model, and the generalization ability of the model is improved through a data enhancement strategy. The system is integrated with a lightweight end-to-end detection platform, is adaptive to low-cost portable equipment, and realizes minute-level multi-component synchronous detection. According to the method, a closed-loop technical path is formed through three core technologies (probe combination, spectrum enhancement and deep learning), the technical bottleneck of a traditional method in a multi-component, small-sample and complex scene is broken through, and an efficient, accurate and low-cost complete solution is provided for heavy metal pollution prevention and control; the method solves the problems of expensive equipment, low detection efficiency and insufficient multi-component analysis capability of a traditional method, and is suitable for scenes of environmental monitoring, sewage treatment and the like.
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 and system. 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 exist in the environment for a long time, and are enriched through the food chain, causing serious harm to human health and the ecosystem. Cases such as mercury poisoning causing neurological diseases and cadmium pollution causing kidney damage are common. Accurate detection of heavy metal content 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 complicated, involving tedious sample pretreatment and instrument operation, and the detection cycle is long, making it difficult to achieve real-time rapid detection, and usually only single heavy metals can be detected, which cannot meet the needs of simultaneous detection of multiple components of heavy metals in the actual environment.

[0003] At present, although traditional heavy metal detection methods can provide high-precision detection results, they rely on expensive and complex instruments and equipment, and the detection process is cumbersome and the cycle is long. These methods show obvious limitations in the simultaneous detection of multi-component heavy metals, especially in complex environmental samples, facing problems such as insufficient sensitivity, serious cross-interference, and limited spectral resolution capabilities. As a result, the detection accuracy is low and the scope of application is limited, making it difficult to meet the needs of real-time, fast, efficient, and low-cost simultaneous detection of multiple components.

[0004] Specific defects and solutions of the existing technology: (1) Insufficient optimization of heavy metal combinatorial 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 combinatorial chemical probes to trigger heavy metal-specific complexation and color development, thereby 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 combinatorial 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 purpose of the present invention is to provide a multi-component heavy metal spectrum deep learning detection method. At the level of analytical detection methods, the present invention aims to achieve differentiated characterization of multi-component color development signals by combining chemical probes with superposition spectral technology, and solve the problems of serious cross-interference and low sensitivity of traditional probes. At the model level, based on the global modeling capability of the deep learning model, the local feature limitations of traditional spectral analysis are broken through, an end-to-end deep learning model is constructed, and complex nonlinear spectral signals are accurately analyzed. At the application level, a lightweight system is integrated to achieve rapid and multi-component synchronous detection, and the efficiency of on-site detection is improved through automated operation, providing an intelligent and scalable solution for environmental monitoring. The present invention deeply integrates chemical mechanisms with deep learning through a closed-loop technical path of "combined chemical probe color development-data enhancement-global modeling-lightweight system integration", which not only suppresses cross-interference, but also improves the spectral characterization dimension, and finally forms a fast, high-precision, low-cost multi-component heavy metal detection system. The core goal of the present invention is to solve the bottlenecks of traditional methods in detection efficiency, multi-component analysis, equipment cost and data dependence, promote the upgrading of environmental monitoring technology to intelligence and portability, and provide real-time and reliable technical support for scenes such as sewage treatment and river monitoring.

[0006] The present invention is achieved through the following technical solutions: The present invention is a multi-component heavy metal spectrum deep learning detection method, comprising the following steps: The multi-component heavy metal dispersion system is configured with combinatorial chemical probes. The colorimetric ratio and reaction conditions are screened through orthogonal experiments to trigger the specific color development reaction of 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 data set 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 data set; Development of a deep learning model for multi-component heavy metal dispersions. Through a deep learning model, an end-to-end design is adopted, using a Transformer model, inputting a standardized absorbance sequence, and embedding sine-cosine position coding to achieve full-process automated analysis from raw spectral data input to multi-component concentration output; Model performance evaluation, using a variety of regression evaluation metrics, including root mean square error (RMSE), coefficient of determination (R²), and mean absolute error (MAE).

[0007] 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 metals contained in the sample can be directly predicted end-to-end.

[0008] 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 pH range of 6.0-8.5, reaction temperature of 20-40°C and 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 a plurality of combinatorial chemical probes to improve their responsiveness 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 color reaction effect. 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 combination of metal and colorimetric reagent 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.

[0009] Furthermore, the Gaussian noise parameters in 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 is systematically enhanced and preprocessed. In order to overcome the limitation of small samples, a data enhancement strategy based on physical and chemical mechanisms is designed to generate diverse samples by adding Gaussian noise and combining spectral mixing technology. Then the absorbance data is standardized to eliminate dimensional differences. In view of the skewed distribution characteristics of heavy metal concentration data, the natural logarithm transformation is used to compress the numerical span of high-concentration samples and enhance the model's ability to analyze low-concentration areas.

[0010] 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. In order to solve the problem that the deep learning model is insensitive to the sequence position, the position encoding layer uses the sine-cosine function to embed the wavelength sequence information formula as follows: (1) (2) Where pos is the wavelength position index and i is the encoding dimension; The model stacks multiple layers of encoders, each layer contains a multi-head self-attention mechanism, and resolves the global dependency between wavelengths by scaling dot product attention (Formula 3). The feedforward network further nonlinearly maps 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: (3) (4) Among them, Q is the query matrix (Query), K is the key matrix (Key), V is the value matrix (Value), d k is the dimension of the key (used for scaling gradient stability), y log is the standardized value, y pred is the value after inverse transformation; The Transformer model contains 4 levels of encoders, each level is equipped with a 6-head self-attention mechanism, the head dimension is 128, the feedforward network dimension is 512, and the activation function is GeLU; the position encoding dimension d=256, covering the full-band wavelength sequence of 230-780 nm; the output layer integrates an adaptive weighting mechanism, and the weight calculation formula is:

[0011] Among them C i is the concentration of the ith heavy metal.

[0012] Furthermore, in order to evaluate the performance of the model, we used a variety of regression evaluation indicators, including root mean square error (RMSE), determination coefficient (R²) and mean absolute error (MAE). Among them, RMSE reflects the average size of the prediction error by calculating the square root of the mean of the square deviation between the predicted value and the true value. The smaller the value, the lower the overall deviation. R² measures the model's ability to explain data variation and reflects the goodness of fit between the predicted value and the true value. It takes a value of 0-1, and the closer to 1, the better the fitting effect. MAE calculates the average value of the absolute deviation between the predicted value and the true value, directly measuring the average error amplitude. The smaller the value, the smaller the average deviation. The three comprehensively evaluate the model performance from the dimensions of error size, goodness of fit, average deviation, etc., and provide a quantitative basis for the effectiveness of the detection method. The prediction effect of the model is further verified by drawing a scatter plot of the true concentration and the predicted concentration. The formulas for root mean square error (RMSE), determination coefficient (R²) and mean absolute error (MAE) are as follows: (5) (6) (7) Among them, y i Represents the true concentration value of the i-th sample, The model predicts the concentration value, is the average value of the true concentration, and N is the total number of samples.

[0013] 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, and 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 with the mean absolute error (MAE, Formula 7) as the loss function.

[0014] 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.

[0015] A multi-component heavy metal spectrum deep learning detection system, used to implement the above method, includes: Combinatorial chemical probe configuration module: used to screen colorimetric reagent combinations and trigger multi-component heavy metal-specific colorimetric reactions; UV-Vis spectrum acquisition module: equipped 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 logarithm transformation operations; Deep learning model module: Analyzes the global features of the spectrum based on the Transformer architecture and outputs the concentration prediction results; Integrated detection platform: embed the model into a portable UV-Vis spectrometer to provide a visual operation interface and real-time detection reports.

[0016] 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.

[0017] Furthermore, the training strategy of the deep learning model module is: using the Adam optimizer (initial learning rate 1×10-4) and the MAE loss function, and jointly improving the convergence efficiency through the dynamic learning rate decay mechanism (the learning rate is decayed by a coefficient of 0.5 when the verification loss stagnates for 5 consecutive epochs) and the early stopping mechanism (training is terminated if there is no improvement in the verification index for 15 consecutive epochs), and fully iterating within 200 epochs with small batch gradient descent (batch_size=16), and ensuring the robustness of parameter selection through 10-fold cross validation. In terms of model regularization, multiple layers of Dropout layers (discard rate 0.1-0.3) are embedded in the network to suppress overfitting, batch normalization is performed on the input of each layer to coordinate the data distribution, and L2 regularization is introduced in the convolution layer to constrain the weight parameters.

[0018] The present invention has the following beneficial effects: 1. Breakthrough in multi-detection capability and enhanced specific color development: Based on the ternary probe combination of thioamide, azo and porphyrin compounds, the reaction conditions are optimized through orthogonal experiments, which significantly improves the sensitivity and selectivity of multi-component heavy metal color development reactions and solves the cross-interference problem of traditional single probes.

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

[0020] 2. UV-VIS spectral analysis innovates data dimension expansion: through noise injection, spectral mixing and dynamic normalization strategies, it breaks through the limitation of small samples, enhances the robustness of the model to instrument fluctuations and noise, and covers the full concentration gradient scenario.

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

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

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

[0024] 4. The commercial application value highlights low cost and portability: integrating a miniature spectrometer with a lightweight model, the equipment cost is only 30% of that of a large instrument, and the detection efficiency is increased to the minute level, which is suitable for on-site rapid detection needs.

[0025] 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 intelligence and universalization of environmental monitoring technology.

[0026] 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

[0027] Figure 1 This is a flow chart of the deep learning detection method for multi-component heavy metal spectra; Figure 2 This is a deep learning model architecture diagram; Figure 3 Screening graphs for combinatorial chemical probes; Figure 4 This is a schematic diagram of the integrated detection platform operation interface; Figure 5 The scatter plots of predicted values ​​and true values ​​for five metals are shown below; Figure 6 This is a table of five metal evaluation indicators; Figure 7 Schematic diagram of the integrated detection platform operation interface. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 creative work are within the scope of protection of the present invention.

[0029] Example See also Figure 1-7 The present invention provides a technical solution: a multi-component heavy metal spectral deep learning detection method, which takes five-component multi-component mixed heavy metals (antimony, iron, nickel, cadmium, copper) as the detection target, uses the Transformer model, and operates according to the method of the present invention to successfully achieve rapid and synchronous prediction of multi-component heavy metal concentrations. This method significantly reduces the detection cost and time while ensuring high accuracy through the synergistic effect of combined chemical probe color development, superposition spectrum acquisition, data enhancement and deep learning modeling, and verifies the practicality and scalability of the technology, including the following steps: The configuration of combinatorial chemical probes for multi-component heavy metal dispersions was carried out. The colorimetric agent ratio and reaction conditions were screened through orthogonal experiments to trigger the specific color development reaction of multi-component heavy metals and generate 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 according to their chemical properties. Subsequently, the configured combinatorial chemical probes were mixed with a single metal solution to observe the color development reaction effect. 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; High-throughput acquisition of UV-Vis superposition spectra of multi-component heavy metal dispersions, data enhancement by Gaussian noise and spectral mixing technology, random volume mixing configuration of Sb, Fe, Ni, Cd, and Cu metals to achieve different concentration gradients, and the mixed solution is stored in a test tube. The metal mixed solution in the test tube is then transferred to a multi-well plate, and the pre-screened combinatorial chemical probe 1 is added, and the last well is set as a control group (pure water + combinatorial chemical probe 1). The sample is then optically characterized using a UV-Vis spectrometer, and a wide band detection range of 230-780nm is set (covering the characteristic absorption region of ultraviolet-visible light), and high-resolution spectra are collected at 2nm intervals. During the scanning process, each sample well uses formula (8) to calculate the absorbance data of 276 wavelength nodes, and construct a two-dimensional absorbance matrix (number of samples × number of wavelengths). The final absorbance data set A is formed, and the formula of absorbance data set A is as follows; (8) Where A(λ) is the absorbance at wavelength λ, is the molar absorption coefficient of the ith heavy metal, c i is the concentration and l is the optical path length.

[0030] Data standardization and data set preparation, based on the physical mechanism of the molar absorptivity matrix, Gaussian noise injection, spectral mixing and standardization are performed on the original spectral data. Among them, the intensity parameter of Gaussian noise is set by dynamically matching the instrument system error and the variance distribution of the molar absorptivity calibration error at different wavelengths. The spectral mixing process strictly follows the principle of linear superposition of absorbance of multi-component solutions, and constrains the mixing ratio to make it conform to the statistical characteristics of the heavy metal ion concentration distribution in the actual solution, and forces the concentration conservation condition to be met, so as to generate an extended training data set.

[0031] Data enhancement strategies based on physical and chemical mechanisms include: Gaussian noise parameter setting: the noise standard deviation matches the instrument signal-to-noise ratio (SNR ≥ 30 dB), and the noise intensity is dynamically adjusted according to the experimentally calibrated molar absorptivity error distribution (variance σ = 0.05-0.08).

[0032] Spectral mixing ratio α: Beta distribution (α=2, β=5) is used to simulate the statistical distribution characteristics of heavy metal concentrations in actual solutions to ensure that the concentration is conserved after mixing.

[0033] Standardization processing: Dynamic Z-score algorithm is used to calculate the local mean and standard deviation based on a sliding window (window width is 10%-20% of the total number of wavelengths) to eliminate the influence of instrument baseline drift.

[0034] The original absorbance data and concentration data are first enhanced by adding Gaussian noise (Formula 9) and combining spectral mixing technology (Formula 10), and 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), Gaussian noise formula (Formula 9), spectral mixing technology formula (Formula 10), absorbance data standardization formula (11) and natural logarithmic transformation formula (Formula 12) are as follows: (9) (10) (11) (12) 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, and 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, and y log are the values ​​after logarithmic transformation.

[0035] The deep learning model of multi-component heavy metal dispersion system is developed. Through the deep learning model, end-to-end design is adopted, and the Transformer model is used to input the standardized absorbance sequence and embed the sine-cosine position encoding to realize the full process automation from the original spectral data input to the multi-component concentration output. Based on the absorbance data set Az and the concentration data set Cz, the Transformer model is trained. The model input is the standardized absorbance sequence, corresponding to 275 continuous absorbance measurement values ​​in the wavelength range of 230-780nm; the output is the concentration prediction value (mg / L) of five heavy metals Sb, Fe, Ni, Cd, and Cu. In the model architecture design, the wavelength order information is explicitly embedded through the sine-cosine position encoding layer (Formula 6-7) to overcome the defect of the traditional Transformer's lack of sensitivity to the sequence position. The core processing module includes a 3-level cascade encoder, each level of which integrates a 4-head self-attention mechanism (head dimension 64), uses scaled dot product attention (Formula 8) to establish global associations across wavelengths, and cooperates with a 256-dimensional feedforward network (ReLU activation) for nonlinear feature mapping, and ensures stable gradient propagation through residual connections and layer normalization (LayerNorm). In the feature decoding stage, global average pooling is used to compress the sequence dimension. After the fully connected layer outputs the logarithmic transformation concentration vector, the true concentration value is restored through the exponential inverse transformation (Formula 9).

[0036] 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 ), with mean absolute error (MAE, Formula 10) as the loss function, the generalization ability is improved 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.

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

[0038] To evaluate the model performance, a variety of regression evaluation indicators were used, including root mean square error (RMSE), coefficient of determination (R²), and mean absolute error (MAE). For each metal concentration prediction task, three indicators, R2, MAE, and RMSE, were used to evaluate the model prediction performance. Figure 5The prediction results of the Transformer model on the absorbance dataset Az and the concentration dataset Cz are shown. It can be seen that the linear fit between the predicted values ​​and the true values ​​of each metal in the test set is relatively good. The various evaluation indicators are shown in Table 2. The average R2, MAE, and RMSE of the model on the test set are 0.919, 0.058, and 0.146, respectively. These results show that the model can achieve high prediction accuracy in all designed concentration gradient spaces.

[0039] Furthermore, the colorimetric agent of the combinatorial chemical probe is 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 agents are screened according to their chemical properties. These colorimetric agents have different specificities and reaction characteristics and can form color development reactions with different heavy metal ions. Next, these colorimetric agents are randomly combined into a plurality of combinatorial chemical probes to improve their responsiveness 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 the color development effect. The colorimetric agent ratio is screened by L9 (3^4) orthogonal experiments. The colorimetric agent concentration gradient is 0.1-1.0 mM, and the buffer is 0.05-0.2 M phosphate buffer. Spectral shift (±5 The noise level was matched with the instrument signal-to-noise ratio (SNR ≥ 30 dB) by using the wavelength shift (nm) and concentration interpolation techniques. The model training used Box-Cox transformation (λ = 0.3-0.7) to optimize the concentration data distribution. In this process, the sensitivity, selectivity and stability of the color development reaction were evaluated by comparing the reaction effects of different combinations of probes and metals. Finally, the combination of metal and color developer with the best color development effect was selected to ensure the best color development signal and the lowest interference in multi-metal samples.

[0040] Furthermore, the Gaussian noise parameters in data enhancement are set to mean b=0, standard deviation a=0.01-0.1, and the spectral mixing ratio α follows a uniform distribution of 0.2-0.8. In order to improve the model training effect and generalization ability, the original data is systematically enhanced and preprocessed. In order to overcome the limitation of small samples, a data enhancement strategy based on physical and chemical mechanisms is designed to generate diverse samples by adding Gaussian noise and combining spectral mixing technology. Then the absorbance data is standardized (Z-score) to eliminate dimensional differences. In view of the skewed distribution characteristics of heavy metal concentration data, the natural logarithm transformation is used to compress the numerical span of high-concentration samples and enhance the model's ability to analyze low-concentration areas.

[0041] Furthermore, the Transformer model includes a 3-level cascade encoder, each level of the encoder is configured with a 4-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. In order to solve the problem that the deep learning model is insensitive to the sequence position, the position encoding layer uses the sine-cosine function to embed the wavelength sequence information formula as follows: (1) (2) Where pos is the wavelength position index, i is the encoding dimension (0~31, 64 dimensions in total); 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, and the residual connection and layer normalization (LayerNorm) are used 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: (3) (4) Among them, Q is the query matrix (Query), K is the key matrix (Key), V is the value matrix (Value), d k is the dimension of the key (used for scaling gradient stability), y log is the standardized value, y pred is the value after inverse transformation.

[0042] Furthermore, in order to evaluate the performance of the model, we used a variety of regression evaluation indicators, including root mean square error (RMSE), determination coefficient (R²) and mean absolute error (MAE). Among them, RMSE reflects the average size of the prediction error by calculating the square root of the mean of the square deviation between the predicted value and the true value. The smaller the value, the lower the overall deviation. R² measures the model's ability to explain data variation and reflects the goodness of fit between the predicted value and the true value. It takes a value of 0-1, and the closer to 1, the better the fitting effect. MAE calculates the average value of the absolute deviation between the predicted value and the true value, directly measuring the average error amplitude. The smaller the value, the smaller the average deviation. The three comprehensively evaluate the model performance from the dimensions of error size, goodness of fit, average deviation, etc., and provide a quantitative basis for the effectiveness of the detection method. The prediction effect of the model is further verified by drawing a scatter plot of the true concentration and the predicted concentration. The formulas for root mean square error (RMSE), determination coefficient (R²) and mean absolute error (MAE) are as follows: (5) (6) (7) Among them, y i Represents the true concentration value of the i-th sample, The model predicts the concentration value, is the average value of the true concentration, and N is the total number of samples.

[0043] 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, and 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 with the mean absolute error (MAE, Formula 7) as the loss function.

[0044] 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.

[0045] A multi-component heavy metal spectrum deep learning detection system, used to implement the above method, includes: Combinatorial chemical probe configuration module: used to screen colorimetric reagent combinations and trigger multi-component heavy metal-specific colorimetric reactions; UV-Vis spectrum acquisition module: equipped with a high-throughput UV-Vis scanning system to achieve rapid batch acquisition of wide-band superposition spectra; Data processing module: performs data enhancement, standardization and natural logarithm transformation operations; Deep learning model module: Analyzes the global features of the spectrum based on the Transformer architecture and outputs the concentration prediction results; Integrated detection platform: embed the model into the portable UV-Vis device to provide a visual operation interface and real-time detection report.

[0046] 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.

[0047] Furthermore, the training strategy of the deep learning model module is: using the Adam optimizer (initial learning rate 1×10 -4 ) and MAE loss function, and jointly improve the convergence efficiency through the dynamic learning rate decay mechanism (the learning rate is decayed by a coefficient of 0.5 when the verification loss stagnates for 5 consecutive epochs) and the early stopping mechanism (training is terminated if there is no improvement in the verification index for 15 consecutive epochs). The small batch gradient descent (batch_size=16) is fully iterated within 200 epochs, and the robustness of parameter selection is ensured by 10-fold cross validation. In terms of model regularization, multiple layers of Dropout layers (discard rate 0.1-0.3) are embedded in the network to suppress overfitting, batch normalization is performed on the input of each layer to coordinate the data distribution, and L2 regularization is introduced in the convolution layer to constrain the weight parameters.

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

[0049] 2. Transformer model: A deep learning model based on the self-attention mechanism, which was initially used in the field of natural language processing and has been widely used in other fields in recent years. It can effectively process sequence data and capture the long-distance dependencies between elements in the sequence. In this paper, it is used to analyze and predict the UV-Vis superposition spectra of multi-component heavy metal liquid dispersions.

[0050] 3. High-throughput colorimetric reaction experiment: An experimental method that can perform colorimetric reactions on a large number of samples at the same time. By using special experimental equipment, multiple samples can be processed and detected in a short time, greatly improving the experimental efficiency. In this paper, it is used to achieve batch acquisition of mixed heavy metal UV-Vis superposition spectra.

[0051] 4. Data enhancement: In machine learning and deep learning, new training data is generated through a series of data transformation and expansion techniques (such as adding noise, rotation, scaling, etc.) to increase the diversity and quantity of training data, which helps to improve the generalization ability and robustness of the model and prevent the model from overfitting. In the present invention, data enhancement technology is used to meet the needs of deep learning models for large-scale training data.

[0052] Molar absorptivity: In spectral analysis, it is a physical quantity that characterizes the ability of a substance to absorb light of a specific wavelength. It determines the magnitude of absorbance together with factors such as the concentration and optical path of the substance, and its value reflects the efficiency of the substance in absorbing light. When calculating the relationship between absorbance and concentration, the molar absorptivity is a key parameter.

[0053] 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.

[0054] 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 under full concentration gradient scenarios.

[0055] The integrated lightweight end-to-end system is compatible with low-cost portable devices, which 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.

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

[0057] The preferred embodiments of the present invention disclosed above are only used to help illustrate the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A multi-component heavy metal spectrum 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. The colorimetric ratio and reaction conditions are screened through orthogonal experiments to trigger the specific color development reaction of 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 data set 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 data set; The deep learning model for multi-component heavy metal dispersions was developed. Through the deep learning model, an end-to-end design was adopted, the Transformer model was used, the standardized absorbance sequence was input, and sine-cosine position encoding was embedded 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), determination coefficient (R²), and mean absolute error (MAE).

2. A multi-component heavy metal spectrum deep learning detection method according to claim 1, characterized in that: The colorimetric agent of the combinatorial chemical probe is 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 agents are screened according to their chemical properties. These colorimetric agents have different specificities and reaction characteristics and can form color development reactions with different heavy metal ions. Next, these colorimetric agents are randomly combined into a plurality of combinatorial chemical probes to improve their responsiveness to multi-component heavy metals. Subsequently, the configured combinatorial chemical probe was mixed with a single heavy metal solution in a multi-well plate to observe its color development effect. The color developer of the combinatorial chemical probe was a ternary combination of thioamide, azo and porphyrin compounds with a mass ratio ranging from 1:1:1 to 1:2:

3. The color development conditions were optimized by L9 (3^4) orthogonal experiment, specifically including: pH value 6.5-8.0, reaction temperature 25-35°C, reaction time 10-20 minutes, color development sensitivity ≤0.01 mg / L, which is 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 development reaction were evaluated by comparing the reaction effects of different combination probes with metals. Finally, the metal and color developer combination with the best color development effect was selected to ensure that the best color development signal and the lowest interference can be obtained in multi-metal samples.

3. A multi-component heavy metal spectrum 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. In order 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 range of the Gaussian noise is 0.05-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. The dynamic Z-score algorithm is used for data standardization. The local mean and standard deviation are calculated based on a sliding window, and the window width is 10%-20% of the total number of wavelengths.

4. A multi-component heavy metal spectrum 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 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. In order to solve the problem that the deep learning model is insensitive to the sequence position, the position encoding layer uses the sine-cosine function to embed the wavelength sequence information formula as follows: (1) (2) Where pos is the wavelength position index, 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 parsed 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: (3) (4) Among them, Q is the query matrix (Query), K is the key matrix (Key), V is the value matrix (Value), d k is the dimension of the key (used for scaling gradient stability), y log is the standardized value, y pred is the value after inverse transformation; the Transformer model includes 4 levels of encoders, each level is configured 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-band 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 ith heavy metal.

5. A multi-component heavy metal spectrum deep learning detection method according to claim 1, characterized in that: In order to evaluate the performance of the model, we used a variety of regression evaluation indicators, including root mean square error (RMSE), determination coefficient (R²) and mean absolute error (MAE). Among them, RMSE reflects the average size of the prediction error by calculating the square root of the mean of the square deviation between the predicted value and the true value; R² measures the model's ability to explain data variation and reflects the goodness of fit between the predicted value and the true value, with a value of 0-1; MAE calculates the average value of the absolute deviation between the predicted value and the true value, directly measuring the average error amplitude. The smaller the value, the smaller the average deviation. The three comprehensively evaluate the model performance from the dimensions of error size, goodness of fit, average deviation, etc., and further verify the prediction effect of the model by drawing a scatter plot of the true concentration and the predicted concentration. The formulas for root mean square error (RMSE), determination coefficient (R²) and mean absolute error (MAE) are as follows: (5) (6) (7) Among them, y i Represents the true concentration value of the i-th sample, The model predicts the concentration value, is the average value of the true concentration, and N is the total number of samples.

6. A multi-component heavy metal spectrum 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 the hyperparameters. The Adam optimizer is used with the mean absolute error (MAE, Formula 7) as the loss function.

7. A multi-component heavy metal spectrum 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.

8. A multi-component heavy metal spectrum deep learning detection system, characterized by: A multi-component heavy metal spectroscopy deep learning detection method for implementing any one of claims 1-7, comprising: a combined chemical probe configuration module: used to screen color developer combinations and trigger multi-component heavy metal-specific color development reactions; a UV-Vis spectrum acquisition module: configured with a high-throughput UV-Vis scanning system to achieve rapid acquisition of wide-band superposition spectra; a data processing module: performing data enhancement, standardization and natural logarithmic transformation operations; a deep learning model module: parsing global spectral features based on a Transformer architecture and outputting concentration prediction results; an integrated detection platform: embedding 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.

9. A multi-component heavy metal spectrum deep learning detection system according to claim 8, 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.

10. A multi-component heavy metal spectrum deep learning detection system according to claim 8, characterized in that: The training strategy of the deep learning model module is: using Adam optimizer, with an initial learning rate of 1×10 -4 Compared with the MAE loss function, the dynamic learning rate decay mechanism is used to verify that the loss stagnates for 5 consecutive epochs. The learning rate and early stopping mechanism are decayed by a coefficient of 0.

5. If there is no improvement in the verification indicators for 15 consecutive epochs, the training is terminated to jointly improve the convergence efficiency. The small batch gradient descent batch_size=16 is used for full iteration within 200 epochs, and the robustness of parameter selection is ensured through 10-fold cross-validation. In terms of model regularization, multiple layers of Dropout layers (discard rate 0.1-0.3) are embedded in the network to suppress overfitting, and the input of each layer is batch normalized to coordinate the data distribution. At the same time, L2 regularization is introduced in the convolutional layer to constrain the weight parameters.

Citation Information

Patent Citations

  • End-to-end hyperspectral image classification method and device based on Transform and medium

    CN115731410A

  • Sketch face recognition method and device

    CN117095433A

  • Raman spectrum detection method for mixed fishery medicine

    CN119715492A

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

    CN119780411A

  • Method for detecting bacteria

    GB201615466D0

Cited By

  • Water body heavy metal tracing method based on ultraviolet spectrum Gramer angle difference field conversion

    CN120761370A

  • Spectrum detection method based on large language model assistance

    CN121231448A

  • A spectrum detection method based on a large language model assistance

    CN121231448B