Automated Analysis of Nano-Impact Single-Entity Electrochemistry Signals Using Unsupervised Machine Learning and Template Matching

Nano‐impact (NIE) (also referred to as collision) single‐entity electrochemistry is an emerging technique that enables electrochemical investigation of individual entities, ranging from metal nanoparticles to single cells and biomolecules. To obtain meaningful information from NIE experiments, analysis and feature extraction on large datasets are necessary. Herein, a method is developed for the automated analysis of NIE data based on unsupervised machine learning and template matching approaches. Template matching not only facilitates downstream processing of the NIE data but also provides a more accurate analysis of the NIE signal characteristics and variations that are difficult to discern with conventional data analysis techniques, such as the height threshold method. The developed algorithm enables fast automated processing of large experimental datasets recorded with different systems, requiring minimal human intervention and thereby eliminating human bias in data analysis. As a result, it improves the standardization of data processing and NIE signal interpretation across various experiments and applications.


Introduction
Nano-impact (NIE) or collision electrochemistry is a rapidly developing technique for measuring single entities. [1][4][5] A typical NIE experiment involves investigating entities that are freely moving in solution and colliding with an ultramicroelectrode held at a specific potential, allowing individual entities to be electrochemically detected by current transients during the collision.The current transients recorded during collisions are generated either due to a catalytic reaction occurring on the surface of the impacting entity, [2] electrolysis of the entity, [3] or due to blocking of the active electrode surface by an insulating entity. [6]The common characteristic of the responses, regardless of how the current signals are generated, is a low signal-to-noise ratio (SNR).Furthermore, to extract useful information, it is necessary to process a large number of current transients.
Two types of current responses are generally observed in NIE: staircase response and blip (spike) response. [7]The current staircase occurs when the colliding entity sticks to the electrode surface.In contrast, a current spike is recorded when the entity collides with the electrode and then leaves the electrode surface, or when it gets deactivated or electrolyzed at the electrode.Spike-like signals are desirable for studies of entities generating low current signals and are more common in NIE experiments. [8]At the same time, the analysis of spike signals is more complicated due to their irregular, asymmetric shapes and signal distortion by the measuring circuit.The most commonly used approach for analyzing NIE data is to use peakfinding functions provided by software such as Origin, [9] Igor, [10] or similar softwares. [11]The analysis usually includes several steps: baseline determination and subtraction, data smoothing, peak finding, and filtering to remove unwanted background noise, peak integration, and extraction of peak parameters.The most problematic steps in the algorithm are distinguishing signals from noise and determination of signal end points.Peak filtering is usually performed by setting up a height threshold value, [12] which in the case of the poor SNR scenario frequently observed in NIE experiments, can lead to spike losses or false positives, thus altering the interpretation of the data.Moreover, with the height threshold method, the data points at the beginning and end of the spike are generally missed, which leads to errors in spike area determination.For simple peak shapes, the beginning and end points can be recovered by assuming Gaussian or Lorenzian peak shapes. [13]However, for the complex and irregular spike shapes frequently seen in NIE, the commonly used peak finding and integration function must be manually monitored to prevent significant errors in the peak area determination, which can be time intensive for large datasets.Additionally, manual assistance can introduce selection bias at the peak filtering and peak-end-point-determination stages.
Only a few studies, to the best of our knowledge, have investigated alternative methods for extracting unbiased information, reducing errors, and minimizing manual intervention in the spike analysis of NIE experiments.Xu et al. applied an envelope algorithm to identify and integrate current spikes. [14]The authors used the Savitzky-Golay filter to baseline-corrected signals and generated an envelope for each current peak, which was used to estimate the area under the peak.Zhao and Zhou developed an algorithm for NIE data processing that focused on determining the peak-end points. [15]In this algorithm, any data points below the peak maximum and above the baseline were considered part of the spike regardless of the height threshold used, and spikes were integrated using a trapezoidal numerical equation within the identified boundaries.Gutierrez-Portocarrero et al. used the Fast Fourier transform (FFT) combined with Butterworth filters to denoise NIE data and improve the SNR. [16]Although these studies represent significant advances in feature extraction from NIE data, the development of a generalized algorithm that can automatically extract features across different NIE datasets remains an open problem.
Automated processing of complex spike-like signals embedded in noise has been widely studied and developed in other fields, such as nanopore analysis [12,17] and electroencephalography (EEG). [18]In addition to amplitude threshold methods, various machine learning (ML) approaches, including deep learning, are commonly used for peak feature extraction. [18,19]Thus, deep learning algorithms have been extensively used in the nanopore field for the detection [20] and classification of spike signals. [21,22]owever, due to variations in experimental setups and reaction mechanisms that generate NIE data, direct application of the reported feature extraction procedures to the NIE data is not always possible.A ML model trained on data from one experiment may not be suitable for data from another experiment.Furthermore, annotating the data for supervised ML that requires human experts to manually label or tag each data point with the correct corresponding output can be a labor-intensive process, involving complex decision-making and subjective judgments.
In this study, we utilize an unsupervised ML and a template matching-based approach previously reported for detecting and analyzing EEG signals [19] and modify it to suit the analysis of NIE data.The shapes of EEG spikes do not vary significantly, making it simpler to design a denoising filter and select a threshold for peak detection.In contrast, NIE data show significant variations in spike durations and shapes depending on the studied reactions, and even within the same experiment.To address these issues, we modify the reported algorithm on the signal denoising and template generation steps.The developed feature extraction procedure is applied for analysis of NIE data obtained from two different experiments: photoelectrocatalytic glucose oxidation on gold nanoparticles (AuNPs) and reduction of oxygen generated locally from hydrogen peroxide through the catalytic turnover of single catalase molecules (Scheme 1).These two datasets were chosen to showcase the versatility of the developed algorithm, highlighting its applicability across different systems, including "hard" nanoparticles and "soft" single enzyme molecules, covering both oxidative and reductive signals.Furthermore, we intentionally selected data challenging for analysis with the conventional methods: the signals associated with AuNPs exhibit irregular shapes, and those from enzymes have a low SNR.Our results demonstrate that the algorithm significantly enhances the accuracy of NIE data analysis compared to conventional methods and enables automated processing of large experimental datasets recorded with various systems, all with minimal human intervention.

