A water quality detection method and device based on electrochemical sensor
Through a multi-depth electrochemical sensor array and an electrochemical signal dynamic threshold triggering algorithm, combined with a hierarchical electrochemical transfer-attention network model, the problems of signal drift and cross-interference in traditional water quality detection are solved, and high-precision identification and visual analysis of low-concentration multi-component coexisting pollutants are achieved, thereby improving the stability and accuracy of the detection system.
Patent Information
- Application Number
- CN202510995985.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-07-18
AI Technical Summary
Traditional water quality detection methods cannot meet the real-time dynamic monitoring needs of complex water environments. There are problems of signal drift and decreased detection sensitivity. In particular, cross-interference is serious in the detection of low-concentration multi-component coexisting pollutants, resulting in reduced reliability and accuracy of detection results.
By using a multi-depth electrochemical sensor array combined with an electrochemical signal dynamic threshold trigger algorithm, high-precision identification of low-concentration multi-component coexisting pollutants and generation of three-dimensional pollutant distribution dynamic maps are achieved through electrochemical fingerprint feature recognition and hierarchical electrochemical transfer-attention network model.
It achieves synchronous monitoring of different depths of water bodies, avoids signal drift, improves the stability and sensitivity of the detection system, significantly reduces cross-interference, ensures the reliability and accuracy of detection results, and can visualize and analyze the spatial distribution characteristics and migration patterns of pollutants.
Smart Images

