Detection system and method capable of monitoring multiple heavy metal ions online in real time
By combining thermoelectric coupler temperature correction, electrochemical impedance spectroscopy signal processing, and deep convolutional neural networks, the accuracy problem of heavy metal ion detection under environmental interference was solved, and high-precision identification and concentration estimation of various heavy metal ions were achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA RAILWAY NO 10 ENG GRP CO LTD
- Filing Date
- 2026-04-14
- Publication Date
- 2026-05-12
AI Technical Summary
Existing methods for detecting heavy metal ions are not accurate enough under environmental interference and lack adaptive mechanisms to changes in the external environment.
Thermocoupler temperature detection is used for real-time temperature correction, combined with resistance compensation to stabilize water sample temperature; composite electrical response signals are acquired using electrochemical impedance spectroscopy, and signal capture is performed using capacitance response measurement; signal decomposition and denoising are performed using time-frequency joint wavelet transform; feature learning and inference are performed using deep convolutional neural networks, combined with online dynamic calibration to correct for environmental interference.
It enables high-precision identification and concentration estimation of various heavy metal ions in complex environments, improves detection sensitivity and resolution, and supports real-time online monitoring needs.
Smart Images

Figure CN122020347A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of water quality testing technology, and in particular to a detection system and method for real-time online monitoring of multiple heavy metal ions. Background Technology
[0002] With the continuous development of water quality safety monitoring technology, the detection of heavy metal ions has become a key research focus in environmental science and public health. Traditional detection methods, including atomic absorption spectrometry, inductively coupled plasma mass spectrometry, and spectrophotometry, offer high sensitivity and selectivity, but typically rely on complex laboratory instruments and stringent pretreatment procedures, making it difficult to achieve rapid on-site response and simultaneous analysis of multiple ions. In recent years, electrochemical detection technology has been widely applied to in-situ detection of heavy metal ions due to its portability, fast response speed, and low cost. Among these, methods based on electrochemical impedance spectroscopy (EIS) can detect the polarization behavior of ions at different frequencies, representing a promising non-destructive detection method. Simultaneously, with the introduction of signal processing methods and artificial intelligence, researchers are attempting to further analyze detection signals using pattern recognition, feature extraction, and machine learning algorithms to improve the accuracy and intelligence of heavy metal ion identification and concentration prediction.
[0003] While electrochemical signal-based detection methods have made some progress in theoretical research, they still face key challenges in practical deployment. The main issue is the lack of dynamic compensation mechanisms for environmental interference factors (such as fluctuations in water sample temperature), leading to insufficient stability and accuracy of the detection results. Existing studies often employ isothermal control or static laboratory conditions for detection, lacking adaptive mechanisms to changes in the external environment. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides a detection method for real-time online monitoring of multiple heavy metal ions, solving the problem of insufficient accuracy of detection results under environmental interference in the prior art.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0007] In a first aspect, the present invention provides a detection method for real-time online monitoring of multiple heavy metal ions, comprising: measuring the temperature of a water sample using a thermocoupler temperature detection method and performing real-time temperature correction using a resistance compensation method to obtain a temperature-stable target water sample; exciting the temperature-stable target water sample using an electrochemical impedance spectroscopy method and acquiring a composite electrical response signal using a capacitance response measurement method; decomposing and denoising the composite electrical response signal using a time-frequency joint wavelet transform method to obtain multiple electrical feature data; learning and inferring the multiple electrical feature data using a deep convolutional neural network to obtain the types of heavy metal ions and estimate the quantitative results of their concentrations; and correcting for environmental interference in real-time by online dynamic calibration of the types and quantitative results of heavy metal ions to form heavy metal ion detection results.
[0008] As a preferred embodiment of the detection method for real-time online monitoring of multiple heavy metal ions described in this invention, the specific steps of measuring the water sample temperature using a thermocoupler temperature detection method and performing real-time temperature correction using a resistance compensation method to obtain a temperature-stable target water sample are as follows.
[0009] Thermocouple temperature detection method is used to continuously measure the temperature of inflow water sample to form raw temperature data;
[0010] The raw temperature data is compared with the set reference temperature to obtain the temperature difference offset value;
[0011] Based on the temperature difference offset, the resistance value of the constant temperature element is adjusted using a resistance compensation control method to generate a temperature correction control signal.
[0012] The thermal state of the water sample is dynamically adjusted by the temperature correction control signal to obtain a target water sample with stable temperature.
[0013] As a preferred embodiment of the detection method for real-time online monitoring of multiple heavy metal ions described in this invention, the method employs electrochemical impedance spectroscopy to excite a temperature-stable target water sample and uses capacitance response measurement to acquire the composite electrical response signal. The specific steps are as follows:
[0014] Based on a temperature-stable target water sample, an electrolysis environment is established, and multiple AC voltage signals are applied to excite the ions inside the target water sample to generate a frequency domain response, thus forming initial electrochemical impedance data.
[0015] By using a high-precision capacitance response measurement method, the transient current and polarization response of the initial electrochemical impedance data are captured to generate a composite electroresponse signal.
[0016] As a preferred embodiment of the detection method for real-time online monitoring of multiple heavy metal ions described in this invention, the method employs a time-frequency joint wavelet transform to decompose and denoise the composite electrical response signal to obtain multiple electrical characteristic data. The specific steps are as follows:
[0017] The composite electrical response signal is subjected to time-frequency analysis to obtain sub-signals of different frequency bands after multi-scale decomposition, and then subjected to multi-scale wavelet decomposition to obtain sub-signals of different frequency bands.
[0018] For sub-signals of different frequency bands, a soft threshold denoising algorithm is used to remove high-frequency random noise, and the denoised sub-signals of each frequency band are reconstructed into time-frequency composite responses to obtain multiple electrical characteristic data.
[0019] As a preferred embodiment of the detection method for real-time online monitoring of multiple heavy metal ions described in this invention, the specific steps of using a deep convolutional neural network to learn and infer multiple electrical feature data to obtain the types of heavy metal ions and estimate their concentrations are as follows.
[0020] Multiple electrical feature data are input into a pre-trained deep convolutional neural network, and multi-layer convolution and pooling operations are performed to extract multiple electrical feature representations and generate probability distribution maps of heavy metal ion types.
[0021] Based on the extracted multiple electrical features, regression calculations are performed using a fully connected layer to estimate the concentration of heavy metal ions.
[0022] By combining the probability distribution map of heavy metal ion types with the concentration values of heavy metal ions, and then analyzing and interpreting the data through post-processing algorithms, quantitative results of heavy metal ion types and concentrations are obtained.
[0023] As a preferred embodiment of the detection method for real-time online monitoring of multiple heavy metal ions described in this invention, the concentration values of heavy metal ions are estimated using regression calculations based on extracted multiple electrical feature representations and fully connected layers. The specific steps are as follows:
[0024] The multiple electrical feature representations are input into the first layer of the fully connected layer, weighted summation is performed and activation is applied to generate the initial concentration mapping vector.
[0025] The initial concentration mapping vector is input into the second fully connected network to further compress the feature dimension and enhance the nonlinear expression, and output the intermediate concentration estimation result.
[0026] The intermediate concentration estimation results are input into the final output layer, and the concentration values of various heavy metal ions are calculated through regression functions.
[0027] As a preferred embodiment of the detection method for real-time online monitoring of multiple heavy metal ions described in this invention, the step of correcting for environmental interference in real-time by performing online dynamic calibration to form heavy metal ion detection results is as follows.
[0028] The quantitative results of heavy metal ion types and concentrations were used as the initial detection data;
[0029] Simultaneously collect current environmental parameter data to form an interference factor dataset;
[0030] By fusing the interference factor dataset with the initial detection data, a calibration factor reflecting environmental interference is obtained.
[0031] The initial detection data is adjusted using calibration factors to correct for environmental interference, resulting in dynamically calibrated values for the types and concentrations of heavy metal ions, thus forming the heavy metal ion detection results.
[0032] Secondly, this invention provides a detection system capable of real-time online monitoring of multiple heavy metal ions, comprising a temperature correction module, a response acquisition module, a signal decomposition and denoising module, a concentration inference module, and a result correction module. The temperature correction module measures the water sample temperature using a thermocoupler temperature detection method and performs real-time temperature correction using a resistance compensation method to obtain a temperature-stable target water sample. The response acquisition module excites the temperature-stable target water sample using electrochemical impedance spectroscopy and acquires a composite electrical response signal using a capacitance response measurement method. The signal decomposition and denoising module decomposes and denoises the composite electrical response signal using a time-frequency joint wavelet transform method to obtain multiple electrical feature data. The concentration inference module learns and infers from the multiple electrical feature data using a deep convolutional neural network to obtain the types of heavy metal ions and estimate their quantitative concentrations. The result correction module performs real-time environmental interference correction on the types and quantitative concentrations of heavy metal ions through online dynamic calibration to form the heavy metal ion detection result.
[0033] Thirdly, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, wherein when the computer program is executed by the processor, it implements any step of the detection method for real-time online monitoring of multiple heavy metal ions as described in the first aspect of the present invention.
[0034] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the detection method for real-time online monitoring of multiple heavy metal ions as described in the first aspect of the present invention.
[0035] The beneficial effects of this invention are as follows: By introducing a deep convolutional neural network into the identification path to extract multiple electrical feature data in a hierarchical manner, key features are automatically extracted from complex, high-dimensional electrical response signals, thereby significantly enhancing the identification accuracy of the electrochemical response of heavy metal ions. Compared with traditional linear modeling or manual feature extraction methods, it effectively solves the problem of overlapping interference between multiple heavy metal ion signals, improves the detection sensitivity and resolution of weak response ions, and thus achieves high-precision identification and concentration estimation of multiple types of heavy metal ions, effectively supporting the real-time detection needs in complex aquatic environments. Attached Figure Description
[0036] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 This is a flowchart of a detection method for real-time online monitoring of multiple heavy metal ions.
[0038] Figure 2 This is a schematic diagram of a detection system capable of real-time online monitoring of multiple heavy metal ions.
[0039] Figure 3 This is a flowchart of the temperature correction module.
[0040] Figure 4 This is a flowchart of inference for a deep convolutional neural network. Detailed Implementation
[0041] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0042] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0043] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0044] Reference Figures 1-4This is one embodiment of the present invention, which provides a detection method for real-time online monitoring of multiple heavy metal ions, comprising the following steps:
[0045] in, Figure 2 The connection relationships of the temperature correction module, response acquisition module, signal decomposition and denoising module, concentration inference module and result correction module in the detection system are shown. Figure 3 The process of continuous temperature measurement, temperature difference comparison, resistance compensation adjustment, and dynamic thermal state control corresponding to temperature correction is shown. Figure 4 The process of feature extraction, category probability output, concentration regression estimation, and post-processing screening corresponding to deep convolutional neural network inference is shown.
[0046] S1. The water sample temperature is measured using a thermocoupler temperature detection method and real-time temperature correction is performed using a resistance compensation method to obtain a target water sample with stable temperature.
[0047] S1.1 Continuous temperature measurement of the inflow water sample is performed using a thermocoupler temperature detection method to generate raw temperature data.
[0048] Specifically, the temperature sensing end of the thermocouple is directly contacted with the flowing water sample, and the temperature difference voltage signal generated by the thermocouple is used as the response to temperature changes. By measuring the temperature difference voltage signal, the corresponding water sample temperature value is obtained. Temperature data at multiple time points are continuously collected to form a raw temperature data sequence to reflect the temperature change trend of the flowing water sample. For example, the acquisition frequency is set to once per second, and temperature data is continuously collected for several minutes to ensure real-time capture of temperature changes.
[0049] S1.2. Compare the raw temperature data with the set reference temperature to obtain the temperature difference offset value.
[0050] Specifically, a reference temperature is set as the target temperature value. The continuously collected raw temperature data is compared with the set reference temperature one by one, and the difference between the raw temperature data and the set reference temperature at each time point is calculated. The difference is the temperature difference offset value, which is recorded as a point-by-point difference sequence between the raw temperature data and the set reference temperature. By continuously updating the temperature difference offset value, the deviation of the inflow water sample temperature from the set reference temperature is reflected.
[0051] It should also be noted that the specific steps for setting the reference temperature as the target temperature value are as follows: collect historical temperature data of the target detection environment, analyze the temperature variation range and typical average value, and extract the stable temperature range of the area during normal working hours; combine the performance stability test results of the multiple electrical characteristic acquisition device used under different temperature conditions to determine the working temperature range with the most stable response and the least noise; on this basis, select a representative temperature within the range as the reference temperature value, for example, set to 25℃ in the example, and record the temperature value in the temperature compensation or calibration parameters during the detection process as the target temperature value for subsequent temperature correction calculations.
[0052] S1.3. Based on the temperature difference offset value, the resistance value of the constant temperature element is adjusted using the resistance compensation control method to generate a temperature correction control signal.
[0053] Specifically, based on the difference between the currently collected real-time temperature value and the set reference temperature value, the required temperature adjustment amount is calculated; using the temperature adjustment amount, the target resistance value is determined through a preset temperature-resistance mapping curve or a lookup table method, which is the current resistance adjustment target to be achieved; the target resistance value is combined with the adjustment direction (heating or cooling) to generate a control data frame, which contains a command bit indicating the adjustment direction and a numerical field of the target resistance value; the control data frame is output as a temperature correction control signal to control the working state of the thermostat element, thereby achieving dynamic adjustment of the actual temperature.
[0054] It should also be noted that the temperature-resistance mapping relationship can be obtained by calibrating the resistance response values of thermistors or other sensitive components under different temperature conditions in advance, and forming a standard reference table; the structure of the control data frame should conform to the control protocol supported by the thermostatic element to ensure that the adjustment command and target resistance value can be accurately identified and executed; the temperature correction control signal should be real-time and accurate to avoid distortion of multiple electrical characteristic data caused by temperature fluctuations.
[0055] S1.4. Dynamically adjust the thermal state of the water sample by adjusting the temperature correction control signal to obtain a target water sample with stable temperature.
[0056] Specifically, the temperature correction control signal is transmitted to the thermostatic element, which adjusts its heating or cooling power according to the control signal, for example, by adjusting the resistance heating or cooling mechanism intensity to change the heat output; the thermostatic element releases or absorbs heat energy into the inflowing water sample, adjusting the water sample temperature change in real time; the thermocoupler continuously monitors the water sample temperature and collects the latest raw temperature data to determine the temperature change trend; when the temperature difference deviation exceeds the set reference temperature value, the temperature correction control signal is regenerated according to the latest temperature difference deviation value, and the thermostatic element continues to be controlled to heat or cool; the above steps are repeated until the water sample temperature stabilizes within the set reference temperature ± 0.1℃ range, forming a target water sample with stable temperature.
[0057] It should also be noted that during the temperature stabilization process, the judgment value of the temperature difference deviation can be adjusted according to the detection requirements to ensure that the target water sample temperature meets the stability requirements under different environments; the heating and cooling power adjustment of the constant temperature element should have a rapid response capability to adapt to real-time changes in water sample temperature.
[0058] S2. Electrochemical impedance spectroscopy is used to excite a target water sample with stable temperature, and the composite electrical response signal is acquired using capacitance response measurement.
[0059] S2.1. Based on a temperature-stable target water sample, establish the electrolysis environment to be tested, and apply multiple frequency AC voltage signals to excite the ions inside the target water sample to generate a frequency domain response, forming initial electrochemical impedance data.
[0060] Specifically, based on a temperature-stable target water sample, an electrode device is used to place the target water sample in the electrolysis environment to be tested. For example, a three-electrode method is used to configure a working electrode, a reference electrode, and an auxiliary electrode. A multi-frequency AC voltage signal is applied to the electrode through a signal generator, for example, the frequency range covers 10Hz to 100kHz, and the amplitude is controlled in the range of tens of mV to hundreds of mV. The electrode senses the electrochemical reaction of ions in the target water sample and generates a frequency domain response current signal. An electrochemical impedance spectroscopy is used to collect the phase difference and amplitude change between the frequency domain response current signal and the applied voltage, and the initial electrochemical impedance data is recorded.
[0061] It should also be noted that the applied multi-frequency AC voltage signal must have a voltage amplitude sufficient to excite the electrochemical reaction in the target water sample without triggering electrode side reactions; the cleanliness and contact condition of the electrode device should be maintained in good condition to ensure the accuracy and stability of the electrochemical impedance data.
[0062] S2.2. Using a high-precision capacitance response measurement method, the transient current and polarization response of the initial electrochemical impedance data are captured to generate a composite electrical response signal.
[0063] Specifically, a high-precision capacitance response measurement method is employed. A high-precision capacitance response measurement device is connected between the working electrode and the reference electrode. A step excitation voltage signal is applied, and a high-frequency sampling circuit with a sampling frequency set to 100kHz is used to simultaneously acquire transient current signals and polarization response signals. Continuous current changes and electrode potential changes from the initial excitation voltage are recorded. The transient current signal is input into the capacitance measurement circuit, and numerical integration is performed based on the discrete current values at each sampling point in the time series. For example, the trapezoidal integration method is used to integrate the current data sequence within a time window to obtain the charge change, expressed in C. Simultaneously, key time-domain features of the polarization response signal are extracted, including response delay time, peak response time, and response decay time, to construct a time-domain vector describing the dynamics of the polarization process. Fast Fourier transforms are performed on the transient current signal and the polarization response signal respectively to obtain the amplitude spectrum and phase spectrum in the frequency domain. The time-series integration results, the time-domain feature vector, and the frequency-domain feature data are combined to form a composite electrical response signal.
[0064] It should also be noted that the specific steps for constructing a time-domain vector describing the dynamics of the polarization process are as follows: Extract the continuous data sequence of the original potential changing with time from the polarization response signal acquired by the high-precision capacitance response measurement device, and unify the starting time reference for all potential data based on the starting time point of the step excitation voltage signal application; detect the starting point of the polarization response in the potential change sequence, i.e., the moment when the potential first deviates from the initial stable value, and record it as the starting response time; continue scanning the data sequence to find the time point when the potential reaches the maximum change amplitude, and record it as the peak response time; further scan the data sequence to determine the time point when the potential decays to within ±10% of the initial stable value, and record it as the response termination time; use the starting response time, peak response time, response termination time, peak amplitude, and the duration of potential change (i.e., response termination time minus the starting response time) as time-domain feature quantities; arrange all time-domain feature quantities in a fixed order to form a vector, for example: [starting response time, peak response time, response termination time, peak amplitude, response duration], which constitutes a time-domain vector used to characterize the dynamic behavior of the polarization process.
[0065] S3. The composite electrical response signal is decomposed and denoised using the time-frequency joint wavelet transform method to obtain multiple electrical characteristic data.
[0066] S3.1 Perform time-frequency analysis on the composite electrical response signal to obtain sub-signals of different frequency bands after multi-scale decomposition, and then perform multi-scale wavelet decomposition to obtain sub-signals of different frequency bands.
[0067] Specifically, the composite electrical response signal is processed using a time-frequency joint wavelet transform method. A suitable wavelet basis function is selected, such as the Daubechies wavelet, and the number of decomposition layers is set to, for example, 4 layers. Multi-scale decomposition of the signal is achieved through continuous wavelet transform to obtain sub-signals of different frequency bands. Discrete wavelet transform is applied to each layer of sub-signals for finer decomposition, resulting in more granular sub-signals of different frequency bands. The decomposition results include low-frequency and multiple high-frequency components, which facilitates subsequent feature extraction.
[0068] S3.2 For sub-signals of different frequency bands, use a soft threshold denoising algorithm to remove high-frequency random noise, and reconstruct each denoised sub-signal of the frequency band into a time-frequency composite response to obtain multiple electrical characteristic data.
[0069] Specifically, for different frequency band sub-signals, the threshold parameters in the soft thresholding denoising algorithm are determined. For example, a general threshold formula can be used:
[0070] ;
[0071] in, The threshold parameter used in the soft thresholding denoising algorithm. Let be the logarithmic function with base 2 to the natural logarithm. The standard deviation of noise. For different frequency band sub-signal lengths;
[0072] Subsequently, a soft thresholding function is applied to the high-frequency coefficients of different frequency band sub-signals. Specifically, coefficients smaller than the threshold parameter are set to zero, and coefficients larger than the threshold parameter are shrunk to complete the denoising. After denoising, wavelet reconstruction is performed on all frequency band sub-signals. Combined with information from different frequency bands, a clear time-frequency composite response signal is obtained, forming multiple electrical feature data.
[0073] It should also be noted that the noise standard deviation It can be estimated using the median absolute deviation of the high-frequency sub-signals, for example... ;in The median of the absolute values of the high-frequency wavelet coefficients is used. The appropriate selection of the threshold parameter directly affects the denoising effect. If it is too large, the signal details may be lost, and if it is too small, there will be more noise residue. In addition, the selection of wavelet basis functions and decomposition levels should be consistent with the time-frequency joint wavelet transform to ensure the integrity of signal features.
[0074] S4. Use deep convolutional neural networks to learn and reason about multiple electrical feature data to obtain the types of heavy metal ions and estimate their concentrations.
[0075] S4.1 Input the multiple electrical feature data into the pre-trained deep convolutional neural network, perform multi-layer convolution and pooling operations to extract multiple electrical feature representations, and generate a probability distribution map of heavy metal ion types.
[0076] Specifically, multiple electrical feature data are input into a pre-trained deep convolutional neural network. The first convolutional layer extracts preliminary features, with kernel parameters derived from weights learned during pre-training. After activation function processing, the preliminary features are further reduced in dimensionality and highlight important information through the first pooling layer. This process is repeated through multiple convolutional and pooling layers, each using pre-trained weight parameters and employing either max pooling or average pooling methods to progressively extract higher-level and more abstract representations of the multiple electrical features. Finally, a fully connected layer transforms the convolutional and pooled feature maps into a probability distribution map of heavy metal ion types. Each value in the probability distribution map represents the predicted probability of the corresponding heavy metal ion, thus generating the probability distribution map of heavy metal ion types.
[0077] It should also be noted that the pre-training process includes collecting a large amount of labeled multiple electrical feature data, constructing a deep convolutional neural network structure, using the cross-entropy loss function for supervised learning, adjusting the convolutional kernel weights and bias parameters through the backpropagation algorithm until the training error converges, and saving the convolutional kernel weights and deep convolutional neural network parameters after training for use when inputting new multiple electrical feature data, so as to achieve fast and accurate prediction of the probability of heavy metal ion types.
[0078] The steps for constructing a deep convolutional neural network include: setting an input layer to accept normalized multiple electrical feature vectors; constructing multiple convolutional layers, each containing several convolutional kernels of the same size, with the initial weights of the kernels randomly generated using a Gaussian distribution; configuring activation operations after each convolutional layer, such as the ReLU activation function in this example, to enhance nonlinear expressiveness; setting pooling layers after the convolutional layers for downsampling, such as max pooling, to extract local salient features; after all convolutional and pooling layers are stacked, adding a fully connected layer to integrate the convolutional features; and finally setting an output layer to generate the probability distribution of heavy metal ion species, with the number of nodes in the output layer matching the number of heavy metal ion species.
[0079] S4.2 Based on the extracted multiple electrical features, regression calculations are performed using a fully connected layer to estimate the concentration of heavy metal ions.
[0080] S4.2.1 Input the multiple electrical feature representations into the first layer of the fully connected layer, perform weighted summation and activation, and generate the initial concentration mapping vector.
[0081] Specifically, the multiple electrical feature representations are taken as input and fed into the first layer of the fully connected layer. Each input feature is weighted and summed with its corresponding weight. The calculation formula is as follows:
[0082] ;
[0083] in, This represents the total number of input features. Indicates the index of the input feature. Indicates the number of the neuron. Indicates the first Multiple electrical characteristics, Indicates the connection of the first The input feature and the first The weights of each neuron, Indicates the first Bias of each neuron This indicates the dimension of the input features; subsequently, the weighted summation result is... The activation function is applied, such as the ReLU function or the Sigmoid function, and the corresponding activation values are output. These activation values are then used to form the initial concentration mapping vector.
[0084] It should also be noted that the weights and bias parameters of the fully connected layer are obtained through a pre-training process. The multiple electrical feature representations of the input are abstracted and extracted through multiple layers of convolutional pooling before being fed into the fully connected layer. The choice of activation function affects the nonlinear expressive power of the initial concentration mapping vector, which serves as the input basis for subsequent concentration prediction or regression steps.
[0085] S4.2.2 Input the initial concentration mapping vector into the second fully connected network to further compress the feature dimension and enhance the nonlinear expression, and output the intermediate concentration estimation results.
[0086] Specifically, the initial concentration mapping vector is input to each neuron node in the second fully connected network. For each value in the initial concentration mapping vector, a weighted summation operation is performed with the corresponding weight coefficient of the second fully connected network. Then, the result of each weighted summation is added to the corresponding bias term in the second fully connected network to form a weighted output value sequence of the second fully connected network. A non-linear activation function is applied to each value in the weighted output value sequence. For example, the ReLU activation function is used to truncate negative numbers to 0 and keep positive numbers unchanged, thereby completing the non-linear activation process of the second fully connected network.
[0087] It should also be noted that the activation result sequence obtained after the operation is completed is used as an intermediate result vector for concentration estimation, which is used for further processing of subsequent concentration estimation output. The output dimension of the second fully connected network is lower than that of the initial concentration mapping vector. For example, if the initial concentration mapping vector is a vector of length 128, the output of the second fully connected network is an intermediate result vector of concentration estimation of length 32.
[0088] S4.2.3 Input the intermediate concentration estimation results into the final output layer, and calculate the concentration values of various heavy metal ions through the regression function.
[0089] Specifically, the intermediate concentration estimation result vector is input into the final output layer, and each component in the intermediate concentration estimation result vector is... Weight parameters corresponding to the final output layer Perform linear weighting and add a bias term. The estimated concentration of each type of heavy metal ion is calculated using the following formula:
[0090] ;
[0091] in, Indicates the first Estimated concentrations of heavy metal ions. The first term represents the intermediate result vector of concentration estimation. One portion, This indicates the intermediate result of concentration estimation. The component and the first Weighting parameters between heavy metal ion outputs For the corresponding bias term, Indices representing component indices, This indicates the dimension of the intermediate result vector for concentration estimation.
[0092] It should also be noted that this applies to each type of heavy metal ion. Perform the above linear combination calculation once each, and output the results. This results in a final vector representing the estimated concentration of various heavy metal ions, used to indicate their specific concentration values. For example, when estimating the concentrations of three heavy metal ions, the final output layer generates three estimated concentration values. , respectively, represent the concentrations of the three types of heavy metal ions.
[0093] S4.3 Combine the probability distribution map of heavy metal ion types with the concentration values of heavy metal ions, and analyze and interpret them through post-processing algorithms to obtain quantitative results of heavy metal ion types and concentrations.
[0094] Specifically, the input multiple electrical feature data are fed into a pre-trained deep convolutional neural network and a concentration regression function to obtain the probability distribution map of heavy metal ion types and the concentration values of heavy metal ions. The predicted probability value for each type of heavy metal ion needs to be extracted sequentially from the probability distribution map, denoted as the i-th probability value for each type of heavy metal ion. Predicted probability value of class Extract the estimated concentration value of each type of heavy metal ion from the numerical concentration values of heavy metal ions, and denot it as the first value of each type of heavy metal ion. Estimated concentration value of class After completion, data pairs consisting of predicted probability values and estimated concentration values are constructed and sequentially input into a post-processing algorithm for class-by-class analysis and judgment; furthermore, probability thresholds are selected according to preset categories. With concentration effectiveness threshold For each data pair consisting of a predicted probability value and an estimated concentration value, determine whether it satisfies the following conditions: and If all conditions are met, the data pair is retained as the valid heavy metal ion species and corresponding concentrations; the data pair consisting of the predicted probability value and the estimated concentration value that meet all screening conditions is output as the quantitative result of heavy metal ion species and concentration.
[0095] It should also be noted that the category filtering probability threshold The settings are based on the recognition performance distribution of deep convolutional neural networks on the validation set, in order to ensure a balance between recognition accuracy and reliability; concentration validity threshold. The setting is based on the lowest detection limit or relevant standard requirements of the detection scenario. For example, it can be set to 0.01 mg / L in drinking water testing scenarios. The data pairs consisting of the predicted probability values and estimated concentration values that meet all screening conditions will be output as the final quantitative results of the heavy metal ion species and concentrations.
[0096] S5. Real-time environmental interference correction is performed on the quantitative results of heavy metal ion types and concentrations through online dynamic calibration to form heavy metal ion detection results.
[0097] S5.1. Use the quantitative results of heavy metal ion types and concentrations as the initial detection data.
[0098] Specifically, from the quantitative results of heavy metal ion types and concentrations output by the post-processing algorithm, the type number and corresponding concentration value of each type of heavy metal ion are extracted item by item. Each pair of type number and concentration value is organized according to a one-to-one correspondence to form a data set containing all target heavy metal ion types and their corresponding concentration values. The data set is then standardized, including unifying the unit format, verifying field types, and filling in missing items, to ensure that each field has consistency and identifiability in subsequent processing. For example, the concentration unit is unified as mg / L, and the type number is unified as an integer value. The formatted data set is saved as a structured data table as the input data source for subsequent fusion processing, and the structured data table is explicitly marked as the initial detection data.
[0099] It should also be noted that the initial detection data must be completely inherited from the output of the post-processing algorithm, and no additional heavy metal ion types or concentration values should be added, deleted, or derived. In addition, the data table structure of the initial detection data should adopt a two-dimensional data table format, where each row corresponds to one heavy metal ion and contains two fields: a type number field and a concentration value field. For example, the first row is type number 1 with a concentration value of 0.028 mg / L, and the second row is type number 2 with a concentration value of 0.006 mg / L.
[0100] S5.2. Synchronously collect current environmental parameter data to form an interference factor dataset.
[0101] Specifically, the environmental parameter acquisition equipment is activated, and environmental parameter data, including temperature, humidity, atmospheric pressure, wind speed, and light intensity, are collected synchronously at a preset sampling frequency, for example, once per second. The collected environmental parameter data is cached in real time according to timestamp order, and the data format is standardized to ensure consistency in numerical type and unit, such as temperature being uniformly expressed as °C and humidity as a percentage. Then, outlier detection is performed on the environmental parameter data, and abnormal data exceeding the example of temperatures below -40°C or above 85°C are removed. The processed environmental parameter data is stored in the interference factor dataset according to a predefined format, and a collection timestamp and device identifier are added to form a complete interference factor dataset.
[0102] It should also be noted that the specific steps for setting the sampling frequency are as follows: Determine the sampling frequency range based on the environmental parameter collection requirements. For example, for parameters that change slowly, such as temperature and humidity, a lower sampling frequency can be selected, such as once per second; while for parameters that change rapidly, such as wind speed and light intensity, a higher sampling frequency should be selected, such as once per hundred milliseconds. Consider the reasonableness of the sampling frequency by taking into account the device's hardware performance and storage capacity, and avoid excessively high frequencies that may lead to data redundancy or excessive device load. Set the sampling frequency parameter in the configuration file or sampling control program. The parameter unit is Hz. For example, setting it to 1Hz means sampling once per second. Write the set sampling frequency parameter into the control register or storage unit of the acquisition device so that the device can perform the sampling task according to the preset frequency. The sampling control program starts a timer or timer interrupt according to the preset sampling frequency to trigger the sampling signal periodically, thereby realizing the periodic collection of environmental parameters.
[0103] S5.3. Fuse the interference factor dataset with the initial detection data to obtain a calibration factor that reflects environmental interference.
[0104] Specifically, the pre-collected interference factor dataset is paired one-to-one with the initial detection data collected at the corresponding time according to timestamps, ensuring that each set of interference factor values in the interference factor dataset has a synchronous correspondence with each set of electrical feature data in the initial detection data. Each corresponding interference factor value is then concatenated with the electrical feature data in the initial detection data to form an extended input feature vector containing interference information. Normalization is then performed on the interference factor data dimension of the extended input feature vector, using either maximum-minimum value normalization or Z-score normalization, ensuring that the interference factor data participates in subsequent analysis on a uniform scale. Based on the constructed extended input feature vector, statistical fitting methods are used to analyze the numerical offset in the electrical feature data, extracting the offset of the electrical feature values in the presence of interference factors as a calibration factor reflecting environmental interference. Statistical fitting methods can employ multiple linear regression or principal component analysis, with the fitting objective being to minimize the deviation between the electrical feature data and the standard reference value. Finally, the extracted calibration factor is recorded and used in the subsequent detection data correction process.
[0105] S5.4. Adjust the initial detection data using calibration factors to correct for environmental interference and obtain the types and concentrations of heavy metal ions after dynamic calibration, thus forming the heavy metal ion detection results.
[0106] Specifically, based on the sampling timestamp, each calibration factor in the calibration factor dataset is matched one-to-one with the heavy metal ion species and concentration values at the corresponding time points in the initial detection data. For each set of time-corresponding calibration data after matching, an element-wise multiplication operation is performed, that is, the concentration value of each heavy metal ion in the initial detection data is multiplied by the corresponding calibration factor value to calculate the correction concentration. All correction concentration data are screened for validity. Based on a preset concentration threshold, for example, heavy metal ions with correction concentration values greater than the example threshold of 0.01 mg / L are judged as valid, and data with too low or abnormal concentrations are discarded. The screened heavy metal ion species and their corresponding correction concentration values are integrated to form a dynamically calibrated heavy metal ion species and concentration values containing time series. The dynamically calibrated heavy metal ion species are output as the final heavy metal ion detection result.
[0107] It should also be noted that the steps for calculating the corrected concentration are as follows: iterate through the initial detection data for each heavy metal ion concentration value at each time point; read the calibration factor for the corresponding time point and heavy metal ion type; perform a multiplication operation to multiply the initial concentration value by the calibration factor to obtain the corrected concentration value of the heavy metal ion at the time point; repeat the operation until the correction calculation for all time points and heavy metal ion concentrations is completed.
[0108] The specific steps for setting the concentration threshold are as follows: set the concentration threshold, for example, 0.01 mg / L; iterate through all calculated corrected concentration values; for each corrected concentration value, determine whether it is greater than or equal to the concentration threshold; if the condition is met, mark the corrected concentration and the corresponding heavy metal ion type as valid; if the condition is not met, remove the concentration value and the corresponding heavy metal ion type; integrate all valid heavy metal ion types and corrected concentration values to form a valid data set.
[0109] This embodiment also provides a detection system capable of real-time online monitoring of multiple heavy metal ions, including: a temperature correction module, a response acquisition module, a signal decomposition and denoising module, a concentration inference module, and a result correction module;
[0110] The temperature correction module is used to measure the water sample temperature using a thermocoupler temperature detection method and perform real-time temperature correction using a resistance compensation method to obtain a target water sample with stable temperature.
[0111] The response acquisition module is used to excite a temperature-stable target water sample using electrochemical impedance spectroscopy and to acquire the composite electrical response signal using capacitance response measurement.
[0112] The signal decomposition and denoising module is used to decompose and denoise the composite electrical response signal using the time-frequency joint wavelet transform method to obtain multiple electrical feature data.
[0113] The concentration inference module is used to learn and infer multiple electrical feature data using a deep convolutional neural network to obtain the types of heavy metal ions and estimate the quantitative results of their concentrations.
[0114] The result correction module is used to correct environmental interference in the quantitative results of heavy metal ion types and concentrations through online dynamic calibration, thereby generating heavy metal ion detection results.
[0115] This embodiment also provides a computer device applicable to the detection method for real-time online monitoring of multiple heavy metal ions, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to realize the detection method for real-time online monitoring of multiple heavy metal ions as proposed in the above embodiment.
[0116] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0117] This embodiment also provides a storage medium storing a computer program. When executed by a processor, the program implements the detection method for real-time online monitoring of multiple heavy metal ions as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0118] In summary, this invention significantly enhances the accuracy of identifying the electrochemical responses of heavy metal ions by introducing a deep convolutional neural network into the identification path to extract multiple electrical feature data in a hierarchical manner. This achieves automatic extraction of key features from complex, high-dimensional electrical response signals. Compared to traditional linear modeling or manual feature extraction methods, it effectively solves the problem of overlapping interference between various heavy metal ion signals, improves the detection sensitivity and resolution of weakly responding ions, and thus achieves high-precision identification and concentration estimation of various types of heavy metal ions, effectively supporting the real-time detection needs in complex aquatic environments.
[0119] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for real-time online monitoring of multiple heavy metal ions, characterized in that: include, The temperature of water samples was measured using a thermocoupler temperature detection method and real-time temperature correction was performed using a resistance compensation method to obtain a target water sample with stable temperature. Electrochemical impedance spectroscopy was used to excite a temperature-stable target water sample, and the composite electro-response signal was acquired using capacitance response measurement. The composite electrical response signal is decomposed and denoised using a time-frequency joint wavelet transform method to obtain multiple electrical characteristic data. By using deep convolutional neural networks to learn and infer multiple electrical feature data, the types of heavy metal ions and the quantitative results of their concentrations can be obtained. Online dynamic calibration is used to correct for environmental interference in real time to obtain quantitative results of heavy metal ion types and concentrations, thus generating heavy metal ion detection results.
2. The detection method for real-time online monitoring of multiple heavy metal ions as described in claim 1, characterized in that: The method of measuring water sample temperature using a thermocoupler and performing real-time temperature correction using a resistance compensation method to obtain a target water sample with stable temperature is described in the following steps. Thermocouple temperature detection method is used to continuously measure the temperature of inflow water sample to form raw temperature data; The raw temperature data is compared with the set reference temperature to obtain the temperature difference offset value; Based on the temperature difference offset, the resistance value of the constant temperature element is adjusted using a resistance compensation control method to generate a temperature correction control signal. The thermal state of the water sample is dynamically adjusted by the temperature correction control signal to obtain a target water sample with stable temperature.
3. The detection method for real-time online monitoring of multiple heavy metal ions as described in claim 2, characterized in that: The method employs electrochemical impedance spectroscopy to excite a temperature-stable target water sample, and then uses capacitance response measurement to acquire the composite electrical response signal. The specific steps are as follows. Based on a temperature-stable target water sample, an electrolysis environment is established, and multiple AC voltage signals are applied to excite the ions inside the target water sample to generate a frequency domain response, thus forming initial electrochemical impedance data. By using a high-precision capacitance response measurement method, the transient current and polarization response of the initial electrochemical impedance data are captured to generate a composite electroresponse signal.
4. The detection method for real-time online monitoring of multiple heavy metal ions as described in claim 3, characterized in that: The composite electrical response signal is decomposed and denoised using a time-frequency joint wavelet transform method to obtain multiple electrical feature data. The specific steps are as follows: The composite electrical response signal is subjected to time-frequency analysis to obtain sub-signals of different frequency bands after multi-scale decomposition, and then subjected to multi-scale wavelet decomposition to obtain sub-signals of different frequency bands. For sub-signals of different frequency bands, a soft threshold denoising algorithm is used to remove high-frequency random noise, and the denoised sub-signals of each frequency band are reconstructed into time-frequency composite responses to obtain multiple electrical characteristic data.
5. The detection method for real-time online monitoring of multiple heavy metal ions as described in claim 4, characterized in that: The method of using a deep convolutional neural network to learn and infer multiple electrical feature data to obtain the types of heavy metal ions and estimate their concentrations involves the following specific steps: Multiple electrical feature data are input into a pre-trained deep convolutional neural network, and multi-layer convolution and pooling operations are performed to extract multiple electrical feature representations and generate probability distribution maps of heavy metal ion types. Based on the extracted multiple electrical features, regression calculations are performed using a fully connected layer to estimate the concentration of heavy metal ions. By combining the probability distribution map of heavy metal ion types with the concentration values of heavy metal ions, and then analyzing and interpreting the data through post-processing algorithms, quantitative results of heavy metal ion types and concentrations are obtained.
6. The detection method for real-time online monitoring of multiple heavy metal ions as described in claim 5, characterized in that: Based on the extracted multiple electrical feature representations, regression calculations are performed using a fully connected layer to estimate the concentration of heavy metal ions. The specific steps are as follows. The multiple electrical feature representations are input into the first layer of the fully connected layer, weighted summation is performed and activation is applied to generate the initial concentration mapping vector. The initial concentration mapping vector is input into the second fully connected network to further compress the feature dimension and enhance the nonlinear expression, and output the intermediate concentration estimation result. The intermediate concentration estimation results are input into the final output layer, and the concentration values of various heavy metal ions are calculated through regression functions.
7. The detection method for real-time online monitoring of multiple heavy metal ions as described in claim 5, characterized in that: The method involves real-time environmental interference correction of the quantitative results for heavy metal ion types and concentrations through online dynamic calibration to generate heavy metal ion detection results. The specific steps are as follows. The quantitative results of heavy metal ion types and concentrations were used as the initial detection data; Simultaneously collect current environmental parameter data to form an interference factor dataset; By fusing the interference factor dataset with the initial detection data, a calibration factor reflecting environmental interference is obtained. The initial detection data is adjusted using calibration factors to correct for environmental interference, resulting in dynamically calibrated values for the types and concentrations of heavy metal ions, thus forming the heavy metal ion detection results.
8. A detection system capable of real-time online monitoring of multiple heavy metal ions, based on the detection method for real-time online monitoring of multiple heavy metal ions according to any one of claims 1 to 7, characterized in that: It includes a temperature correction module, a response acquisition module, a signal decomposition and denoising module, a concentration inference module, and a result correction module; The temperature correction module is used to measure the water sample temperature using a thermocoupler temperature detection method and perform real-time temperature correction using a resistance compensation method to obtain a target water sample with stable temperature. The response acquisition module is used to excite a temperature-stable target water sample using electrochemical impedance spectroscopy and to acquire the composite electrical response signal using capacitance response measurement. The signal decomposition and denoising module is used to decompose and denoise the composite electrical response signal using the time-frequency joint wavelet transform method to obtain multiple electrical feature data. The concentration inference module is used to learn and infer multiple electrical feature data using a deep convolutional neural network to obtain the types of heavy metal ions and estimate their concentrations. The result correction module is used to correct environmental interference in the quantitative results of heavy metal ion types and concentrations through online dynamic calibration, thereby generating heavy metal ion detection results.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the detection method for real-time online monitoring of multiple heavy metal ions as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the detection method for real-time online monitoring of multiple heavy metal ions as described in any one of claims 1 to 7.