Results and Discussion
The developed automated feature extraction procedure is composed of several steps, which are outlined in Scheme 2. These successive steps include 1) signal denoising, 2) removal of background trend, 3) initial spike sampling, 4) initial spike feature extraction, 5) automated spike grouping, 6) final spike extraction through template matching, and 7) final spike feature extraction.Each step of the procedure is elaborated in more detail in the subsequent sections.To develop and test the algorithm, we used sets of data from two vastly different experimental systems.In the first system, oxidative NIE spikes are generated by the electrooxidation of glucose on AuNPs illuminated with a 532 nm laser, which collide with a potentially biased carbon fiber microelectrode (Scheme 1A and Figure 1A). [23]In the second system, reductive NIE spikes are observed as a result of localized reduction of oxygen produced by catalytic turnover of single catalase molecules (Scheme 1B and Figure 1B). [24]1.Signal Denoising During NIE measurements, random electrical noise with frequencies and amplitudes similar to the NIE spikes can prevent the accurate extraction of signal features.Additionally, the noise cutoff frequencies will differ under different experimental setups.Moreover, it has been demonstrated that incorrect selection of the cutoff frequency results in signal distortion after filtering.[25] In general, the NIE signal is nonstationary, which makes commonly used frequency spectrum estimation techniques, such as discrete Fourier transform (FT), unsuitable (Note S3, Supporting Information).Therefore, to automate the accurate selection of the cutoff frequency for NIE data denoising, we performed time-frequency analysis using short-time Fourier transform (STFT) as the first step of the data analysis algorithm.The STFT is a simple and effective method for time-frequency spectrum estimation for nonstationary signals.The timefrequency spectrum is estimated by sliding a bell-shaped window across the time domain and taking the FT of each window.[26] This process decomposes the signal into its frequency components, resulting in a 2D histogram with time on the x-axis, frequency on the y-axis, and the transferred value for each corresponding time and frequency (unit in dB) on the z-axis (for further details, see Note S3, Supporting Information).Finally, the cutoff frequency was selected by thresholding the power from the estimated time-frequency spectrum by the MATLAB Filter Designer toolbox.After determining the cutoff frequency from STFT, we designed and applied a finite impulse response (FIR) low-pass filter to eliminate any noise above the cutoff frequency.Figure 1A,C shows the raw data and the time-frequency spectrum from the STFT analysis, respectively, of oxidative NIE spikes corresponding to glucose oxidation on AuNPs.Figure 1B, D similarly depict the raw data and the STFT analysis, respectively, of reductive NIE signals from catalase molecules.For comparison, Figure S2A,B, Supporting Information demonstrate conventional DFT analysis applied to the data in Figure 1A,B, respectively.As can be seen in Figure S2A,B, Supporting Information, the noise and signal bands in the DFT spectra overlap and cannot be differentiated because the DFT lacks specific information for time scale. In cntrast, by inspecting segments of the STFT spectra (as exemplified in Figure 1E,F for oxidative and reductive signals, respectively), the highest frequency for each signal peak can be determined.We further set the filter frequencies at 5 Hz above the average frequencies of spikes to cutoff high-frequency components.Figure 1G,H shows highlighted parts in Figure 1A,B for each NIE experiment after denoising, the cutoff frequencies of FIR filters are set as 10 and 15 Hz respectively, demonstrating that the high-frequency component noise is well removed.Scheme 2. Algorithm workflow.The raw NIE datas are de-noised to produces d and then processed to obtain the de-noised and offset datas do .Using the height threshold of 2σ derived from the offset blank data bo , the matrix P 1 , containing the peak location information is obtained.For each identified spike, the corresponding features are extracted and stored in the matrix F 1 .Through K-means clustering, the spike features are grouped to generate templates T 1 .Template matching is used to obtain the second location matrix P i , which for each spike i is described by the left spike end point (L loc ), the right spike end point (R loc ), and the spike peak point (P loc ), as demonstrated in the right top square.Using the P i , the corresponding feature matrix, F 2 , is extracted for each peak containing spike features shown in the right bottom square.