Figure CN120490266B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water quality detection, and in particular to a water quality detection method and device based on an electrochemical sensor. Background Art
[0002] Pollutant detection has become a crucial prerequisite for ensuring the reliability of experimental results, especially for the accurate identification of low-concentration heavy metal ions and organic matter. Traditional water quality testing methods rely primarily on fixed-interval sampling mechanisms and single-depth monitoring strategies. These methods face numerous technical bottlenecks and cannot meet the needs of real-time, dynamic monitoring in complex aquatic environments.
[0003] Although electrochemical sensor technology is widely used in water quality testing, long-term stable operation in diverse water environments remains a significant challenge. Due to electrode polarization effects and changes in interfacial impedance, traditional electrochemical sensors often suffer from signal drift and decreased detection sensitivity over extended periods of operation. Furthermore, water pollutants typically exhibit low concentrations and the coexistence of multiple components, leading to significant cross-interference in electrochemical signals and reducing the reliability and accuracy of detection results. Summary of the Invention
[0004] The main purpose of the present invention is to provide a water quality detection method and device based on electrochemical sensors. The present invention realizes high-precision identification of low-concentration multi-component coexisting pollutants and realizes visual analysis of the spatial distribution characteristics and migration patterns of water pollutants.
[0005] To achieve the above object, the present invention provides a water quality detection method based on an electrochemical sensor, comprising the following steps:
[0006] Deploying a multi-depth electrochemical sensor array in a target water body at different water depths, and using an electrochemical signal dynamic threshold triggering algorithm to perform real-time monitoring on the multi-depth electrochemical sensor array to obtain electrochemical response signal data;
[0007] Performing electrochemical fingerprint feature recognition on the electrochemical response signal data to obtain electrochemical feature vectors of water sample pollutants at different water depths;
[0008] The electrochemical characteristic vectors of pollutants in water samples at different water depths were input into the hierarchical electrochemical transfer-attention network model for pollutant analysis, and the types and concentrations of heavy metal ions and organic pollutants in water samples at different water depths were obtained.
[0009] Kriging spatial interpolation and environmental factor correction are performed on the types and concentrations of heavy metal ions and organic pollutants in the water samples at different water depths to generate a three-dimensional pollutant distribution dynamic map of the target water body.
[0010] The present invention also provides a water quality detection device based on an electrochemical sensor, comprising:
[0011] A real-time monitoring module is used to deploy a multi-depth electrochemical sensor array in the target water body at different water depths, and use an electrochemical signal dynamic threshold trigger algorithm to monitor the multi-depth electrochemical sensor array in real time to obtain electrochemical response signal data;
[0012] a feature recognition module, configured to perform electrochemical fingerprint feature recognition on the electrochemical response signal data to obtain electrochemical feature vectors of water sample pollutants at different water depths;
[0013] The pollutant analysis module is used to input the electrochemical characteristic vectors of water pollutants at different water depths into the hierarchical electrochemical transfer-attention network model for pollutant analysis, thereby obtaining the types and concentrations of heavy metal ions and organic pollutants in water samples at different water depths;
[0014] A monitoring module is generated to perform Kriging spatial interpolation and environmental factor correction on the types and concentrations of heavy metal ions and organic pollutants in water samples at different water depths, and to generate a three-dimensional dynamic map of pollutant distribution in the target water body.
[0015] In summary, the technical solution provided by the present invention utilizes a multi-depth electrochemical sensor array combined with a dynamic threshold triggering algorithm for electrochemical signals to achieve simultaneous monitoring and on-demand sampling at different depths in water bodies. This avoids the electrode polarization effect caused by traditional fixed-time sampling, effectively solves the problem of signal drift during long-term operation, and ensures the stability of the detection system. By extracting pollutant-specific electrochemical fingerprints through multi-scale analysis, high-precision identification of low-concentration, multi-component coexisting pollutants is achieved, significantly reducing cross-interference, shortening detection time, and enabling the simultaneous detection of multiple heavy metal ions and organic pollutants. The redox peak attention mechanism introduced by the hierarchical electrochemical transfer-attention network model can automatically adjust attention weights and optimize the electrode reaction characteristics of different pollutants, significantly improving the detection sensitivity and accuracy of low-signal-to-noise ratio water samples. The electrode state transfer learning layer enables model migration from standard solutions to complex water samples, effectively solving the problem of electrochemical response drift caused by changes in ionic strength in water samples at different depths, and improving the reliability of detection results in complex environments. A three-dimensional dynamic map of pollutant distribution, constructed based on Kriging spatial interpolation and environmental factor correction technology, enables visual analysis of the spatial distribution characteristics and migration patterns of water pollutants. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a schematic diagram of the steps of a water quality detection method based on an electrochemical sensor in one embodiment of the present invention;
[0017] Figure 2 This is a structural block diagram of a water quality detection device based on an electrochemical sensor in one embodiment of the present invention.
[0018] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0020] Reference Figure 1 , this embodiment provides a water quality detection method based on an electrochemical sensor, comprising the following steps:
[0021] S1, deploying a multi-depth electrochemical sensor array in the target water body at different water depths, and using an electrochemical signal dynamic threshold triggering algorithm to monitor the multi-depth electrochemical sensor array in real time to obtain electrochemical response signal data;
[0022] Among them, a multi-layer sampling system with an adjustable depth structure is deployed in the target water body at different water depths. The system consists of a group of sampling units with fixed spacing. The water body is vertically distributed according to the set depth requirements and maintains long-term stable operation. Each sampling unit is designed as an independent sealed structure and is equipped with a fully functional electrochemical detection unit. The detection unit consists of a three-electrode system, including a working electrode modified with a composite material of carbon nanotubes and gold nanoparticles, a reference electrode with stable performance, and an auxiliary electrode. The above-mentioned composite material is prepared on the surface of the glassy carbon electrode by electrochemical deposition, which increases the number of active sites on the electrode while improving its sensitivity and selectivity for pollutant identification. Each detection unit also integrates auxiliary sensors such as temperature, pH, dissolved oxygen and conductivity for the simultaneous collection of water environmental factors, providing a reference basis for subsequent data interpretation, thereby forming a detection node with multi-dimensional perception capabilities. The multiple electrochemical detection units are connected to a central controller via waterproof, insulated wires. The central controller, controlled by an embedded processing unit, periodically issues signal acquisition commands to sampling units at each depth, acquiring raw electrode response data. This data includes the electrode's interfacial behavior under weak electrical perturbations, such as charge distribution, current response, and polarization state. Key interfacial parameters, including double-layer capacitance and interfacial resistance, are then extracted from the raw electrical signals. These parameters reflect the strength and stability of the interaction between the electrode surface and the solutes in the water sample. Simultaneously, the time series of interfacial parameters is analyzed to calculate the rate of change of the electrode capacitance. The intensity ratio of the oxidation peak to the residual current in the current signal is analyzed to determine the presence of suspected contaminant perturbations. During the dynamic determination phase, a dynamic threshold triggering algorithm for the electrochemical signal is invoked. By comprehensively analyzing the capacitance change trend and the current response intensity ratio, the algorithm determines whether the trigger conditions for entering the high-precision detection process are met. If the system detects that these criteria exceed the predetermined threshold, it automatically initiates the full electrochemical measurement sequence, which incorporates three classic detection techniques: differential pulse voltammetry, square wave voltammetry, and electrochemical impedance spectroscopy. Differential pulse voltammetry is used to obtain high-resolution current response curves, accurately identifying low-concentration heavy metal ions and their electrochemical characteristics. Square wave voltammetry enhances the time response of signals under electrode polarization conditions. Electrochemical impedance spectroscopy analyzes the electrode-solution interface through multi-frequency perturbations, revealing key information such as charge transfer, capacitance characteristics, and diffusion behavior. These three methods work together to generate electrochemical response signal data.
[0023] S2, performing electrochemical fingerprint feature recognition on the electrochemical response signal data to obtain electrochemical feature vectors of water sample pollutants at different water depths;
[0024] Specifically, a feature extraction process is constructed based on three types of original signal data: differential pulse voltammetry, square wave voltammetry, and electrochemical impedance spectroscopy. In the signal processing stage, the wavelet analysis method is used to perform multi-scale decomposition on various types of electrochemical data. By selecting wavelet basis functions with good local characteristics, the original signal is converted into a wavelet coefficient sequence of different frequency bands. Based on these coefficients, the noise components carried by the high-frequency part are identified and eliminated to obtain the noise-reduced differential pulse data, square wave current data, and impedance spectrum data. Peak extraction operations are performed on the differential pulse data and square wave current data. The second-order derivative zero point detection method is used to locate the significant redox peaks in the current response curve. The overlapping of adjacent peaks is further separated and processed by a mathematical model, so that the multiple peak signals that were originally difficult to identify due to interference can be presented independently. After the above processing, five key indicators are extracted for each effective redox peak, namely peak potential, peak current, half-peak width, peak asymmetry, and peak area obtained by current integration, forming a quantifiable and comparable redox feature data set. At the same time, the noise-reduced electrochemical impedance spectroscopy data are modeled and parameter fitted. By analyzing the response characteristics of the equivalent circuit model, the internal resistance in the solution, the equivalent capacitance of the electrode interface, the resistance in the charge transfer process, and the mass transfer impedance caused by the diffusion behavior are extracted to construct an impedance characteristic data set. These two data sets reflect the electrochemical characteristics of pollutants in water samples from the two dimensions of electron transfer process and interface reaction mechanism, respectively, and are highly complementary in the information dimension. Multi-parameter fusion processing is performed on the electrochemical redox characteristic data set and the impedance characteristic data set, and a unified feature vector structure is used for expression. Environmental factor data such as temperature, pH, dissolved oxygen and conductivity obtained from each sampling unit are introduced as important correction parameters affecting electrode behavior to participate in feature integration. A complete pollutant electrochemical feature vector corresponding to each water depth position is generated.
[0025] S3, input the electrochemical characteristic vectors of pollutants in water samples at different water depths into the hierarchical electrochemical transfer-attention network model for pollutant analysis, and obtain the types and concentrations of heavy metal ions and organic pollutants in water samples at different water depths;
[0026] It is important to note that the electrochemical feature vectors of pollutants in water samples at different depths are input into a hierarchical electrochemical transfer-attention network model. This model combines four deep structures: convolution, attention, transfer learning, and multi-scale temporal processing, forming a recognition system with high-dimensional representation capabilities and environmental adaptability. The first component of the model is a feature extraction network. Through multiple sets of one-dimensional convolutional layers, it sequentially extracts local response features and morphological change patterns contained in the input vector, forming a primary feature representation. This representation retains information such as the shape, amplitude, and variation trend of the electrode response, providing the basic recognition capabilities required to distinguish different types of pollutants. The primary feature representation is then input into the redox peak attention module. This module detects the peak position changes in the current response curve and identifies key signal points closely related to the redox process. Attention scores are assigned to these peaks based on their importance, allowing the model to automatically focus on peak regions with strong representativeness and high classification value in subsequent processing. The output is a set of attention-enhanced peak-specific features that enhance the sensitivity of pollutant identification. Peak-specific enhanced features are fed into the electrode state transfer learning layer, which consists of two independent but structurally consistent encoders. These encoders establish feature mappings between experimental standard solution samples (the source domain) and real-world complex water sample data (the target domain). By comparing the differences in feature distributions between the two domains and minimizing their statistical distance, the model achieves excellent cross-environmental generalization, ensuring stable feature output even under conditions with large fluctuations in temperature, conductivity, or pH, thereby forming a set of deep, environmentally adaptable features. Multiscale electrochemical kinetic features are extracted from these environmentally adaptable features. Multiple parallel convolutional structures capture features of fast-changing signals, moderate fluctuations, and slow trends, simulating the multi-stage kinetic behavior of real pollutants during electrode response, and outputting multiscale feature representations with information at different time scales. The multiscale kinetic feature representations are then fed into a hierarchical decision fusion module for feature processing. The classifier within this module outputs a probability distribution for the pollutant type. The model integrates the outputs of each channel, the results of the attention mechanism, and historical annotation information to determine the type of heavy metal ion or organic pollutant corresponding to the current input sample and its confidence probability. After completing the species identification, the module calls the quantitative regression network, inputting the probabilistic output of the pollutant species along with the aforementioned multi-scale features. Using a nonlinear mapping function, the concentration of each pollutant is estimated, completing both qualitative and quantitative assessments of pollutants in samples at the same depth, enabling hierarchical identification of pollution distribution across multiple depths of the water body. The model output includes the pollutant species and concentration levels in the water samples at each sampling depth.
[0027] The primary feature representation is fed into the redox peak attention module, a feature enhancement unit that focuses on local peak regions within the electrochemical response curve. It uses the gradient of the response data to identify and weight key peaks. After receiving the primary feature representation, the module calculates the first- and second-order derivatives of the input sequence on the potential axis. The first-order derivative reflects the rate of current change, while the second-order derivative reveals the inflection points of the trend, thereby locating the contours of each peak in the current curve. Based on this derivative information, a zero-point detection mechanism is implemented to determine the sign change of the first-order derivative and, combined with the extreme positions of the second-order derivative, identify all significant oxidation and reduction peaks in the current signal. Based on this, a set of redox peak positions is constructed. Peak characteristic parameters are extracted for each peak position in the redox peak position set, including peak potential, peak current, half-width at half maximum, peak symmetry, and peak area. These five parameters together constitute a multidimensional representation of each peak position, from which the system builds a peak position feature matrix. The peak position feature matrix is input into the attention calculation unit, which performs feature mapping on each set of peak parameters through a nonlinear transformation mechanism, including trainable transformation matrices and activation function operations. In this process, normalization and correlation modeling mechanisms are introduced to enhance the network's ability to perceive the differences in importance between different peak features, generating a set of attention weight coefficients to represent the relative significance of each peak position in the entire signal sequence. Based on the attention weight coefficients, the primary feature representation is weighted and integrated. That is, peak shape features with high attention scores are enhanced in the overall feature representation through weighted summation or channel enhancement, suppressing the interference caused by invalid or repeated information, and generating a set of peak-specific enhanced features with peak recognition sensitivity, pollutant response intensity significance, and physical parameter completeness.
[0028] The input peak-specific enhanced features are classified according to their source. Feature data from standard solutions under ideal experimental conditions are used as source domain data, while feature data from real-world complex water samples, particularly those with varying ionic strength, pH, conductivity, and temperature, are used as target domain data. This constructs a pair of training sample sets with different distributions. The source and target domain data are then fed into two different encoder modules in the electrode state transfer learning layer: the source encoder and the target encoder. These encoders, while structurally similar but with independent parameters, each perform a high-dimensional mapping of the original input features through a nonlinear transformation structure, yielding source and target domain encoded features. In this process, the model uses a combination of convolutional and fully connected layers to perform multi-level feature compression and abstraction on the peak-specific enhanced features, extracting deep semantic information that represents the electrode response behavior. The source domain encoded features reflect the electrode response patterns under standard conditions, while the target domain encoded features capture the response offsets under various uncertainties in real-world water samples. To achieve unified representation between the two feature spaces, the maximum mean difference loss (MMD) is introduced as a domain alignment metric. This loss function measures the statistical distribution differences between the encoded features in the source and target domains. The model compares the mean distributions of the two feature groups along each dimension and calculates a value reflecting the degree of their offset in the feature space. Gradient descent is used to jointly optimize the weight parameters in the source and target domain encoders. Through multiple rounds of iterative training, the maximum mean difference is continuously converged to a minimum, resulting in a stable domain-adaptive mapping function. This function shrinks the differences between features layer by layer, allowing the network to naturally develop domain-invariant representation capabilities during the learning process. Using this domain-adaptive mapping function, all input peak-specific enhancement features are uniformly transformed to extract electrode response compensation features that are immune to factors such as water sample ionic strength, pH changes, and conductivity perturbations. This feature effectively reduces response offsets caused by changes in water depth, environmental disturbances, or electrode microstructure, enhancing the stability of the feature representation for pollutant types and concentrations. The electrode state change compensation feature is deeply fused with the original peak-specific enhancement feature, and uniformly encoded through vector splicing, channel weighting or feature fusion modules to obtain the environmental adaptability feature.
[0029] S4 performs Kriging spatial interpolation and environmental factor correction on the types and concentrations of heavy metal ions and organic pollutants in water samples at different water depths to generate a three-dimensional dynamic map of pollutant distribution in the target water body.
[0030] Specifically, a spatial water pollutant dataset was established based on the types and concentrations of heavy metal ions and organic pollutants in water samples at different depths. The spatial distribution characteristics of the pollutant data were quantitatively analyzed. A variogram was constructed by calculating the semivariance between each pair of sampling points. This variogram reflects the correlation between pollutant concentrations and spatial distance. To accurately account for this spatial correlation, a spherical model was used to fit the experimental variogram. Three key parameters, the nugget effect, the sill value, and the range, were determined, respectively describing the unexplained spatial error in the samples, the maximum spatial correlation strength, and the range of spatial correlation. This led to a spatial distribution model appropriate for the current water pollutant distribution characteristics. Based on the spatial distribution model of the pollutants, a kriging equation system was constructed that accounted for vertical stratification. This process incorporated modeling logic for the vertical stratification effect to account for the heterogeneous distribution of pollutants across depth due to factors such as water density differences, hydrodynamic disturbances, or sedimentation behavior. By solving the kriging equation system with a vertical correction term, the system reasonably estimated pollutant concentrations at unknown locations between known data points and determined the weight coefficients corresponding to each spatial interpolation location. These weights are used to weight the sum of the data from surrounding sampling points to generate initial three-dimensional pollutant distribution data. Because electrochemical sensor responses are significantly coupled with environmental factors (such as temperature, pH, conductivity, and dissolved oxygen), the initial spatial distribution data is then subjected to environmental factor correction. This correction corrects pollutant concentrations based on the environmental monitoring data at each point, eliminating response deviations caused by sensor sensitivity variations under different conditions. This results in environmentally corrected pollutant distribution data. The environmentally corrected pollutant distribution data at multiple time points is then fused in time series, using an exponential weighting mechanism to smoothly fuse current and historical data, resulting in spatiotemporally continuous dynamic pollutant distribution data. Based on this spatiotemporally continuous dynamic pollutant distribution data, a three-dimensional pollutant distribution dynamic map is constructed. This map visualizes the pollution status of the target water body using a three-dimensional coordinate system, expressing pollutant concentration trends through color gradients. Dynamic frame updates are performed at a set time step, showing the diffusion, migration, and concentration changes of pollutants in different water layers and regions over time.
[0031] In one example, a multi-depth electrochemical sensor array is deployed in a target water body at different water depths. An electrochemical signal dynamic threshold triggering algorithm is used to monitor the multi-depth electrochemical sensor array in real time to obtain electrochemical response signal data, including:
[0032] Deploy multi-depth electrochemical sensor arrays in the target water body at different water depths;
[0033] Each sampling unit in the multi-depth electrochemical sensor array is equipped with a working electrode, a reference electrode, and an auxiliary electrode modified with a carbon nanotube / gold nanoparticle composite material, and integrated with temperature, pH, dissolved oxygen, and conductivity auxiliary sensors to form an electrochemical detection unit.
[0034] Connecting the electrochemical detection unit to the central controller and performing signal acquisition to obtain raw electrode response data;
[0035] The double-layer capacitance and interface resistance parameters of the electrode interface are measured based on the original electrode response data, and the electrode interface capacitance change rate and the ratio of the oxidation peak current to the residual current are calculated;
[0036] Adopting the dynamic threshold trigger algorithm of electrochemical signal, the dynamic threshold judgment is performed according to the change rate of electrode interface capacitance and the ratio of oxidation peak current to residual current to trigger the electrochemical measurement sequence;
[0037] The electrochemical measurement sequence is performed in three modes: differential pulse voltammetry, square wave voltammetry, and electrochemical impedance spectroscopy to obtain electrochemical response signal data.
[0038] In this example, a sensor array deployment strategy was developed based on the actual topography, hydrological structure, and stratification characteristics of the target water body. Multiple representative sampling depths were set vertically, covering key distribution areas from the surface to the bottom layer, enabling comprehensive sensing of spatial gradients in water quality. Based on this vertical deployment strategy, several electrochemical detection units were evenly spaced and mounted on a retractable main support. These units are mechanically independent and enclosed, preventing water mixing and signal contamination between different water layers, ensuring spatial independence and physical accuracy of vertical detection data. Each detection unit houses a three-electrode system: a working electrode, the primary reactant; a reference electrode, providing a stable reference potential; and an auxiliary electrode, maintaining loop current balance. The working electrode is surface-modified with a composite material composed of carbon nanotubes as a backbone and gold nanoparticles as functional additives. This material exhibits excellent electrical conductivity and chemical stability. By adjusting the composite ratio and electrochemical deposition parameters, the electrochemical response efficiency and selective recognition of trace heavy metal ions and organic pollutants in water are enhanced. These electrodes are fixed to a glassy carbon substrate and, after plasma treatment, form a secure connection to the detection unit housing. In order to enhance the ability to perceive and correct external environmental conditions, four auxiliary sensors, namely temperature, pH, dissolved oxygen and conductivity, are integrated into each electrochemical detection unit and work synchronously with the electrochemical signal acquisition system. All detection units are electrically connected to the central controller located on the shore or underwater platform via waterproof high-strength polytetrafluoroethylene insulated cables. The controller uses a microprocessor system based on the ARM Cortex-M4 architecture with a main frequency of 180MHz and is equipped with a high-precision 16-bit analog-to-digital conversion module to support real-time sampling and data packaging of electrical signals for each detection channel. During operation, the controller periodically reads the signal sent back by each sampling unit according to the set time step or trigger logic to obtain the original electrode response data, including basic electrochemical parameters such as potential, current, and impedance. In order to evaluate the electrode status and determine whether to enter the high-precision measurement process, the two core interface characteristic parameters of double-layer capacitance and interface resistance are extracted from the raw data. The dynamic trend of the capacitance change over time is obtained by scanning the high-frequency small-amplitude perturbation signal. At the same time, the ratio between the oxidation peak current and the background residual current is analyzed. These two indicators correspond to the quantitative expression of the change in electrode surface activity and the change in electrochemical signal intensity, respectively. After completing the above basic parameter extraction, these values are substituted into the electrochemical signal dynamic threshold trigger algorithm for judgment calculation. The algorithm uses the current capacitance change rate and current ratio to construct a dynamic threshold judgment function, and compares its output value with the set threshold in real time. When the judgment value exceeds the trigger condition, it is considered that the current water environment has an increased concentration of pollutants or a change in type, and enters the high-precision detection mode.At this point, the system automatically switches to the electrochemical measurement sequence, sequentially acquiring signals at the target sampling points using three test modes: differential pulse voltammetry, square wave voltammetry, and electrochemical impedance spectroscopy. Differential pulse voltammetry (DPV) acquires high-resolution redox current response characteristics, enabling trace analysis. Square wave voltammetry enhances the temporal resolution of the signal and can capture the multiple responses of complex mixed pollutants. Electrochemical impedance spectroscopy (EIS) uses multi-frequency scanning to establish an equivalent circuit model, reflecting the charge transfer, capacitive polarization, and diffusion impedance behavior of the electrode-solution interface at different frequency domains. These three test modes are executed continuously within the system according to preset parameters. After each measurement cycle, electrode regeneration procedures, such as positive and negative constant potential cleaning and static conditioning, are automatically incorporated to ensure consistently high electrode performance. Data from all three electrochemical measurement methods are fed into a central controller for signal labeling, time matching, correlation with environmental factors, and preliminary data denoising. The data is then stored in a compressed and encrypted format in a local cache module or uploaded to a remote monitoring platform via a communication interface.
[0039] In one example, electrochemical fingerprint feature recognition is performed on the electrochemical response signal data to obtain electrochemical feature vectors of water sample pollutants at different water depths, including:
[0040] Performing wavelet decomposition on the electrochemical response signal data to obtain wavelet coefficients of each electrochemical data, and filtering the electrochemical response signal data for high-frequency noise based on the wavelet coefficients to obtain noise-reduced differential pulse data, noise-reduced square wave data, and noise-reduced electrochemical impedance spectroscopy data;
[0041] The second-order derivative zero-point peak detection and overlapping peak separation are performed on the noise-reduced differential pulse data and the noise-reduced square wave data to obtain the characteristic redox peaks of pollutants in water samples at different water depths;
[0042] Extracting electrochemical redox characteristic data sets including peak potential, peak current, half-peak width, peak asymmetry and peak area from characteristic redox peaks;
[0043] Based on the de-noised electrochemical impedance spectroscopy data, solution resistance, electrode interface capacitance, charge transfer resistance, and diffusion impedance are extracted to construct an impedance feature dataset.
[0044] Multi-parameter fusion processing was performed on the electrochemical redox characteristic dataset and the impedance characteristic dataset, and feature integration was performed based on the temperature, pH, dissolved oxygen and conductivity environmental factor data of each depth sampling unit to obtain the electrochemical characteristic vectors of water sample pollutants at different water depths.
[0045] In this example, raw signals obtained from three electrochemical test modes—differential pulse voltammetry, square wave voltammetry, and electrochemical impedance spectroscopy—are input into a wavelet processing framework. Wavelet basis functions with good tight support and high-frequency local resolution are selected, and the appropriate decomposition level is set based on the signal characteristics. Through layer-by-layer filtering and downsampling, wavelet decomposition decomposes the raw signals into approximate coefficients and detail coefficients containing different frequency characteristics. The approximate coefficients preserve the main signal trend, while the detail coefficients capture hidden mutations and high-frequency perturbations. By analyzing the energy distribution of the detail coefficients at multiple scales, high-frequency components representing random perturbations or sensor electrical noise are identified. During the wavelet denoising process, a threshold function is applied to selectively suppress the detail coefficients at each level, removing nonsignificant high-frequency noise components from the signal while retaining the mid- and low-frequency electrochemical features directly related to the pollutant response. The resulting de-noised differential pulse voltammetry data, square wave current response data, and electrochemical impedance spectroscopy data are reconstructed. Based on the de-noised current signal data, the peak detection phase begins. Derivative analysis is performed simultaneously on the differential pulse and square wave voltammetry data. By calculating the trend of the first-order derivative and the extreme points of the second-order derivative, local peaks are located within the signal, enabling automatic identification of redox peaks in the electrochemical response curve. To address the overlap of multiple peaks, a peak separation module is invoked. A fitting curve is constructed using a mathematical model. By minimizing the fitting residual, the overlapping peaks are decoupled into multiple independent components. Each oxidation or reduction process can be clearly separated and independently modeled, resulting in characteristic redox peaks for pollutants in water samples at different depths. Response characteristics are extracted from these characteristic redox peaks, including peak potential (the potential at which the current reaches its maximum value, reflecting the kinetics of the pollutant oxidation or reduction process); peak current (representing the reaction intensity under specific conditions); half-peak width (FWHM), which characterizes the scalability and reaction rate distribution of the reaction process; peak asymmetry (measuring the waveform symmetry and mass transfer resistance of the reaction process along the potential axis); and peak area (an approximate integral of the charge transfer reaction, indirectly reflecting the pollutant concentration level). The above five parameters together constitute the electrochemical redox characteristic data set. At the same time, parallel analysis and processing are performed on the electrochemical impedance spectroscopy data. In the frequency domain analysis process, the denoised EIS data are fitted to the equivalent circuit model to extract a set of physically meaningful interface response parameters. These parameters include solution resistance, which reflects the electrolyte composition and conductivity of the water body itself; electrode interface capacitance, which represents the storage capacity of charge on the electrode surface; charge transfer resistance, which is used to evaluate the ease of electron transfer from the electrode surface to the pollutant molecules during the electrochemical reaction; and diffusion impedance, which reflects the obstruction of the mass transfer process caused by the concentration gradient at the interface. The above four indicators together constitute the impedance characteristic data set, and are used to supplement the interface process mechanism that the current response cannot express, thereby improving the integrity and discrimination ability of the pollutant characteristics.The electrochemical redox feature dataset and the impedance feature dataset are subjected to multi-parameter fusion processing. During the fusion process, the two types of features are uniformly mapped to the same expression space through standardization, normalization, and tensor splicing, and reorganized into a high-dimensional feature vector with a specific structure according to the input requirements of the pollutant identification model. The fused features are jointly modeled with the environmental factor parameters obtained synchronously from each deep sampling unit. The environmental parameters include water temperature, pH, dissolved oxygen content, and conductivity. As important modulation factors affecting the electrode response behavior and the electrochemical kinetic process of pollutants, they can significantly change the offset direction of the peak potential, the change ratio of the peak area, and the frequency dependence of the interface resistance. The environmental factors are embedded in the feature integration model in the form of vectors, and efficient calculation is achieved through multi-channel parallel processing units, and the electrochemical pollutant feature vector is finally output.
[0046] In one example, the electrochemical feature vectors of pollutants in water samples at different water depths were input into the hierarchical electrochemical transfer-attention network model for pollutant analysis. The types and concentrations of heavy metal ions and organic pollutants in water samples at different water depths were obtained, including:
[0047] The electrochemical feature vectors of pollutants in water samples at different water depths are input into the feature extraction network in the hierarchical electrochemical transfer-attention network model to perform multi-level feature extraction and obtain primary feature representation.
[0048] The primary feature representation is input into the redox peak attention module in the electrochemical transfer-attention network model, and the redox peak position in the electrochemical response is identified by the redox peak attention module, and the attention score of each peak position is calculated to obtain the peak-specific enhanced feature;
[0049] The peak-specific enhanced features are input into the electrode state transfer learning layer in the hierarchical electrochemical transfer-attention network model, and the environmental adaptability features are calculated through the source domain encoder and target domain encoder in the electrode state transfer learning layer;
[0050] Multi-scale electrochemical kinetic feature extraction is performed on the environmental adaptability characteristics to obtain a multi-scale kinetic feature representation. The multi-scale kinetic feature representation is then input into the hierarchical decision fusion module in the hierarchical electrochemical transfer-attention network model for feature processing to obtain the probability distribution of pollutant types.
[0051] Based on the probability distribution of pollutant types and the multi-scale dynamic characteristics, concentration estimation is performed through the quantitative regression network of the hierarchical decision fusion module to output the types and concentrations of heavy metal ions and organic pollutants in water samples at different water depths.
[0052] In this example, the electrochemical pollutant feature vector is input into the model's feature extraction network, which consists of a multi-level one-dimensional convolutional structure. Multiple convolution kernels are used to extract and reduce the response parameters of different channels and scales layer by layer. At each convolutional layer, local pattern information at different resolutions is extracted, preserving the local variation trends in the response curve, the potential region activity characteristics, and the initial structural expression of the multi-peak response. This transforms the original multidimensional vector representation into a high-dimensional, dense primary feature representation. This primary feature representation is then input into the model's redox peak attention module, which captures the peak information most relevant to pollutant identification from the overall electrochemical response. Within this module, the model calculates the first and second derivatives of the signal based on the potential distribution and locates any oxidation or reduction peaks through zero-point detection, constructing a set of candidate peak locations. For each candidate peak, the model extracts multidimensional structural features such as the local potential distribution, peak current, half-peak width, symmetry, and peak area, and constructs a peak feature matrix based on these features. The peak feature matrix is fed into the attention computation unit, where a nonlinear transformation and parameter matrix weight learning mechanism are introduced. A softmax normalization function is used to assign an attention score to each peak, representing its discriminative value. This mechanism ensures that the model dynamically focuses on the most representative peak regions, outputting a set of weighted peak-specific enhanced features. These peak-specific enhanced features are then fed into the model's electrode state transfer learning layer to eliminate the differences in electrochemical signal response between standard experimental conditions and real complex water samples. In this process, standard solution test data are used as source domain features, and complex environmental water samples are used as target domain features. The source and target domain encoders perform nonlinear encoding transformations on each data type, respectively, to extract their high-dimensional representation structures. To eliminate differences in feature distribution, the model introduces a maximum mean difference loss function and approaches consistency in feature space by minimizing the statistical distance between the source and target domain encoded features. Through iterative optimization, the encoder weights gradually converge to a set of parameters with cross-domain representation capabilities, thereby constructing a unified mapping function applicable to multiple environmental scenarios. On this basis, domain-invariant feature extraction is performed on all input peak features, and they are fused with the original features to generate deep expression features with environmental adaptability. The environmental adaptability features are input into the multi-scale electrochemical kinetic feature extraction module, in which the model uses a multi-channel parallel structure to perform time window sliding extraction and analysis on fast, medium and slow response processes. Convolution kernels of different sizes are set in each sub-channel to capture weak transient responses, typical voltammetric transition morphology and chronic impedance characteristics, respectively, to achieve full coverage of pollutant response behaviors at different time scales. The extracted multi-scale kinetic features are uniformly spliced and integrated into a multi-scale feature representation. The multi-scale kinetic feature representation is input into the hierarchical decision fusion module in the hierarchical electrochemical transfer-attention network model for feature processing.A classification subnetwork is used to discriminate multi-scale features, generate a probability distribution of pollutant types, and output the possible pollutant types and their confidence probabilities corresponding to each detection point. Based on the above discrimination results, a regression subnetwork is introduced to jointly input multi-scale dynamic characteristics and type probability distributions, and complete the continuous variable estimation of pollutant concentrations through a quantitative regression structure. This module combines nonlinear regression units with an error feedback mechanism, continuously optimizes prediction accuracy through layer-by-layer backpropagation, and suppresses overfitting through regularization terms. It outputs the concentration values of various heavy metal ions and organic pollutants corresponding to each water depth location, and pairs the type labels with the numerical results.
[0053] In one example, the primary feature representation is input into the redox peak attention module in the electrochemical transfer-attention network model. The redox peak attention module identifies the redox peak position in the electrochemical response and calculates the attention score of each peak position to obtain peak-specific enhanced features, including:
[0054] The primary feature representation is input into the redox peak attention module, and the first-order derivative and second-order derivative of the primary feature representation are calculated by the redox peak attention module;
[0055] performing zero point detection based on the first-order derivative and the second-order derivative and identifying all oxidation peaks and reduction peak positions to obtain a redox peak position set;
[0056] Extract peak characteristic parameters including peak potential, peak current, half-peak width, peak symmetry and peak area for each peak position in the redox peak position set, and construct a peak position characteristic matrix;
[0057] The peak position feature matrix is input into the attention calculation unit in the redox peak attention module, and nonlinear transformation is performed on each peak position feature to obtain the attention weight coefficient representing the relative importance of different redox peaks;
[0058] The primary feature representation is weighted according to the attention weight coefficient to obtain peak-specific enhanced features.
[0059] In this example, the primary feature representation is fed into the redox peak attention module. This feature is represented as a one- or two-dimensional tensor structure, arranged in order along the potential axis, preserving the amplitude variation pattern and local microstructural distribution of the electrochemical response signal. Based on this, the module calculates the first and second derivatives of the input sequence. The first-order derivative reflects the rate of change of the feature sequence in the potential direction, describing the trend of growth or decay of the current signal; the second-order derivative measures the curvature of the signal, i.e., the acceleration of change, and is used to identify local extreme points and inflection points. Points in the signal with a zero first-order derivative and a negative second-order derivative are identified as oxidation peaks, while points with a zero first-order derivative and a positive second-order derivative are identified as reduction peaks. The coordinates of all identified valid peak positions, arranged in order of potential, constitute a redox peak position set. This position set physically corresponds to active points in the water sample where electrochemical reactions occur, and is associated with the oxidation or reduction behavior of specific pollutants. Local features are extracted around each peak. Using a structural description method that includes parameters such as peak height, peak width, and symmetry, the raw response morphology is converted into a set of quantitative metrics that can be processed by the attention mechanism. The corresponding potential near each peak position is extracted, i.e., the potential corresponding to the peak current, as the peak potential, which indicates the location of the reaction's kinetic potential. The peak current, i.e., the current amplitude corresponding to the local extreme value, is extracted as a direct reflection of the reaction intensity. The peak half-peak width (HWHM), i.e., the distance between the left and right potentials at half the peak current, is measured to assess the diffusion and charge transfer characteristics of the reaction process. Peak shape symmetry is calculated, measured as the ratio of the left and right half-peak widths, which reflects the reversibility of the reaction and the uniformity of the interface. Peak area is extracted through numerical integration or fitting estimation, representing the total reaction charge per unit electrode area and indirectly reflecting the concentration of the pollutant at that peak position. These five parameters are combined to form a peak position feature vector, and a peak position feature matrix is constructed for all peak positions. This matrix, with peak positions as rows and feature parameters as columns, records the structural details of all local electrochemical responses. The peak position feature matrix is input into the attention calculation unit of the redox peak attention module. This unit is designed as a nonlinear mapping function composed of a set of trainable parameters. It uses matrix operations to transform the structural features of each peak position and enhances its distribution expression in the feature space through nonlinear activation functions such as tanh or ReLU. The model introduces a set of linear transformation weight matrices. Through weighted summation and connection to the softmax function, the feature representation of all peak positions is normalized and outputs a set of attention weight coefficients. The numerical values of these coefficients directly correspond to the relative importance of different peak positions in the pollutant discrimination task. The higher the attention score, the more representative the peak structure is in the identification. Based on the attention weight coefficients calculated above, the initial input primary feature representation is weighted.For each feature segment corresponding to the peak position in the original feature sequence, its intensity is re-weighted according to its attention score, highlighting the important peak response while suppressing invalid or redundant signals, forming a new set of weighted feature representations, namely peak-specific enhanced features.
[0060] In one example, the peak-specific enhanced features are input into the electrode state transfer learning layer in the hierarchical electrochemical transfer-attention network model, and the environment-adaptive features are calculated by the source domain encoder and the target domain encoder in the electrode state transfer learning layer, including:
[0061] The peak-specific enhanced features are divided into standard solution feature data and complex water sample feature data, and the standard solution feature data is used as the source domain data and the complex water sample feature data is used as the target domain data;
[0062] Perform nonlinear feature transformation on the source domain encoder in the electrode state transfer learning layer inputted into the source domain data to obtain source domain encoding features;
[0063] Performing nonlinear feature transformation on the target domain encoder in the target domain data input electrode state transfer learning layer to obtain target domain encoding features;
[0064] The maximum mean difference loss is calculated based on the source domain encoding features and the target domain encoding features, and the parameters of the source domain encoder and the target domain encoder are optimized by gradient descent to obtain the domain adaptation mapping function;
[0065] Domain-invariant feature extraction is performed on the peak-specific enhanced features based on the domain adaptation mapping function to eliminate the electrochemical response drift caused by the change of ionic strength in water samples at different water depths and obtain the electrode state change compensation feature;
[0066] The electrode state change compensation feature and the peak-specific enhancement feature are fused to obtain the environmental adaptability feature.
[0067] In this example, peak-specific enhanced features are divided into standard solution feature data and complex water sample feature data. The standard solution feature data, derived from electrochemical measurements under standard laboratory conditions, are considered source data due to their limited environmental interference, clear response curves, and stable peak structure, making them valuable for discriminative training. The complex water sample feature data, collected from natural water bodies, contaminated water samples, or mixed background samples, are considered target data. These complex water sample feature data exhibit electrode response offsets, reduced signal-to-noise ratios, and peak irregularities due to fluctuations in temperature, conductivity, and pH, as well as the coexistence of multiple ions. The source and target domain data are then fed into two parallel encoding substructures of the electrode state transfer learning layer, namely the source encoder and target encoder. These two encoders are symmetrical in their network structure, each consisting of several layers of nonlinear mapping units, such as multilayer perceptrons or convolutional mapping units with activation functions. However, their parameters are independent during the initial training phase, preserving the initial differences in the representations of the source and target domains. After the input data passes through their respective encoders, the source domain encoder outputs source domain encoded features, and the target domain encoder outputs target domain encoded features. These two constitute the representation of the standard sample and complex sample in the deep feature space, respectively. To achieve feature alignment between the source and target, the maximum mean difference (MMD) is introduced as a measure of cross-domain distribution similarity. MMD evaluates the statistical distribution consistency of the source and target domain encoded features by calculating the mean difference in feature space. If the means of two feature sets are exactly the same in high-dimensional space, they are approximately considered to come from the same distribution. Using this as the optimization objective, the system constructs a loss function. In each round of iterative training, the network parameters of the source and target domain encoders are synchronously updated using a backpropagation mechanism. Gradient descent is used to gradually minimize the mean difference loss, thereby causing the encoding representations of the two domains to converge in the feature space. This process forms a domain-adaptive mapping function: a set of transformation rules that can uniformly map any input peak feature across different sampling environments to a common feature space. This mapping function has significant cross-environmental adaptability. Domain-invariant feature extraction is performed on the peak-specific enhancement features based on the domain adaptation mapping function. This eliminates systematic drift in the electrode response caused by factors such as environmental changes, ionic strength differences, and water disturbances at the feature level, thereby obtaining an electrode state change compensation feature. This feature structurally maintains the spatial morphology of the original peak response, but is more stable in numerical distribution, exhibiting high robustness and low drift. The electrode state change compensation feature is fused with the original peak-specific enhancement feature, and environmental adaptability features are obtained through vector-level splicing, channel attention weighting, and convolution interaction integration.
[0068] In one example, Kriging spatial interpolation and environmental factor correction were performed on the types and concentrations of heavy metal ions and organic pollutants in water samples at different water depths to generate a three-dimensional dynamic map of pollutant distribution in the target water body, including:
[0069] A spatial water pollutant dataset was established based on the types and concentrations of heavy metal ions and organic pollutants in water samples at different water depths.
[0070] Based on the water body spatial pollutant dataset, the variogram calculation is performed, and the nugget effect, sill value and range parameter are determined by spherical model fitting to obtain the pollutant spatial distribution model.
[0071] Based on the spatial distribution model of pollutants, a Kriging equation system considering the vertical stratification effect is constructed, and the weight coefficient of each spatial position is determined by solving the Kriging equation system to obtain the initial spatial distribution data of pollutants;
[0072] Perform environmental factor correction on the initial pollutant spatial distribution data to obtain environmentally corrected pollutant distribution data, and perform spatiotemporal fusion on the environmentally corrected pollutant distribution data to obtain spatiotemporally continuous dynamic distribution data of pollutants;
[0073] A three-dimensional dynamic map of pollutant distribution in the target water body is created based on the spatiotemporal continuous dynamic distribution data of pollutants.
[0074] In this example, a spatial water pollutant dataset was constructed based on pollutant type and concentration information obtained at each sampling point by a multi-depth electrochemical detection system, combined with the spatial coordinate information of each detection unit in the water body, including horizontal position and vertical depth. This dataset records the three-dimensional spatial location of each sampling point and its corresponding pollutant attribute value in a structured format. Specifically, at each spatial point, several pollutant concentration values and their corresponding type labels were included. Based on this spatial pollutant dataset, quantitative modeling of pollutant concentration differences between sampling points at different locations was performed. The spatial autocorrelation structure of pollutants was assessed using a variogram calculation. Specifically, the spatial distances between all sampling points were grouped and the mean variance of concentration differences within the same distance group was calculated to construct an empirical variogram curve. The empirical variogram describes the statistical relationship between pollutant concentration and spatial distance. To ensure practical reasoning capabilities, a spherical model was used to fit the empirical variogram, and three key parameters were determined: the nugget effect, the sill, and the range. The nugget effect describes sudden changes or measurement errors within very short distances, the sill reflects the maximum spatial correlation strength, and the range indicates the distance boundary where spatial correlation breaks down. These three parameters jointly determine the spatial propagation patterns and stability of pollutants in the water body, thereby constructing a pollutant spatial distribution model. Based on the pollutant spatial distribution model, a set of Kriging equations is constructed that takes into account the vertical stratification effect. Traditional Kriging methods are used for two-dimensional surface interpolation. However, in water bodies, pollutant distribution exhibits a distinct stratified structure, influenced by factors such as water temperature stratification, density gradient, and sedimentation rate. Therefore, a vertical correction factor and a stratification covariance function are introduced to physically adapt the interpolation algorithm. Each interpolation point in the three-dimensional coordinate system is used as a prediction point. The Kriging covariance matrix is constructed based on the spatial distance, depth gradient, and covariance relationship between the point and all observation points. Lagrange multiplier constraints are introduced to form a complete set of equations. By solving this set of equations, the weight coefficients of each known observation point for the prediction point are obtained, and then a linear weighted estimate of the concentration value at the prediction point is achieved, resulting in initial pollutant distribution data covering the entire water body space. Environmental factor correction is performed on the initial pollutant spatial distribution data. Using environmental monitoring parameters such as temperature, pH, conductivity, and dissolved oxygen at each sampling point as correction benchmarks, a correction factor matrix is constructed using the pollutant response coefficients to these variables. Initial pollutant spatial distribution values are then proportionally adjusted through point-to-point correspondence or regional averaging to produce environmentally corrected pollutant distribution data. This correction process effectively compensates for the offset caused by variations in electrochemical response sensitivity under varying water conditions. To enable dynamic modeling of pollution diffusion and evolution, the spatial data after environmental correction is processed continuously in the time dimension.Using multi-moment pollutant distribution data obtained through continuous monitoring during the sampling period, a smooth evolution curve of pollutant concentration over time is established. The exponentially weighted moving average method is used to fuse the data from the current and previous moments to obtain a spatiotemporally continuous dynamic distribution of pollutants. Based on the spatiotemporally continuous pollutant data, all interpolated concentration values are mapped into a three-dimensional visualization model. Based on the Cartesian coordinate system consisting of the x, y, and z axes, the pollutant concentration value is filled in each spatial voxel. A color gradient is set according to the concentration level, gradually transitioning from low-concentration blue areas to high-concentration red areas. This generates a three-dimensional dynamic map of pollutant distribution with consistent color coding and clear information. This map is dynamically updated at a set time step. Each frame of the image shows the spatial migration status of pollutants throughout the water body at a specific moment. It is played continuously in a time series, providing an intuitive visualization of the pollutant diffusion process.
[0075] Reference Figure 2 This embodiment provides a water quality detection device based on an electrochemical sensor, comprising:
[0076] Real-time monitoring module 1 is used to deploy a multi-depth electrochemical sensor array in the target water body at different water depths, and use an electrochemical signal dynamic threshold trigger algorithm to perform real-time monitoring on the multi-depth electrochemical sensor array to obtain electrochemical response signal data;
[0077] Feature recognition module 2, used to perform electrochemical fingerprint feature recognition on the electrochemical response signal data to obtain electrochemical feature vectors of water sample pollutants at different water depths;
[0078] Pollutant analysis module 3 is used to input the electrochemical characteristic vectors of pollutants in water samples at different water depths into the hierarchical electrochemical transfer-attention network model for pollutant analysis, and obtain the types and concentrations of heavy metal ions and organic pollutants in water samples at different water depths;
[0079] Generate monitoring module 4, which is used to perform Kriging spatial interpolation and environmental factor correction on the types and concentrations of heavy metal ions and organic pollutants in water samples at different water depths, and generate a three-dimensional pollutant distribution dynamic map of the target water body.
[0080] In this embodiment, for the specific implementation of each unit in the above device embodiment, please refer to the above method embodiment, which will not be repeated here.
[0081] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, apparatus, article, or method comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, apparatus, article, or method. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, apparatus, article, or method comprising the element.
[0082] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A water quality detection method based on an electrochemical sensor, characterized in that: include: Deploying a multi-depth electrochemical sensor array in a target water body at different water depths, and using an electrochemical signal dynamic threshold triggering algorithm to perform real-time monitoring on the multi-depth electrochemical sensor array to obtain electrochemical response signal data; Performing electrochemical fingerprint feature recognition on the electrochemical response signal data to obtain electrochemical feature vectors of water sample pollutants at different water depths; The electrochemical characteristic vectors of pollutants in water samples at different water depths are respectively input into the hierarchical electrochemical transfer-attention network model for pollutant analysis to obtain the types and concentrations of heavy metal ions and organic pollutants in water samples at different water depths; specifically comprising: inputting the electrochemical characteristic vectors of pollutants in water samples at different water depths into the feature extraction network in the hierarchical electrochemical transfer-attention network model for multi-level feature extraction to obtain primary feature representation; inputting the primary feature representation into the redox peak attention module in the hierarchical electrochemical transfer-attention network model, and using the redox peak attention module to identify the redox peak position in the electrochemical response, calculate the attention score of each peak position, and obtain peak-specific enhanced features; the peak-specific enhanced features The electrode state transfer learning layer in the hierarchical electrochemical transfer-attention network model is input, and the environmental adaptability characteristics are calculated through the source domain encoder and the target domain encoder in the electrode state transfer learning layer; the environmental adaptability characteristics are subjected to multi-scale electrochemical kinetic feature extraction to obtain a multi-scale kinetic feature representation, and the multi-scale kinetic feature representation is input into the hierarchical decision fusion module in the hierarchical electrochemical transfer-attention network model for feature processing to obtain a probability distribution of pollutant types; based on the probability distribution of pollutant types and the multi-scale kinetic feature representation, the concentration is estimated through the quantitative regression network of the hierarchical decision fusion module, and the types and concentrations of heavy metal ions and organic pollutants in water samples at different water depths are output; Kriging spatial interpolation and environmental factor correction are performed on the types and concentrations of heavy metal ions and organic pollutants in the water samples at different water depths to generate a three-dimensional pollutant distribution dynamic map of the target water body.
2. The water quality detection method based on electrochemical sensor according to claim 1, characterized in that: The multi-depth electrochemical sensor array is deployed in the target water body at different water depths, and an electrochemical signal dynamic threshold triggering algorithm is used to monitor the multi-depth electrochemical sensor array in real time to obtain electrochemical response signal data, including: Deploy multi-depth electrochemical sensor arrays in the target water body at different water depths; A working electrode, a reference electrode, and an auxiliary electrode modified with a carbon nanotube / gold nanoparticle composite material are installed on each sampling unit in the multi-depth electrochemical sensor array, and auxiliary sensors for temperature, pH, dissolved oxygen, and conductivity are integrated to form an electrochemical detection unit; connecting the electrochemical detection unit to a central controller and performing signal acquisition to obtain raw electrode response data; Measuring the electrode interface double layer capacitance and interface resistance parameters based on the original electrode response data, and calculating the electrode interface capacitance change rate and the ratio of the oxidation peak current to the residual current; Adopting an electrochemical signal dynamic threshold triggering algorithm, performing dynamic threshold determination based on the electrode interface capacitance change rate and the ratio of the oxidation peak current to the residual current, and triggering an electrochemical measurement sequence; Three modes of measurement, namely differential pulse voltammetry, square wave voltammetry and electrochemical impedance spectroscopy, are performed on the electrochemical measurement sequence to obtain electrochemical response signal data.
3. The water quality detection method based on electrochemical sensor according to claim 1, characterized in that: The performing electrochemical fingerprint feature recognition on the electrochemical response signal data to obtain electrochemical feature vectors of water sample pollutants at different water depths includes: performing wavelet decomposition on the electrochemical response signal data to obtain wavelet coefficients of each electrochemical data, and performing high-frequency noise filtering on the electrochemical response signal data based on the wavelet coefficients to obtain noise-reduced differential pulse data, noise-reduced square wave data, and noise-reduced electrochemical impedance spectroscopy data; Performing second-order derivative zero-point peak detection and overlapping peak separation on the noise-reduced differential pulse data and the noise-reduced square wave data to obtain characteristic redox peaks of pollutants in water samples at different water depths; extracting an electrochemical redox characteristic data set including peak potential, peak current, half-peak width, peak asymmetry and peak area from the characteristic redox peak; Extracting solution resistance, electrode interface capacitance, charge transfer resistance, and diffusion impedance based on the noise-reduced electrochemical impedance spectroscopy data to construct an impedance feature dataset; The electrochemical redox characteristic dataset and the impedance characteristic dataset are subjected to multi-parameter fusion processing, and feature integration is performed in combination with the temperature, pH, dissolved oxygen and conductivity environmental factor data of each depth sampling unit to obtain the electrochemical characteristic vectors of water sample pollutants at different water depths.
4. The water quality detection method based on electrochemical sensor according to claim 1, characterized in that: The step of inputting the primary feature representation into the redox peak attention module in the hierarchical electrochemical transfer-attention network model, and identifying the redox peak position in the electrochemical response by the redox peak attention module, calculating the attention score of each peak position, and obtaining peak-specific enhanced features, comprises: Inputting the primary feature representation into the redox peak attention module, and calculating the first-order derivative and the second-order derivative of the primary feature representation by the redox peak attention module; performing zero point detection based on the first-order derivative and the second-order derivative and identifying all oxidation peaks and reduction peak positions to obtain a redox peak position set; Extracting peak characteristic parameters including peak potential, peak current, half-peak width, peak symmetry and peak area for each peak position in the redox peak position set, and constructing a peak position characteristic matrix; Inputting the peak position feature matrix into the attention calculation unit in the redox peak attention module, performing a nonlinear transformation on each peak position feature, and obtaining an attention weight coefficient representing the relative importance of different redox peaks; The primary feature representation is weighted according to the attention weight coefficient to obtain a peak-specific enhanced feature.
5. The water quality detection method based on electrochemical sensor according to claim 4, characterized in that: The step of inputting the peak-specific enhanced features into the electrode state transfer learning layer in the hierarchical electrochemical transfer-attention network model, and calculating the environmental adaptability features through the source domain encoder and the target domain encoder in the electrode state transfer learning layer, comprises: Dividing the peak-specific enhanced features into standard solution feature data and complex water sample feature data, and using the standard solution feature data as source domain data and the complex water sample feature data as target domain data; Performing nonlinear feature transformation on the source domain encoder input into the electrode state transfer learning layer to obtain source domain coding features; Performing nonlinear feature transformation on the target domain encoder input into the electrode state transfer learning layer to obtain target domain encoding features; Calculating the maximum mean difference loss based on the source domain encoding features and the target domain encoding features, and optimizing the parameters of the source domain encoder and the target domain encoder by gradient descent to obtain a domain adaptation mapping function; performing domain-invariant feature extraction on the peak-specific enhanced features according to the domain adaptation mapping function to eliminate electrochemical response drift caused by changes in ion intensity in water samples at different water depths, and obtaining electrode state change compensation features; The electrode state change compensation feature is fused with the peak-specific enhancement feature to obtain an environmental adaptability feature.
6. The water quality detection method based on electrochemical sensor according to claim 1, characterized in that: The method of performing Kriging spatial interpolation and environmental factor correction on the types and concentrations of heavy metal ions and organic pollutants in the water samples at different water depths to generate a three-dimensional pollutant distribution dynamic map of the target water body includes: Establishing a water body spatial pollutant dataset based on the types and concentrations of heavy metal ions and organic pollutants in water samples at different water depths; Calculating the variogram based on the water body spatial pollutant dataset and determining the nugget effect, sill value, and range parameter through spherical model fitting to obtain a pollutant spatial distribution model; Based on the pollutant spatial distribution model, a Kriging equation system considering the vertical stratification effect is constructed, and the weight coefficient of each spatial position is determined by solving the Kriging equation system to obtain the initial pollutant spatial distribution data; Performing environmental factor correction on the initial pollutant spatial distribution data to obtain environmentally corrected pollutant distribution data, and performing spatiotemporal fusion on the environmentally corrected pollutant distribution data to obtain spatiotemporally continuous dynamic distribution data of pollutants; A three-dimensional pollutant distribution dynamic map of the target water body is created based on the spatiotemporally continuous pollutant dynamic distribution data.
7. A water quality detection device based on an electrochemical sensor, characterized in that: The steps for implementing the water quality detection method based on an electrochemical sensor according to any one of claims 1 to 6, wherein the water quality detection device based on an electrochemical sensor comprises: A real-time monitoring module is used to deploy a multi-depth electrochemical sensor array in the target water body at different water depths, and to monitor the multi-depth electrochemical sensor array in real time using an electrochemical signal dynamic threshold triggering algorithm to obtain electrochemical response signal data; a feature recognition module, configured to perform electrochemical fingerprint feature recognition on the electrochemical response signal data to obtain electrochemical feature vectors of water sample pollutants at different water depths; The pollutant analysis module is used to input the electrochemical characteristic vectors of water sample pollutants at different water depths into the hierarchical electrochemical transfer-attention network model for pollutant analysis, thereby obtaining the types and concentrations of heavy metal ions and organic pollutants in water samples at different water depths; A monitoring module is generated to perform Kriging spatial interpolation and environmental factor correction on the types and concentrations of heavy metal ions and organic pollutants in water samples at different water depths, and to generate a three-dimensional dynamic map of pollutant distribution in the target water body.
Citation Information
Patent Citations
Electrochemical sensor applied to chromium ion detection
CN113189187A
Water pollution detection system based on electrochemical sensor
CN113466010A