1. Introduction
Heavy-metal ions (HMIs) are highly toxic and have a detrimental impact on ecosystems and human health [
1]; hence, detecting the content of HMIs in the environment is an important research hotspot. However, heavy-metal ion detection is generally performed in the laboratory, which requires immovable instruments. In order to better detect heavy-metal ions in the environment, we are eager to explore a convenient and automatic heavy-metal ion detection method. For that goal, there is a need for not only a portable detection instrument but also an automated data-processing method.
Heavy-metal ion detection is generally divided into two steps; the first is electrochemical sampling using sensors, and the second is the processing of the sampled data. Researchers have been fruitful in sampling HMI data. In the electrochemical sampling phase, the data are generally sampled by using a three-electrode potentiostat [
2]. The concentration of a substance can be calculated from the relationship between the current signal received by the three-electrode potentiostat and the concentration of the substance being measured. Liao et al. [
3] used a potentiostat to detect heavy-metal ions Pb(II) in water. Currently, portable potentiostats are increasingly being used for the measurement of various substances [
4]. Anila et al. [
5] used a portable potentiostat to detect ferricyanide. Nemiroski et al. [
6] used a portable potentiostat to detect glucose in the blood, sodium in the urine, heavy-metal solutions, and malaria antigens. The portable potentiostat facilitates electrochemical sampling [
7]. Most of the aforementioned studies have optimized the electrochemical sampling methods [
8,
9] and have made the sampling instrument miniaturized. However, there has been little research into automated data processing. Generally, portable potentiostats require traditional time-consuming manual analysis after measuring the data. Therefore, we are eager to explore an automated electrochemical measurement method that can be ported to the portable potentiostat to simplify the detection.
In the heavy-metal ion detection field, most studies use conventional data-processing methods. Conventional data-processing methods usually use square-wave voltammetry to perform polarimetric analysis of heavy-metal solutions [
10]. The polarimetric analysis is a method that relies on the characteristics of the redox peaks of different ions to determine the species and concentration of the ions. The half-wave potentials of different ions usually vary, and the concentration of the same ion is linearly related to the peak height, which is the basis for the qualitative and quantitative analysis of the polar spectrum. By measuring the peak height of the standard solution at different concentrations, a standard curve can be plotted for the ion. Routinely, the type of ion can be predicted by comparing the half-wave potential of the measured solution to that of the standard solution. The concentration of the solution to be predicted can be obtained by comparing the standard curve fitted to the standard solution to the actual measured peak height [
8]. Polar spectral analysis has achieved good results in heavy-metal detection; however, data-processing methods require manual comparisons to identify the data obtained from the measurements. Traditional manual identification needs to be improved because it is time-consuming and inefficient. Therefore, it is of great practical importance to study an efficient data-processing method for the detection of HMI.
Deep learning is an automated approach to data processing, which has achieved high success in many areas [
11]. Due to its excellent performance, the deep learning-based approach has also been applied to data processing in electrochemical analysis. Gabrieli et al. [
12] used principal component analysis (PCA) to analyze the concentration of metal cations in quantitative aqueous mixtures. They empirically extracted five discrete quantities from the electrochemical data and used PCA to analyze and identify these discrete quantities. However, the complex feature extraction method made the quantitative analysis process very cumbersome. Lavrentev et al. [
13] used a multilayer perceptron model [
14,
15] to detect bacterial concentrations in culture media or dairy products and obtained an accuracy of 94%. For the same hydrogel, they used the current–voltage data at five different scanning parameters as a database. This means that the actual measurement also requires five tests for the same hydrogel, which takes about 15 min to detect. Their work reduces the traditional 3 days of measurement time to 15 min, which is undoubtedly a huge improvement. However, these simple models did not fully satisfy the need for accuracy.
A convolutional neural network is a deep feed-forward neural network with features such as local connectivity and weight sharing. As one of the most important networks in the field of deep learning, it has been widely used. In the field of computer vision, LeNet-5 was successfully applied to handwritten digit recognition [
16], and AlexNet was successfully applied to face recognition [
17]. AlexNet was used in medicine for human brain detection [
18], alcoholism recognition [
19], and diabetic retinal image classification [
20]. In the field of taste recognition, convolutional neural networks (CNNs) based on electronic tongues and electronic noses have achieved great success [
21]. Zhong et al. [
22] achieved 99.99% accuracy in classifying tea products. In the field of gas detection, Wei et al. [
23] achieved three single-gas classifications with 98.67% accuracy using an improved LeNet-5, and Han et al. [
24] obtained 96.87% accuracy using LeNet-5 for mixed-gas identification. Guo et al. [
25] proposed a deep learning model combining random forests, convolutional neural networks, and gated cyclic control units to predict atmospheric PM concentrations. Their model uses CNN for feature extraction and dimensionality reduction and achieves good results. In the field of electrochemical analysis, Dean et al. [
26] achieved the highest sensitivity and specificity with neural networks based on LSTM and FCN. Their research demonstrates that various deep learning schemes can be used well for the classification of CSWV data. These studies showed great promise for the application of convolutional neural networks in the field of electrochemical detection. However, while these studies provide an automated approach to data processing, they do not simultaneously predict the species and concentration of the analyte to be measured.
Typically, convolutional neural networks have a large number of parameters, require large computational power, and are generally deployed on CPU/GPU platforms with powerful arithmetic. However, CPU/GPU platforms have large sizes, high energy consumption, and are not suitable for portable application scenarios. The Jetson Nano is Nvidia’s embedded hardware platform designed for small AI edge computing devices. The Jetson Nano has a smaller size and lower power consumption and offers more computing power than typically embedded platforms [
27]. A variety of deep learning-based network models have been successfully deployed on the Jetson Nano platform, and satisfactory performance has been achieved [
28]. The approach of deploying convolutional neural networks on embedded development platforms can further automate measurements.
Based on the problems above, the paper proposed a CNN-based method for the detection of heavy-metal ions (HMI). It can efficiently detect the ion species and concentration in heavy-metal solutions. Firstly, a portable potentiostat was designed for the convenient sampling of HMI data. Secondly, a CNN-based heavy-metal ion detection network was designed for processing the data, which we called HMID-NET. The backbone of HMID-NET involves six convolutional layers and two pooling layers, aimed at extracting features, followed by two prediction branches to predict the ion type and ion concentration. To our knowledge, HMID-NET has achieved the first simultaneous prediction of the type and concentration of heavy-metal ions. To train the network, we performed preprocessing operations and data expansion on the electrochemical data obtained from the measurements to create a heavy-metal ion solution dataset containing 1200 data samples. Then, we deployed the inspection network onto the Jetson Nano platform. Together with the potentiostat, it formed a portable HMI inspection unit that greatly enhanced the convenience of the instrument. Finally, we performed tests on 12 standard solutions. The test results demonstrated that the CNN-based HMI detection method proposed in this paper has comparable advantages over the comparison methods.
2. HMI Detection Method
The HMI detection method proposed in this paper consists of a sampling module and a control module, as shown in
Figure 1. The sampling module consists of an electrochemical potentiostat and screen-printed electrodes (SPEs) [
29,
30]. The sampling module uses the screen-printed electrode as a sensor to sample the solution to be measured and obtain the voltage current data. The control module is responsible for issuing the sampling parameters, receiving the data measured by the sampling module, and processing the sampling data to obtain the ion type and concentration. The control module uses the Jetson Nano embedded platform on which the =HMID-NET algorithm is deployed.
To make it more user-friendly, we added some small functional hardware to our device, such as power, a display screen, and a network card. The devices that need to be powered are the Jetson Nano and the potentiostat. The Jetson Nano is powered by a mobile power supply. The potentiostat consumes less power and can be either plugged into the Jetson Nano or plugged into a mobile power supply. In addition, a touch display, network card, mobile keyboard, and mobile mouse (optional) can be connected to the Jetson Nano side. This allows for easy data visibility, remote data access, etc.
The detection process includes the following steps. First, connect the wires between the devices and between the device and the power supply. The power supply and the Jetson Nano are connected by a USB, the Jetson Nano and the potentiostat are connected by a DuPont wire, and the sensor and the potentiostat are connected by a three-electrode interface. Second, drop the solution onto the sensor. The Jetson Nano then sends an acquisition signal to the potentiostat. Finally, after the potentiostat has collected the data, they are transmitted back to the Jetson Nano for the HMI type and concentration prediction. The Jetson Nano displays the predictions on the display.
2.1. Sampling Module
The sampling module consists of a commercially available screen-printed electrode sensor external to the three-electrode potentiostat, as shown in
Figure 2. The three-electrode potentiostat measures the solution according to the mode and parameters (e.g., the scanning speed, scanning mode, number of cycles, etc.) from the control module. It can perform the most commonly used square-wave voltammetry [
31]. The parameters of the SWV include Init, Final, Increase, Amplitude, and Frequency, where Init represents the initial potential, Final represents the endpoint potential, and Incr represents the potential increment.
The three-electrode potentiostat has a form factor of 1.2 × 0.8 inches. It uses an STM32L432-KBUx embedded microprocessor as the main control chip, an LDO3.3V regulator to provide the operating current, and an external 8 MHZ crystal oscillator. The two precision op-amps integrated by the AD8606 amplifier form the potentiostat circuit and the microcurrent detection circuit, respectively. The voltages of the WE and RE electrodes are controlled by a dual-channel 12-bit DAC in the main control. The three-electrode potentiostat is connected to the screen-printed electrodes via an electrochemical electrode interface. The data collected by the screen-printed electrodes are converted to analog-to-digital by the chip’s built-in ADC. Data communication between the three-electrode potentiostat and the control module is via a serial port.
In this study, the solution was sampled by square-wave voltammetry during the test. In order to run a potential scan, the scan was defined as a sequence of well-timed
steps, where the voltage was adjusted in increments of
. The current
I obtained from the response was measured and transmitted. Our potentiostats can achieve odd increments
that are different from even increments
.
The system can be also used to sample solutions using cyclic voltammetry and chronoamperometry (CA), depending on the practical needs.
2.2. Control Module
The control module was designed to control the sampling of the system and to process the sampling data using Nvidia’s Jetson Nano (B01) as the hardware and software platform. The Jetson Nano is a small and powerful computing platform designed to support edge AI. It is miniaturized while having enough computing power to be used in deep learning, computer vision, and other application scenarios. The Jetson Nano is compatible with a variety of programming tools, such as Python 2.7 [
28], which has a powerful PySerial class library that makes it easy to perform a range of operations on the development board, such as command-sending and command-receiving [
32]. The Jetson Nano can be used as a control and computing platform in place of a traditional host computer, such as a laptop.
The proposed HMI detection method on the Jetson Nano platform uses the PySerial library to issue operating instructions to control the system operation. First, the Jetson Nano platform sends the sampling mode and the experimental parameters to the sampling module via UART. The three-electrode potentiostat then enters the operating mode and acquires the solution data. The Jetson Nano then periodically queries the sampling module to determine whether the data collections are complete. Once the data are collected, the Jetson Nano sends a data transmission command, and the sampling module transmits the collected data to the Jetson Nano. The Jetson Nano automates the measurements by means of programming. It is much simpler than conventional electrochemical workstations. It eliminates the need to manually operate the computer after a single measurement is taken.
The HMID-NET handles the collected data. It first extracts the features in the data and then predicts the ion type and ion concentration in the solution by means of two branches. The HMID-NET has been deployed on the Jetson Nano. Compared to common deep learning models such as LeNet and AlexNet, HMID-NET has a smaller network structure and fewer network parameters. It runs smoothly on the Jetson Nano platform with an average inference time of 18.8 ms, fully meeting the needs of the real-time detection of portable devices.
2.3. Data Acquisition
The paper acquired the HMI data with , , and as examples.
Reagents: For the preparation of the experimental solutions, cadmium chloride, zinc chloride, copper chloride, and potassium chloride were purchased from Shanghai Maclean.
The solutions were configured with ultra-pure water with concentration gradients of 0.2 g/L, 0.5 g/L, 1 g/L, and 2 g/L of cadmium chloride, zinc chloride, and copper chloride dissolved in a 0.1 mol/L potassium chloride base solution, respectively. The mixtures were obtained by diluting and mixing the respective analyte solutions to reach the desired concentration levels. The pH of the solutions was not controlled to avoid the use of buffer solutions introducing additional ionic species [
12].
Data acquisition: The electrochemical potentiostat used the SWV method to sample 12 standard solutions with the same experimental parameters (increase = 0.005 V, amplitude = 0.025 V, and frequent = 25 Hz). Each solution was sampled 50 times. The screen-printed electrodes were replaced after each test, and the solutions were changed at the same time. To ensure accurate measurement results, the results of multiple measurements were analyzed, and any deviations due to chance were discarded; for instance, coarse deviations due to the solution configuration, differences in the screen-printed electrode workmanship, an unstable power supply from the mobile power supply, etc. Due to the small area of the screen-printed electrodes, a small dose of the solution was used for each measurement. This eliminated the need to reconfigure the solution. Fifty test samples of each solution were taken from the multiple sampling of a single solution configuration.
From a manufacturing process point of view, differences in the surface workmanship of screen-printed electrodes can lead to differences in test results for the same solution. To ensure the viability of the data input to the neural network, it should first be ensured that the repeat test results for the same solution are stable within a certain margin of error. As can be seen from
Figure 3a, the results of the five tests almost overlapped. Comparing the currents corresponding to the same voltage points, the average error in the test results was around 0.05 mA. Such an error had little impact on the subsequent neural network training. On the contrary, such a small error could effectively improve the generalization ability of the HMID-NET. By comparing the measurement results of the other groups, it was found that there was little difference between the results of multiple tests with the same solution. This proves the good stability of the disposable screen-printed electrodes. The stability exhibited by the screen-printed electrodes ensures the value of subsequent studies.
Ignoring minor errors due to the differences in the screen-printed electrodes, the same measurement parameters ensured that the only variable in the measurement process was the solution. Twelve specimen solutions were tested, and the outcomes are shown in
Figure 3b–d. In the above tests, the different types of solutions
,
, and
each exhibited different half-wave potentials. The peak heights for the same solution at different concentrations increased with the increasing concentration of the test solution. This is in accordance with the results of the SWV measurement method in theory.
To better extract the features of the data and improve the deep learning method’s accuracy, the voltage range for the electrochemical acquisition should encompass all voltages where peaks occur. By comparing all of the test results, a final voltage acquisition range of −0.3 to 0.7 V was set.
The HMI determination method in this paper does not require manual analysis and calculation of the half-wave potential and peak potential of the solution as in the conventional method. The powerful feature extraction capabilities of convolutional neural networks can capture the half-wave potentials and peaks of various solutions very well.
3. CNN Structure
3.1. CNN Structural Design
A convolutional neural network with local connectivity, weight sharing, and other features is a deep feed-forward neural network. It has powerful feature extraction as well as analysis and prediction capabilities. CNNs have been successfully used in many recognition fields, such as LeNet-5 for handwritten digital character recognition, AlexNet for face recognition and pedestrian detection, and lightweight networks, such as SqueezeNet and MobileNet for mobile devices.
We designed the HMID-NET to detect the type and concentration of the HMI. The structure of the HMID-NET is shown in
Figure 4.
The HMID-NET was divided into three parts: the backbone, the classification network, and the regression network. The backbone was mainly used to extract the half-wave potential and peak features of the data. It consisted of six convolution layers and two maximum pooling layers. Among the six convolutional layers, two of them were 1 × 1 convolutional and were used to extend the number of channels. The other was a 3 × 3 dilated convolution for feature extraction. The network of classifications is used to categorize the types of heavy-metal ions. It maps the input of 800 neurons to three target-based neurons; the cross-entropy loss is the loss function of the classification network and the activation function is ReLU. The data in these three neurons correspond to the probability of the solution containing , , and , respectively. The regression network maps 800 input neurons to the 3 neurons used for regression prediction. The loss function of the regression network is the mean square loss, and the activation function of the output layer is Softmax. The aim of using the Softmax function is to regress the predicted values between 0 and 1, thus avoiding the problem of gradient loss when the error is backpropagated. The three types of neuron data in the regression network correspond to the predicted concentrations of , , and .
3.2. Convolutional Layer
The role of the convolution layer iswas to extract features from a local region. Each layer of the convolution had multiple convolution kernels, which are feature extractors and are the bases of convolution operations. The convolutional layer neurons are usually organized as three-dimensional structured neural layers consisting of D feature mappings of size M × N (D is the number of channels, M is the height, and N is the width). Feature mapping is the feature matrix obtained by the convolutional extraction of data. By using several different feature mappings in each convolutional layer, the representation capability of the convolutional network can be improved. Thus, the number of channels can also be extended with convolutional layers.
For the input feature-mapping group
, the output mapping group obtained was
; a total of
two-dimensional convolution kernels was required, recorded as
. For the input solution data,
was the number of characteristic curves, and
was the number of data sampled on the feature curve. The output feature mapping is shown in Equation (
3):
where
denotes the activation function [
33].
Dilated convolution is a convolution used to increase the output perceptual field without increasing the number of parameters as shown in
Figure 5. Dilated convolution increases the size of the convolution kernel in disguise by inserting holes into it. Considering the long rectangular feature of the 4 × 200 input data, the dilated convolution was used in HMID-NET. It increased the size of the convolution kernel, so the 2 layers of 3 × 3 convolution had the effect of approximating 1 layer of 5 × 5 convolution and increased the perceptual field of the output unit. The use of dilated convolution allowed further miniaturization of the convolutional neural network.
3.3. Activation Function
The activation functions are mainly used to cope with the nonlinear variations in the derivation process of convolutional neural networks. A nonlinear activation function was added between the layers of the feature extraction network, as shown in Equation (
4).
In the HMID-NET, nonlinear activation functions (ReLU and Softmax) were used. ReLU is the commonly used activation function and is characterized by rapid convergence. Softmax is a common and important normalization function that maps the input values to between 0 and 1, representing probabilistic real numbers. These formulae are shown in Equations (
5) and (
6):
In the HMID-NET, the Softmax function was used as the activation function for the output layer of the regression network. The concentration was regressed to 0–1 to reduce the gradient loss in the network training.
3.4. Convergence Layer
The main role of a convergence layer is to perform feature selection and reduce the number of features [
33]. It can reduce the number of parameters and is a good solution to the overfitting problem arising from the high input dimensionality of the classifier. In the convergence algorithm, the input feature-mapping group are divided into multiple regions
[
33], which are convergence operations for each zone. HMID-NET used the maximum aggregation layer; for areas in the aggregation layer
, the maximum active value in this region for all neurons was picked as the representative, as Equation (
7):
The reason for using Maxpooling is that HMID-NET needed to extract the peak features of the input data. If the average pooling method was used, the number of features extracted would have been significantly reduced, and the quality of the features would have lowered.
3.5. Fully Connected Layer and Output Layer
The fully connected layer was present in the classification and regression networks of the HMID-NET. The fully connected layer is mainly used to integrate features to accomplish the operation of classification or regression prediction. It can map the extracted features from the feature extraction network to a few neurons for prediction.
HMID-NET can perform both classification and regression of the ion concentrations in solutions. The classification and regression networks were placed side by side. In the classification network, the ReLU function was used as the activation function for the fully connected layer. This was because the classification network used cross-entropy loss, which is self-normalizing. In the regression network, the Softmax function was used as the activation function for the output layer. This mapped the concentration predictions between 0 and 1, reducing the gradient loss during training.
The output of the classification network was three neurons. The data in these three neurons corresponded to the probability that the solution contained , , and , respectively. The labels corresponding to the maximum values of these three data were the predicted solution types.
In the regression network, the output of the three neuron values correspond to the predicted concentrations of , , and , respectively. However, the concentration prediction requires taking into account the prediction of the classification network. For example, if an ion is predicted to have the class , the regression network result is [a, b, c]. At this point, the ion species is , and the concentration is a. The solution does not contain or ; so, results b and c are not considered.
For a fully connected layer network with an input layer of 800 and an output layer of 3, see
Table 1 The effect of changing the size of the hidden layer on the accuracy of the network is shown. We consider the relationship between the concentration error, classification accuracy, and the number of parameters, and choose 64 as the number of neurons in the middle hidden layer.
3.6. Parameter Learning
Parameter learning is a way to adjust the parameters in a convolutional neural network to ensure the results are closer to reality. Parameter learning is often performed using error backpropagation. That is, the parameters are adjusted inversely by the error generated from the derived results and the real label. The following shows the derivation of a single parameter update.
Generally, with layer
l as a convolutional layer, the input features of layer
are mapped as
[
33], and the net input of the feature mapping at layer
l is obtained by convolution
. The activation value is
, and the
p (1 ≤
p ≤
P) feature of the
l layer maps the net input as shown in Equation (
8):
where
is the convolution kernel,
is the bias [
33], and there are
convolution kernels and
P biases in layer
l. The chain rule can be used to calculate their gradients separately, and we let the loss function be
L, whose partial derivatives with respect to the convolution kernel
in layer
l are:
In HMID-NET, the regression loss is the MSE loss, and the classification loss is the cross-entropy loss, as in Equations (
10) and (
11):
Similarly, the partial derivative of the bias
p of the layer
l is shown in Equation (
12):
where
is the derivative of the loss function with respect to the feature mapping
p of layer
l via input
.
The parameter update of the convolution kernel with bias by the derivatives to obtain a single update is as in Equations (
13) and (
14):
where
is the learning rate.
Figure 6 shows a diagram of forward and error backward propagation.
For convolutional neural networks, a single time of parameter updating is apparently not enough, and HMID-NET uses stochastic gradient descent (SGD) for parameter learning. The stochastic gradient descent process is as follows:
Randomly initialize parameters W, b;
Reorder the samples in the training set;
Take the data of batch sizes for parameter learning and updating, and obtain the validation set error rate;
Repeat steps 2 and 3 until the validation set error rate no longer decreases;
Obtain the global optimum W, b.
For batches of data, the size of the sample batch and the learning rate affect the training results. When the sample batch is twice the original size, to ensure that the weights are updated equally after the same sample, the learning rate should be increased to a multiple of the original size according to the linear scaling rule. After the experiments, the learning rate was set to 0.01 and the batch size to 16.
3.7. Dataset Acquisition
In this study, the HMI dataset was built using , , and as examples.
Data acquisition: Tests were carried out using square-wave voltammetry. The square-wave voltammetry parameters were set to (Init = −0.7 V, Final = 0.3 V, Increase = 0.005 V, Amplitude = 0.025 V, and Frequency = 25 Hz). A single sampling yielded 400 current data units, and to prevent a high chance of errors in the data, each input data unit consisted of 2 separate test results. We extracted a set of 200 data units from each of the odd columns and a set of 200 data units from each of the even columns, for a total of 4 sets of 2 measurements. These 4 groups were arranged in order to form a 4 × 200 data cell as shown in Equations (
15) and (
16):
Dataset creation: Data were collected for 12 solutions of cadmium chloride, zinc chloride, and copper chloride with concentration gradients of 0.2 g/L, 0.5 g/L, 1 g/L, and 2 g/L. One data unit was obtained from every two samples. We set each solution to be sampled 50 times, making up 25 data units, with a total of 300 data units as the original dataset.
Data augmentation: Firstly, the data obtained from the acquisition were of the order of magnitude A, expanding the data 1000 times to reduced gradient loss. These 300 data units were extended by adding 1% white noise to obtain 1200 data units. These data were used as the input dataset for the neural network. This expansion scheme did not affect the important peak and height features of the original electrochemical measurements but broadened the size of the dataset. To establish the accuracy of the model when training, the data needed were classified into two sets: a training set (70%) as well as a testing set (30%).
The results of a particular data measurement for each concentration were taken and combined into a single data cell, which was produced as a grayscale image. The grayscale of the image from black to white represents the data from small to large. As can be seen in
Figure 8, each grayscale image has an area that is approximately white. The position of this region corresponds to the position of the peak in the original data, and the degree of brightness of the region corresponds to the height of the peak. In a conventional square-wave polarimetric analysis, the main features extracted are the half-wave potential as well as the peak height [
8]. The peak potential is related to the ion species, and the peak height is related to the ion concentration. From a visual point of view, the following dataset in
Figure 8a provides a visual representation of the features to be extracted.
Figure 8b shows the visual representation of the data features extracted from
Figure 8a.
3.8. Label Settings
Each data unit is mapped with two labels, one for classification denoted as label 1 and the other for concentration prediction denoted as label 2. In the structure of the convolutional neural network shown in
Figure 4, the classification and regression networks share the same feature extraction network. If the values of label 1 and label 2 differ significantly, this could lead to a loss of gradient when the error is backpropagated. Once the gradient is lost, the prediction cannot be accurately derived. So the concentration label, label 2, needs to be normalized. For example, for the three categories of
,
, and
corresponding to 0.2 g/L, we set label 1 as [1, 0, 0], [0, 1, 0], and [0, 0, 1], respectively. The labels for the regression network are [0.1, 0, 0], [0, 0.1, 0], and [0, 0, 0.1], respectively.
5. Conclusions
We presented a CNN-based method for monitoring heavy-metal ions that can detect the type and concentration of HMIs within two minutes. The device can be used to predict the species and concentrations of a wide range of trained metals. The datasets used in HMID-NET were all experimentally derived. The main advantage of our algorithm is the use of a CNN algorithm, which avoids each calibration, shortens the detection time, improves the accuracy, and increases the reliability of the classification and prediction. The paper presented the first concept for the simultaneous type and concentration prediction of ions using CNN structures. The concept proposed in the paper can be used in a wide range of electrochemical detection fields. A detection algorithm that uses machine learning offers the possibility of the simultaneous classification of multiple ions as well as concentration prediction.
The results, based on the three-electrode electrochemical system, demonstrated the specificity of the test results for different concentrations of solutions. The results were reproducible for the same solution at the same concentration. The sampled data underwent data extension and preprocessing operations to create a dataset containing 1200 data samples. The proposed HMID-NET algorithm was used for class determination and concentration estimation of heavy-metal cations in water. A final classification accuracy of 99.99% and an average relative error of 8.85% in terms of the concentration were obtained.
The concept of applying convolutional neural networks to electrochemistry is also applicable to other analytical systems. However, the disadvantage of the data-driven approach is the need to reproduce the conditions of the test phase in the training phase. There is a lack of contemporary datasets for heavy-metal detection. The shortage of experimental data prevents the current application of our method to mixed solutions of heavy-metal ions. In future work, we will apply HMID-NET to the detection of mixed solutions and investigate how to obtain the species and concentrations of all the ions contained in the solution simultaneously.