Background Trend Removal
NIE signals often have a background trend whose shape depends on the experimental setup that complicates spike identification and analysis (Figure 1A,B).A conventional approach for background correction is to subtract the baseline trend approximated by a polynomial function using linear regression from the raw data. [27]However, this method may not accurately capture the local trends in NIE data.Figure S3A,B, Supporting Information demonstrate the application of the conventional background correction method to our experimental data for glucose photoelectrooxidation on AuNPs and catalase NIE, respectively.Baseline trend lines created using a polynomial fit (see Note S4, Supporting Information) fail to capture the shape of the background and result in signal crossing.
Another alternative, which is commonly used for generating a baseline trend, is the moving average (MA) technique. [14]owever, the MA method does not distinguish between background and spike data points, resulting in a trend line that averages the signals and the background.Instead, we used a local weighted linear regression (rloess) algorithm. [28]This method slides a window along the signal and performs a polynomial linear regression in each window, assigning different weights to the data points based on their proximity to the center of the window (see Note S4, Supporting Information).Data points that are far from the center are considered outliers and given lower weights, resulting in a better and more robust fit to the background trend. [29]In other words, when fitting the background trend line, we treated the data points for each spike as outliers, so that the fitted trend line reflected less of the spike trend than the MA smoothing.By using a larger window size, we aimed to fit only the background trend without significantly affecting the signal peaks (Figure S3C, Supporting Information).Figure 2A,B demonstrates the ability to fit a satisfactory trend line to the data by applying separate window sizes of 600 and 100, respectively, to regress the background trend.It is important to note that the baseline correction may alter the peak shapes, as will be seen in the next step of the algorithm.Therefore, some of the key parameters (see Feature extraction section) were computed on the data without the background trend removed.

Initial Spike Sampling via the Conventional Height Threshold Method
Spike shapes can vary across different experimental setups or even within the same experiment, making it desirable to extract different shape information automatically.Initially, a conventional method of detecting spikes by setting a height threshold relative to the background signal was employed to generate templates. [30]Using chronoamperometry measurements under experimental conditions identical to those specified in Figure 1A,B but without corresponding entities, AuNPs (Figure S4A, Supporting Information) or catalase (Figure S4B, Supporting Information), the standard deviation of the background (σ) was calculated, assuming that it follows a Gaussian distribution.Any peaks that exceeded the 2σ height threshold (half Gaussian 95% confidence interval) were considered spikes. [30]To determine the spike interval, we located the left and right endpoints by identifying data points near zero.We found numerous points on both sides of the spikes that were in close proximity to zero.To select the endpoints of the spike, the algorithm first identifies the largest gap between these points in terms of current magnitude.It then pairs up each point within the gap with its sequential point.The algorithm further determines which pair contains the peak point positioned between the two endpoint points and creates a pair for each point by using the sequential point.The algorithm further identifies which pair contains the peak point situated between the two points in the pair.We defined these as the two sides of the NIE spike.Figure 2C,D shows examples of spikes identified in AuNPs and catalase NIE data, respectively, using the outlined height threshold method.It is clear that the conventional threshold method alone fails to correctly identify the end points of the spikes and misses some of the spikes.

