# A CNN-Based Method for Heavy-Metal Ion Detection
## 2 HMI Detection Method
### Data Acquisition  
The paper acquired the HMI data with \(Cd^{2+}\), \(Zn^{2+}\), and \(Cu^{2+}\) 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. Figure 3: (**a**) The results of the multiple replicate tests of a 0.5 g/L solution of zinc chloride dissolved in a 0.1 mol/L potassium chloride substrate. Data 1–data 5 are the data curves for the different measurement times; (**b**) the SWV data for the \(Zn^{2+}\) solution at different concentrations; (**c**) the SWV data for the \(Cu^{2+}\) solution at different concentrations; (**d**) the SWV data for the \(Cd^{2+}\) solution at different concentrations. 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 \(Cd^{2+}\), \(Zn^{2+}\), and \(Cu^{2+}\) 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.