Potassium ion electrochemical detection method and system based on electric signal enhancement and key feature focusing technology
Through electrical signal enhancement and key feature focusing technology, the problems of poor signal repeatability and low detection accuracy of complex samples in electrochemical measurements are solved, and efficient and low-cost potassium ion concentration detection is achieved.
Patent Information
- Application Number
- CN202510241859.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-07-01
AI Technical Summary
Existing electrochemical measurement methods ignore key features in dynamic changes in complex samples, resulting in limited model performance, poor repetition of ISE signals, high cost and complex operation.
Through electrical signal enhancement and key feature focus technologies, including signal acquisition, data set enhancement, and key feature focus neural network, dedrift, time series decomposition and attention mechanisms are used to improve signal quality and form an efficient potassium ion concentration detection method.
It improves the repeatability and detection accuracy of electrode signals, reduces operational complexity, and improves the detection accuracy of the model in complex samples.
Smart Images

Figure CN120232960A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electrochemical detection, and particularly relates to a potassium ion electrochemical detection method and system through electro - signal enhancement and key feature focusing technology. Background Art
[0002] Traditional potassium ion measurement methods are mainly based on physical principles such as colorimetry, ion chromatography, and spectrophotometry. These methods perform excellently in terms of sensitivity and selectivity. However, these methods rely on expensive equipment and complex operation processes, which limit their wide use in practical applications. From the aspects of cost and operation complexity, these methods have significant limitations, especially in situations such as rapid assessment of soil nutrients or monitoring of patient electrolyte levels.
[0003] To overcome these problems, in recent years, electrochemical detection methods have received increasing attention due to their low cost and higher convenience. The ion - selective electrode (ISE), as the core component of electrochemical measurement, can generate a voltage signal related to the potassium ion concentration through a chemical reaction with potassium ions in the solution. However, the performance of ISE is affected by material characteristics and environmental factors, resulting in poor signal repeatability. Among them, the electrode drift phenomenon is one of the main limiting factors hindering the wide application of ISE.
[0004] In addition, traditional electrochemical measurement methods often only focus on the steady - state value of the signal and ignore the key features in the dynamic change process, which seriously limits the performance of the model. Especially in complex samples (such as serum or soil), the presence of other interfering ions may affect the measurement results. Summary of the Invention
[0005] The present invention aims to solve the problems in the prior art that electrochemical measurement methods often only focus on the steady - state value of the signal, ignore the key features in the dynamic change process, which seriously limits the performance of the model, especially in complex samples such as serum or soil, where the presence of other interfering ions affects the measurement results, and the measurement cost is expensive and the operation is relatively complex.
[0006] To solve the above - mentioned technical problems, the present invention is realized through the following technical solutions:
[0007] Solution 1: The present invention proposes a potassium ion electrochemical detection method through electro - signal enhancement and key feature focusing technology. The method includes the following steps:
[0008] Step 1: Detect the electrical signal in the signal acquisition device. Use an ion - selective electrode to detect potassium ion solutions with different concentrations one by one, and store the detected electrical signals to form an electrical signal data set.
[0009] Step 2: Enhance the electrical signal dataset stored in Step 1 to form a dataset that can support neural network training;
[0010] Step 3: Input the dataset that can support neural network training formed in Step 2 into the key feature focusing neural network to obtain the potassium ion concentration corresponding to the electrical signal.
[0011] Furthermore, a preferred implementation is provided. Step 1 further includes a step of preprocessing the electrical signal, and the preprocessing includes detrending, local average downsampling, and normalization.
[0012] Furthermore, a preferred implementation is provided. Step 1 further includes a step of calculating the steady-state deviation between the electrical signal and the reference signal, and using the steady-state deviation to correct the electrical signal measured each time.
[0013] Furthermore, a preferred implementation is provided. The method for enhancing the electrical signal dataset stored in Step 1 in Step 2 to form a data network learning dataset is as follows:
[0014] Perform time series decomposition on the electrical signal to obtain the trend term, seasonal term, and residual term of the electrical signal;
[0015] Perform linear interpolation on the trend term and seasonal term to obtain the updated trend term and seasonal term;
[0016] Discard the residual term obtained by time series decomposition, and generate a group of noises that conform to the normal distribution according to the length of the sequence as the final residual term;
[0017] Randomly combine the final trend term and seasonal term in a certain proportion and recombine them with the generated final residual term to obtain the generated signal, and the generated signals converge to form a data network learning dataset.
[0018] Furthermore, a preferred implementation is provided. The key feature focusing neural network in Step 3 is as follows:
[0019] The key feature focusing neural network is based on DNN, and an attention mechanism layer is added to DNN. The corresponding features of the key intervals in the signal are extracted through time series Shapelet, and the corresponding features of the key intervals are calculated, that is, the key feature focusing neural network is formed.
[0020] Furthermore, a preferred implementation is provided. The calculation of the corresponding features of the key intervals further includes a step of calculating the bias term of the key intervals.
[0021] Furthermore, a preferred implementation is provided. The method for calculating the bias term of the key intervals is as follows:
[0022]
[0023] is a value vector, d k is the number of features for each key vector.
[0024] Solution 2: A potassium ion electrochemical detection system through electro-signal enhancement and key feature focusing technology, the system comprising:
[0025] An electro-signal data set construction module, configured to detect the electro-signal in a signal acquisition device, and use an ion-selective electrode to detect different concentrations of potassium ion solutions one by one, and store the detected electro-signals to form an electro-signal data set;
[0026] An enhancement module, configured to enhance the electro-signal data set stored by the electro-signal data set construction module to form a data set that can support neural network training;
[0027] A key feature focusing neural network module, configured to input the data set that can support neural network training formed by the enhancement module into a key feature focusing neural network to obtain the potassium ion concentration corresponding to the electro-signal.
[0028] Solution 3: A computer device, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the processor runs the computer program stored in the memory, the processor executes the method described in any one of Solution 1.
[0029] Solution 4: A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method described in any one of Solution 1 are implemented.
[0030] The beneficial effects of the present invention are as follows:
[0031] For the potassium ion electrochemical detection method through electro-signal enhancement and key feature focusing technology described in the present invention, in electrochemical detection, the repeatability of the electrode signal is enhanced by a drift removal method, and the usability of the data set is improved by an electro-signal enhancement method. The key feature focusing neural network improves the utilization rate of signals during the learning process of the model, thereby improving the accuracy of potassium ion concentration detection.
[0032] The present invention is also applicable to fields such as rapid assessment of soil nutrients or monitoring of patient electrolyte levels. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a schematic flow chart of a potassium ion electrochemical detection method through electro-signal enhancement and key feature focusing technology described in Embodiment 1.
[0034] Figure 2Schematic diagram of the signal corresponding to the potassium ion solution with the same concentration after drift based on the removal of the electrode in Embodiment 11, with an error of 1.51% (0.0013V).
[0035] Figure 2 Among them, (a) is a comparison schematic diagram of the original detection signals of the potassium ion solution with a concentration of 50 ppm at different times, (b) is a comparison schematic diagram of the detection signals in Figure (a) after drift correction, (c) is a comparison schematic diagram of the detection signals of the potassium ion solution with the same concentration before drift removal at a concentration of 100 ppm at different times, (d) is a comparison schematic diagram of the detection signals in Figure (c) after drift correction, (e) is a comparison schematic diagram of the detection signals of the potassium ion solution with the same concentration before drift removal at a concentration of 500 ppm at different times, and (f) is a comparison schematic diagram of the detection signals in Figure (e) after drift correction.
[0036] Figure 3 Schematic diagram of the comparison of potassium ion concentration prediction under the generated signal and the true signal in Embodiment 11. Specific implementation mode
[0037] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments.
[0038] Embodiment 1. This embodiment proposes a potassium ion electrochemical detection method through electrical signal enhancement and key feature focusing technology. The method includes the following steps:
[0039] Step 1: Detect the electrical signals in the detection signal acquisition device, use an ion-selective electrode to detect different concentrations of potassium ion solutions one by one, and store the detected electrical signals to form an electrical signal data set.
[0040] Step 2: Enhance the electrical signal data set stored in Step 1 to form a data set that can support neural network training.
[0041] Step 3: Input the data set that can support neural network training formed in Step 2 into the key feature focusing neural network to obtain the potassium ion concentration corresponding to the electrical signal.
[0042] Embodiment 2. This embodiment further limits the potassium ion electrochemical detection method through electrical signal enhancement and key feature focusing technology described in Embodiment 1. Step 1 further includes a step of preprocessing the electrical signal, and the preprocessing includes drift removal, local average downsampling, and normalization.
[0043] Embodiment 3. This embodiment further limits a potassium ion electrochemical detection method through electro-signal enhancement and key feature focusing technology described in Embodiment 1. In step 1, it further includes the step of calculating the steady-state deviation between the electro-signal and the reference signal, and using the steady-state deviation to correct the electro-signal measured each time.
[0044] Embodiment 4. This embodiment further limits a potassium ion electrochemical detection method through electro-signal enhancement and key feature focusing technology described in Embodiment 1. The method for enhancing the electro-signal data set stored in step 1 in step 2 to form a data set that can support neural network training is as follows:
[0045] Perform time series decomposition on the electro-signal to obtain the trend term, seasonal term, and residual term of the electro-signal;
[0046] Perform linear interpolation processing on the trend term and seasonal term to obtain the updated trend term and seasonal term;
[0047] Discard the residual term obtained by time series decomposition, and generate a set of noise that conforms to the normal distribution according to the length of the sequence as the final residual term;
[0048] Randomly combine the final trend term and seasonal term, and then recombine them with the generated final residual term to obtain the generated signal. The generated signals converge to form a data network learning data set.
[0049] Embodiment 5. This embodiment further limits a potassium ion electrochemical detection method through electro-signal enhancement and key feature focusing technology described in Embodiment 1. The key feature focusing neural network in step 3 is as follows:
[0050] The key feature focusing neural network is based on DNN, and an attention mechanism layer is added to DNN. The corresponding features in the key interval of the signal are extracted through the shapelet extraction method of the time series, and the corresponding features of the key interval are calculated, thus forming the key feature focusing neural network.
[0051] Embodiment 6. This embodiment further limits a potassium ion electrochemical detection method through electro-signal enhancement and key feature focusing technology described in Embodiment 5. The calculation of the corresponding features in the key interval further includes the step of calculating the bias term of the key interval.
[0052] Embodiment 7. This embodiment further limits a potassium ion electrochemical detection method through electro-signal enhancement and key feature focusing technology described in Embodiment 6. The method for calculating the bias term of the key interval is as follows:
[0053]
[0054] Among them, α is the position of the key feature, β is the bias term, q is the query vector, k is the key vector, v is the value vector, and d k is the number of features of each key vector.
[0055] Embodiment 8. This embodiment proposes a potassium ion electrochemical detection system through electro-signal enhancement and key feature focusing technology. The system includes:
[0056] An electro-signal dataset construction module, which is used to detect the electro-signals in the signal acquisition device, use an ion-selective electrode to detect different concentrations of potassium ion solutions one by one, and store the detected electro-signals to form an electro-signal dataset;
[0057] An enhancement module, which is used to enhance the electro-signal dataset stored by the electro-signal dataset construction module to form a dataset that can support neural network training;
[0058] A key feature focusing neural network module, which is used to input the dataset that can support neural network training formed by the enhancement module into the key feature focusing neural network to obtain the potassium ion concentration corresponding to the electro-signal.
[0059] Embodiment 9. This embodiment proposes a computer device, which includes a memory and a processor. A computer program is stored in the memory. When the processor runs the computer program stored in the memory, the processor executes the method described in any one of Embodiments 1 to 7.
[0060] Embodiment 10. This embodiment proposes a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps of the method described in any one of Embodiments 1 to 7 are implemented.
[0061] Embodiment 11. This embodiment proposes an example, which is used to explain Embodiments 1 to 8 above. The specific example is as follows:
[0062] See Figures 1 to 3 To illustrate this embodiment, this embodiment specifically includes the following steps for signal acquisition and drift removal processing. Build a signal acquisition device with K-ISE as the core, and detect the electro-signal of K-ISE through a PLC device (Siemens S7-200). The PLC device is connected to the upper computer through PC / PPI. In the upper computer, the electro-signal of K-ISE is recorded and stored through Step7 software. Different concentrations of potassium ion solutions are detected one by one, and the detected signals are stored in the upper computer to form an electro-signal dataset.
[0063] This embodiment proposes a method for removing drift from electrical signals, which calibrates the electrical signals detected each time through a reference signal. In the electrical signal dataset, this method selects a standard solution with a specific concentration (such as 100 ppm) as a reference, calculates the steady-state deviation between the current signal and the reference signal, and uses this deviation to correct the voltage signal measured each time.
[0064] This embodiment proposes an electrical signal enhancement method based on time series decomposition and recombination for electrical signal enhancement. By decomposing the original signal into a time series, the trend term, seasonal term, and residual term of the original signal are obtained. First, linear interpolation is performed on the trend term and seasonal term to obtain new trend and seasonal terms. Second, the original residual term is discarded because the error is completely random and unpredictable. This embodiment generates a set of noises that conform to a normal distribution according to the length of the sequence as the new residual term. Finally, we recombine the new trend term, seasonal term, and residual term to obtain the generated signal. Each sample in the electrical signal dataset is processed according to this method to obtain different generated signals, increasing the number and diversity of samples in the dataset.
[0065] This embodiment proposes a key feature focused neural network for the key feature focused neural network. Each signal in the electrical signal dataset is downsampled by interval averaging, and the sampling result of each interval is used as a feature of the sample in the dataset for subsequent neural network training. This reduces the dimension of the features in the sample and improves the learning efficiency of the model. The key feature focused neural network is based on DNN, and an attention mechanism layer is added to the DNN. The key features in the signal are extracted through time series Shapelet and the corresponding features in the key intervals are recorded. In the attention mechanism layer, the Q and K corresponding to the positions of the key intervals are strengthened.
[0066]
[0067] In the attention mechanism, Q (Query), K (Key), V (Value), and dk (Dimension of Key) are key components, which are usually used to calculate the weighted representation of the input sequence. The following are their meanings:
[0068] Among them, Q (Query): The query vector represents the input feature at the current step or position. Q is used to compare with all keys to determine the importance of each key to the current query. K (Key): The key vector represents the features of each element in the input sequence. K is used to match with the query to calculate the attention weights. V (Value): The value vector corresponds one-to-one with the key and actually stores the information required according to the attention weights. When calculating the attention, the final output is the weighted sum of the values, and the weights are determined by the similarity between the query and the key. dk : Dimension of the key, representing the number of features of each key vector. d k It usually affects the process of calculating the attention score, especially when calculating the dot product. Its magnitude can also affect the distribution of attention. Usually in dot product attention, the dot product of Q and K is scaled to better control the propagation of the gradient.
[0069] Among them, α represents the position of the key feature, and (q, α) represents the position of the key feature in q, and the same for k. β represents the bias term, which is a clearer representation of the calculation process. The attention mechanism after modifying Q and K is equivalent to adding a bias term related to the position of the key feature compared to the original version, denoted as β.
[0070] This embodiment adds a bias term equivalent to the key interval in the calculation of the attention score, thereby increasing the attention weight. It makes the model pay more attention to the key features in the signal, improving the learning efficiency and prediction accuracy of the model.
[0071]
[0072] The specific implementation process is as follows:
[0073] See Figure 2 As shown, after removing the drift of the electrode, the signals corresponding to the potassium ion solution of the same concentration at different times have an error of 1.51% (0.0013V).
[0074] Figure 3 As shown in, after the electrical signal is enhanced, on the enhanced dataset, the MAPE of the model's prediction of potassium ion concentration is increased by 16.92% (taking DNN as an example), and the generated signal is indistinguishable from the true signal.
[0075]
[0076]
[0077] Among them, CNN is the key feature focused neural network described in this embodiment, DNN is the deep neural network, LR is the logistic regression model, SVR is the support vector machine for regression problems, and RF is the random forest method.
[0078] Detect potassium ion solutions of different concentrations in an indoor environment, and compare the accuracy of this method with commercially available products based on physical methods. The specific steps include the following
[0079] Step 1: Prepare potassium ion standard solutions with different concentrations and a certain concentration gradient. In an indoor environment, take 20 ml of each concentration into a beaker.
[0080] Step 2: Insert the K-ISE under the inspection device into the potassium ion standard solution in the beaker.
[0081] Step 3: Time for 10 minutes and record the K-ISE electrical signal through the host computer.
[0082] Step 4: The recorded electrical signal is preprocessed through steps such as detrending, local average downsampling, and normalization.
[0083] Step 5: The preprocessed signal is input into the 'Key Feature Focusing Neural Network' to obtain the potassium ion concentration corresponding to the signal.
[0084] MAPE is still used as the evaluation index, and the actual detection and comparison results are shown in the following table (DNN is the Baseline in the current research status):
[0085]
[0086]
[0087] In summary, it can be known that the MAPE of the electrochemical detection method described in this embodiment for potassium ion concentration prediction is 0.88%. In electrochemical detection, the detrending method enhances the repeatability of the electrode signal, and the electrical signal enhancement method improves the usability of the dataset. The key feature focusing neural network improves the utilization rate of the signal during the learning process of the model, thereby improving the accuracy of potassium ion concentration detection.
[0088] Those skilled in the art can understand that the above are only the preferred embodiments of the present invention. The features described in various embodiments and / or claims of the present disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in the present disclosure. It is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
[0089] Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications to these embodiments once they know the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present invention. Obviously, those skilled in the art can make various changes and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.
Claims
1. A method for electrochemical detection of potassium ions by electrical signal enhancement and key feature focusing technology, characterized in that: The method comprises the following steps: Step 1, detecting the electrical signal in the signal acquisition device, using an ion selective electrode to detect potassium ion solutions of different concentrations one by one, and storing the detected electrical signals to form an electrical signal data set; Step 2: enhancing the electrical signal data set stored in step 1 to form a data set that can support neural network training; Step 3: Input the data set that can support neural network training formed in step 2 into the key feature focusing neural network to obtain the potassium ion concentration corresponding to the electrical signal.
2. The method for electrochemical detection of potassium ions by electrical signal enhancement and key feature focusing technology according to claim 1, characterized in that: Step 1 also includes the step of preprocessing the electrical signal, and the preprocessing includes drift removal, local average downsampling, and normalization.
3. The method for electrochemical detection of potassium ions by electrical signal enhancement and key feature focusing technology according to claim 1, characterized in that: Step 1 also includes the step of calculating the steady-state deviation between the electrical signal and the reference signal, and using the steady-state deviation to correct the electrical signal measured each time.
4. The method for electrochemical detection of potassium ions by electrical signal enhancement and key feature focusing technology according to claim 1, characterized in that: In step 2, the method for enhancing the electrical signal data set stored in step 1 to form a data set that can support neural network training is: Decompose the electrical signal into time series to obtain the trend term, seasonal term and residual term of the electrical signal; Perform linear interpolation processing on trend items and seasonal items to obtain updated trend items and seasonal items; Discard the residual term obtained by time series decomposition, and generate a set of noises that conform to the normal distribution according to the length of the sequence as the final residual term; The final trend term and seasonal term are randomly combined in proportion and then recombined with the generated final residual term to obtain the generated signal, which is aggregated to form a data network learning data set.
5. The method for electrochemical detection of potassium ions by electrical signal enhancement and key feature focusing technology according to claim 1, characterized in that: The key feature focusing neural network described in step 3 is: The key feature focusing neural network is based on DNN, and an attention mechanism layer is added to DNN. The corresponding features of the key intervals in the signal are extracted through the time series Shapelet, and the corresponding features of the key intervals are calculated, thereby forming a key feature focusing neural network.
6. The method for electrochemical detection of potassium ions by electrical signal enhancement and key feature focusing technology according to claim 5, characterized in that: The step of calculating the corresponding features of the key interval also includes calculating an offset term of the key interval.
7. The method for electrochemical detection of potassium ions by electrical signal enhancement and key feature focusing technology according to claim 6, characterized in that: The method for calculating the offset term of the critical interval is: Among them, α is the position of the key feature, β is the bias term, q is the query vector, k is the key vector, v is the value vector, and d k The number of features for each key vector.
8. A potassium ion electrochemical detection system using electrical signal enhancement and key feature focusing technology, characterized in that: The system comprises: An electrical signal data set building module is used to detect electrical signals in a signal acquisition device, and uses an ion selective electrode method to detect potassium ion solutions of different concentrations one by one, and stores the detected electrical signals to form an electrical signal data set; An enhancement module, used to enhance the electric signal data set stored in the electric signal data set construction module to form a data set that can support neural network training; The key feature focused neural network module is used to input the data set that can support neural network training formed by the enhancement module into the key feature focused neural network to obtain the potassium ion concentration corresponding to the electrical signal.
9. A computer device comprising a memory and a processor, characterized in that A computer program is stored in the memory. When the processor runs the computer program stored in the memory, the processor executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.