Initial Spike Feature Extraction and Automated Spike Grouping
To automatically identify different spike-shape templates, we employed an unsupervised ML method called K-means clustering on the spike shapes extracted in the previous step.This involves grouping data points from the current spikes to create templates that can be used for more precise determination of the signal end points.For the spikes identified using the height threshold method, key features such as height, width, time range, etc. (see Note S5, Supporting Information) are extracted, normalized using z-score normalization, and converted into eight-dimensional data points.These data points are then grouped into clusters using the K-means algorithm, allowing detection of additional spikes missed with the conventional threshold method and restoration of the missing data points for the detected signals. [31]o select a suitable number of centroids for K-means clustering, we applied the elbow method (Note S6, Supporting Information). [31,32]In this method, the average sums of distances of each data point to its centroid for different numbers of centroids are calculated and plotted against the number of centroids.The number of centroids after which the distance no longer decreases rapidly is then selected as a suitable number for clustering.Figure S5A, Supporting Information, shows the elbow plot for the catalase NIE, where three centroids are chosen for data clustering.The number of clusters may be difficult to select using only the elbow method for more complex signals, such as those recorded with AuNPs (Figure S5B, Supporting Information).In such cases, the number of clusters can be determined by considering the Silhouette score. [33]This score determines whether a data point belongs in its cluster or if it should be in another.The score ranges from À1 to 1, and a more positive score indicates that it is less likely to be assigned to the nearest cluster, as shown in Figure S5C, Supporting Information.Based on the Silhouette score five centroids were chosen for AuNPs NIE data clustering.
To create raw templates, we aligned the current spikes in each cluster at the position of their maximum width (Note S7, Supporting Information).Zeros were added to the shorter spikes to make them equal in length to the widest spike.We then calculated the mean value of each column to obtain the raw templates, as shown in Figure 3A,B for AuNPs and catalase NIEs, respectively.Some raw templates may contain background noise that extends the matching interval or represent noise signals.The brown templates in Figure 3A,B were classified as noise in the template matching stage.These noise templates can be eliminated by selecting specific templates regarded as typical spikes occurring in the NIE data for template matching, as illustrated in Figure 3C,D.Thus, template generation not only facilitates the downstream processing of the NIE data but also provides a better understanding of the NIE signal characteristics and variations.

Final Spike Extraction by Template Matching
Template matching is a popular method used in signal and image processing to locate specific patterns (templates) in a signal or image by comparing their similarities. [34]In the context of NIE, our goal is to identify the spike response pattern (templates generated in the previous step) in the offset signal.To achieve this, we utilized the normalized cross-correlation (NCC) coefficient for template matching.The NCC is defined as [34] NCC ¼ cosðθÞ ¼ a Â b jajjbj ¼ where a is the template vector, b is the slice of the signal targeted to be matched, and cos (θ) is the cosine value between two vectors seen as the similarity in the NCC case.
The NCC coefficient is calculated by normalizing the template (vector a) and the signal (vector b) using z-score normalization.It ranges from À1 to 1 and indicates the cosine similarity between the two vectors.By sliding the template along the offset signal and comparing it with each segment of the signal, the location of the pattern can be determined.The resulting similarity curves show peaks where the left end point of the template matches the spikes in the signal (Figure S6 and Note S8, Supporting Information).The right end point of the spike is estimated by adding the length of the template to the starting point.The precise location of the end points is then determined by searching for the minimum (for oxidative spikes) or maximum (for reductive spikes) values between the approximate left and right points and the peak point.In addition, we used two numerical-threshold filters to eliminate any noise signals that might have high similarity to the templates.For this purpose, the standard deviation, height, and time interval ratio of each matched spike are compared to the numerical threshold filter multiplied by the corresponding values of the template.By default, we set the values of these two numerical filters to 0.35, but they can be adjusted in the algorithm.These filters not only bring the matched spans closer in shape (resulting in higher similarity) but also in numerical value.
Unlike the conventional height threshold method, template matching allowed us to precisely determine the two end points of the spike (Figure 2C,D vs Figure 4B,C).Some spikes were found to match multiple templates.For these spikes, the left and right sides matched by different templates were taken and the longest interval was used.This step is illustrated in Figure 4A where the interval matched by the first final template (shown in light brown) and by the second final template (shown in cyan) are merged into one interval (shown in red).

Final Spike Feature Extraction
After defining the end points of the signals through template matching, various features that characterize spike shapes can be extracted from the signals.We selected eight features that describe the shape of each spike (Scheme 2, bottom right square).A detailed description of how each feature is computed can be found in Note S9, Supporting Information.In addition to commonly used spike area, height, and duration, we included additional shape-related features that can facilitate the extraction of physical information from NIE data.It should be noted that four out of eight parameters (height, prominence, area, and prominence duration ratio) were computed from the denoised raw data without background subtraction, to obtain values that are closer to the raw signal.Additionally, we used the polyarea function in MATLAB instead of trapezoidal numerical integration for the area calculation, to avoid sign differences and zero-cross differences.Figure 5 provides a visual summary of the information extracted for catalase NIE data using the developed algorithm.The figure includes histograms for the area, height, and time duration of all analyzed spikes, as well as histograms for spikes corresponding to each identified template analyzed individually.

Method Validation
The reliability of the method is demonstrated by comparing spike features extracted using the developed algorithm with those extracted by commonly employed manual data processing, which served as the validation dataset.The signals obtained for glucose photoelectrooxidation on AuNPs were used for method validation due to their more complex shapes than catalase NIE. Figure S7, Supporting Information, shows the detailed comparison for each feature, where the correlation coefficient between values of the parameter extracted by the two methods is plotted.The comparison reveals that the features associated with the left end point and the peak point of the spikes (slope left, height, and prominence) are similar between the two methods.However, there are differences in features related to the right end point of the spikes, such as slope right, relative peak location, and time duration.Nevertheless, the differences in the area, one of the key features commonly extracted from NIE data for physical interpretation, are relatively low (R-squared 96.0%). [25]Moreover, it should be noted that manual selection can introduce bias affecting features extracted from manually selected current spikes.We further compared the developed algorithm with the conventional height-threshold method by analyzing the data in Origin using the peak analysis module.This analysis was performed as follows: 1) The signal was smoothed by the Savitzky-Golay filter with a window size of 70. 2) A 20-point background was manually set to remove the background trend.3) A height threshold was set based on the 3 times standard deviation of the offset blank signal value, resulting in a value of 0.3071 pA.4) The peak area was computed with the built-in integration function.The peak areas obtained using this conventional method were compared to the peak areas extracted using manual peak selection (cyan dots in Figure 6A).The same comparison for the developed algorithm is shown with pink dots in Figure 6B.The mean squared error (MSE) is significantly large (MSE conventional method: 0.21 vs MSE developed algorithm: 0.0029) and the correlation coefficient is significantly lower (R 2 conventional method: 44.6% vs R 2 developed algorithm: 92.1%) for the conventional method in comparison to the developed algorithm.The comparison indicates better matching between the data extracted with the developed algorithm and the validation dataset than between the data extracted with the conventional method and the validation dataset.Figure 6B demonstrates a comparison between spike intervals identified by origin (cyan rectangles) and spike intervals chosen by the algorithm (pink rectangles).As can be seen, several spikes are combined and identified as one by the origin algorithm, leading to a reduced number of total detected spikes and inaccuracy in the area evaluation.Although manual refinement can be used with the origin algorithm, it may introduce human bias and is time consuming.In contrast, the developed algorithm enables fast, automated analysis of the NIE data with minimal manual assistance, thus reducing selection bias.

Conclusions
In this work, we have introduced a workflow for the algorithmic analysis of spike-shaped NIE signals.The workflow leverages unsupervised ML and template-matching techniques to classify spikes into different types based on their shapes by generating templates.The templates reflect the distinctive features of each spike type and allow for the precise determination of end points for each current signal.This simplifies the extraction of meaningful information about the studied system and substantially improves the standardization of data processing and NIE signal interpretation across various experiments and applications as demonstrated by the glucose photoelectrooxidation on AuNPs and catalase NIE examples.
Additionally, the method can serve as a preprocessing step for training classification neural networks that can automate spike identification and aid in the development of NIE models.
The home-built CF-UME was prepared by placing the carbon fiber connected to a Cu wire inside a borosilicate capillary, followed by pulling the capillary in a Sutter Instrument P-1000 puller.The electrode tip was sealed overnight by dipping the pulled electrode in resin (EPO-TEK 301, Epoxy technology).Prior to use, the CF-UME was polished with 0.05 μm Al 2 O 3 powder on solid electrode hand polishing clothes (Gamry Instruments) and rinsed thoroughly with Mili-Q water.
Photoelectrocatalytic Glucose Oxidation on AuNPs: Experiments were performed in a three-electrode setup with the commercial CF-UME as  a working electrode, Pt wire as a counter electrode, and [Ag/AgCl, 1M KCl] as a reference electrode.The electrochemical cell was housed inside a grounded Faraday cage placed on an optical table.The electrode was illuminated by a laser placed at the bottom of the electrochemical cell.Signals were recorded using a Gamry Reference 600 potentiostat with a 10 ms sampling time and a cutoff frequency of 200 kHz.The measurements were performed at 0.3 V vs Ag/AgCl under 532 nm laser illumination (325 mW cm À2 ) in a 10 mM NaOH electrolyte containing 50 mM glucose and 5 pM dispersed AuNPs. [23]atalase NIE: Measurements were performed in a two-electrode setup using an in-house constructed CF-UME with a radius of 1.8 μm and Pt wire.The radius of the CF-UME was determined from limiting currents of 1 mM hexaammineruthenium chloride in 0.1 M KCl.Current signals were recorded using a Keithley 6430 preamp source meter operated through an in-house build python interface communicating by pyvisa package with an average sampling rate of 7 ms.Amperometry was performed in a deoxygenated 17 pM catalase solution in PBS buffer at pH 7.4 containing 10 mM H 2 O 2 with the potential applied to the CF-UME equivalent to À0.4 V vs Ag/AgCl.The catalase NIE data were resampled before data analysis (Note S1, Supporting Information).
Data Analysis: Algorithm was developed in MATLAB (Note S2, Supporting Information).The algorithm is available as an open source at https://github.com/ziwzh166/NIE_toolbox_shared.git.
Origin 2019 64-bit peak analyzer was used for data processing in the Method validation section of the manuscript.

Scheme 1 .
Scheme 1. Schematic representation of NIE experiments: A) Photoelectrocatalytic glucose oxidation on gold nanoparticles (AuNPs).When a single AuNP collides with the electrode surface irradiated with a green laser, glucose oxidation occurs on its surface, generating an oxidative current spike.B) Reduction of oxygen (ORR) generated locally by catalase.A single catalase molecule reacts with peroxide, generating oxygen, which then diffuses to the electrode and is reduced, generating a reductive spike.

Figure 1 .
Figure 1.A) Chronoamperometry traces recorded with a CF-UME in deoxygenated 10 mM NaOH, 50 mM glucose aqueous solution upon impacts of 5 pM AuNPs under illumination with 532 nm laser (325 mW cm À2 ).The CF-UME is biased at 0.3 V vs. Ag/AgCl.B) Chronoamperometry traces recorded with a CF-UME in a deoxygenated 10 mM H 2 O 2 , 1x PBS at pH 7.4 in the presence of 17 pM catalase.The CF-UME is biased vs ground earth at a potential corresponding to À0.4 V vs. Ag/AgCl.C,D) STFT spectrograms of the data shown in (A) and (B), respectively.E,F) Zoomed areas of the STFT spectrograms corresponding to the part of the data highlighted in (A) and (B), respectively.G,H) Selected representative spikes from highlighted data in (A) and (B), respectively, after denosing by the low-pass filter cutoff frequency according to the STFT analysis, the cutoff frequencies are set as 10 and 15 Hz.

Figure 2 .
Figure 2. A) Background fitting of the NIE data for glucose photoelectrooxidation on AuNPs.B) Background fitting of the catalase NIE data.The input data are shown in blue and the fitted background trend in orange.C,D) Spike interval selection using the height threshold method for data in (A,B), respectively.The background corrected signals are shown in blue and sampled intervals in orange.End points are not well defined and some spikes are missed.

Figure 3 .
Figure 3. A) Raw templates (RT) generated using K-means clustering on the sampled spikes obtained from the data for glucose photoelectrooxidation on AuNPs.B) Raw templates (RT) generated using K-means clustering on the sampled spikes obtained from catalase NIE data.C,D) The templates after removing templates identified as noise (NT) and tuning raw templates (denoted as final templates (FT)) shown in (A,B), respectively.

Figure 4 .
Figure 4. A) Scheme illustrating the process of merging matching outputs of different templates.B) Data for glucose photoelectrooxidation on AuNPs.C) Catalase NIE data.

Figure 5 .
Figure 5. Summary of the information extracted from catalase NIE data.In total, 143 spikes were detected, consisting of 89 FT1-type and 54 FT2-type spikes.

Figure 6 .
Figure 6.Method validation.A) Comparison between the standard height threshold method and the developed algorithm based on their matching to the validation dataset.B) Demonstration of spike intervals identified with the developed algorithm in comparison to the height-threshold method.