A Novel Method for Carbendazim High-Sensitivity Detection Based on the Combination of Metamaterial Sensor and Machine Learning

Benzimidazole fungicide residue in food products poses a risk to consumer health. Due to its localized electric-field enhancement and high-quality factor value, the metamaterial sensor is appropriate for applications regarding food safety detection. However, the previous detection method based on the metamaterial sensor only considered the resonance dip shift. It neglected other information contained in the spectrum. In this study, we proposed a method for highly sensitive detection of benzimidazole fungicide using a combination of a metamaterial sensor and mean shift machine learning method. The unit cell of the metamaterial sensor contained a cut wire and two split-ring resonances. Mean shift, an unsupervised machine learning method, was employed to analyze the THz spectrum. The experiment results show that our proposed method could detect carbendazim concentrations as low as 0.5 mg/L. The detection sensitivity was enhanced 200 times compared to that achieved using the metamaterial sensor only. Our present work demonstrates a potential application of combining a metamaterial sensor and mean shift in benzimidazole fungicide residue detection.


Introduction
Due to its efficacy and affordability, benzimidazole fungicide has been used extensively to control crop pests. However, excessive usage of benzimidazole fungicide has resulted in its residue being found in foods including rice, wheat, corn, soybeans, etc. It directly threatens the health and safety of consumers [1,2]. Food products should be checked for benzimidazole fungicide before consumption to ensure food safety. Carbendazim is a benzimidazole fungicide widely used to prevent crop disease caused by fungi. The maximum residue limit of carbendazim in cereals is 0.5 mg/kg according to Chinese Standard GB2763-2021. Currently, chromatographic, biological, and spectroscopic techniques are the main methods for detecting pesticide residues. Chromatography is sensitive but requires tedious sample pretreatment [3][4][5][6][7]. The biological method can detect pesticide residues rapidly, but it is not universal [8][9][10][11]. The spectroscopic method, such as Raman spectroscopy and infrared spectroscopy, is straightforward, quick, safe, and nondestructive [12][13][14][15][16][17]. Gong et al. [18] reported a surface-enhanced Raman scattering (SERS) method for detecting pesticide residues on fruit peels. SERS was achieved by applying silver nanoparticles (Ag NPs) to the surface of the tape after analyte collection. The limit of detection was 0.0225 mg/kg. Madianos et al. [19] developed a pesticide gas sensor based on self-assembled nanoparticle networks and four different polymer coatings. The sensors could detect chlorpyrifos concentrations as low as 0.7 ppb. Chen et al. [20] developed an Ag-nanocellulose fiber SERS substrate (Ag@NCF substrate) to detect hazardous residues. The sensitive Ag@NCF substrates achieved ppb-level detection of pesticides. The spectroscopic method has garnered more and more interest in detecting pesticide residues.
The terahertz (THz) spectrum, lying between 0.1 THz and 10 THz, is a new spectroscopic method. In molecular and biomolecular systems, the absorption of the THz spectrum is dominated by the excitation of intramolecular and intermolecular vibrations. It is significant for molecule and biomolecule detections. Thus, THz-TDS is regarded as a promising chemical and biological substance detection method [21][22][23][24]. In the field of pesticide detection, the pesticides imidacloprid, acetamiprid, triadimefon, carbendazim, thiamethoxam, and thiabendazole have been inspected by THz-TDS [25][26][27][28][29]. Nevertheless, the limited sensitivity prohibits THz-TDS from being widely used in pesticide detection.
Metamaterials are periodic artificial electromagnetic media structured on a subwavelength scale and exhibit characteristics not found in the natural world [30]. Because of its localized electric-field enhancement and high-quality factor value, the metamaterial sensor is appropriate for applications concerning food safety detection. Xie et al. [31] used a metamaterial sensor to detect traces of kanamycin sulfate. Compared to the lowest detectable concentration on bare silicon, the results reveal a 10 10 improvement using metamaterial sensors. Qin et al. [32] used a circle-slit-shaped metasurface for tetracycline hydrochloride detection. The sensitivity increased 10 5 times compared to detecting on a silicon substrate alone. Xu et al. [29] reported the chlorpyrifos-methyl-sensing performances of the THz metamaterial sensor. An Ohm ring metamaterial sensor for carbendazim detection was experimentally demonstrated by Qin [33]. However, the abovementioned detection method only considered the resonance dip shift. Much information contained in the spectrum was neglected. Machine learning methods have been employed to analyze the absorption of the THz spectrum in recent years. Yang et al. [34] employed popular machine learning methods, including the convolutional neural network, linear discriminant analysis (LDA), and the support vector machine, to classify the geographic origin of coffee beans. Silva et al. [35] presented an analytical method based on THz-TDS and partial least-squares regression to quantify mebendazole polymorphs (forms A, B, and C) in pharmaceutical raw material. The detection limits for polymorphs A, B, and C were 2.7-4.3% w/w, 2.9-4.0% w/w, and 2.4-3.1% w/w, respectively. To classify 20 amino acids, Wang et al. [36] designed a convolutional neural network calibrated by efficient channel attention. On two test datasets, the designed network achieved an accuracy of 99.9% and 99.2%. In our recent work, we proposed a WGAN-ResNet method, which combined two deep learning networks, the Wasserstein generative adversarial network (WGAN) and the residual neural network (ResNet), to detect carbendazim based on terahertz spectroscopy [37]. The outcomes demonstrated that the machine learning method could extract spectral features successfully. Thus, combining the metamaterial sensor and machine learning is a potential method to detect benzimidazole fungicide residue with high sensitivity.
In this paper, we present a highly sensitive method for detecting carbendazim using a metamaterial sensor and machine learning. We designed a metamaterial sensor, in which the unit cell consisted of a cut wire (CW) and two split-ring resonators (SRRs). The mechanism for resonance and the detection sensitivity were analyzed by simulation. Then, the amplitude transmission spectrum was measured without/with the carbendazim-ethyl alcohol solution mixture on the metamaterial sensor. We observed that two resonance dips shifted to a lower frequency with increased carbendazim concentrations. To improve the detection sensitivity, we employed an unsupervised machine learning method, mean shift, to analyze the amplitude transmission spectrum. The results demonstrate that the metamaterial sensor combined with the mean shift method could highly improve the device sensitivity.

Samples Preparation
The purity of the carbendazim powder was 98%. The purity of the anhydrous alcohol was 99%. They were bought from Adamas Co., Ltd. These chemicals were used without purification. We employ a magnetic stirrer to ensure that the carbendazim and anhydrous alcohol mixture was stirred consistently. Two duplicates were made for each concentration of the carbendazim-ethyl alcohol mixture solutions, which ranged in concentration from 0.5 mg/L to 100 mg/L (0.5 mg/L, 2 mg/L, and 100 mg/L).

metamaterial sensor Structure and Simulation
The metamaterial sensor was fabricated using a surface micromachining process. First, a layer of photoresist was used to form the CW and SRR structure. After the ultraviolet exposure and development process, the CW and SRR pattern was formed on the highresistance silicon substrate. Then, a layer of the aluminum film was deposited on the surface. Finally, a lift-off process formed the metal CW and SRR structure. A scanning electron microscope (SEM) image of the fabricated metamaterial sensor is shown in Figure 1. A CW and two SRRs were the components of the unit structure, which was deposited on a silicon substrate with high resistance. We call the fabricated metamaterial sensor CWSRRs. Both the CW and SRRs were aluminum. The following are the sensor's structural parameters: PX = 120 µm, PY = 120 µm, LX = 40 µm, LY = 30 µm, D = 4 µm, D1 = 6 µm, G = 30 µm. The aluminum and the high-resistance silicon substrate had thicknesses of 200 nm and 30 µm, respectively. We used the FITD method to simulate the metamaterial sensor CWSRRs. The simulation was implemented using the commercial full-wave simulation software CST2015 microwave studio. In the CWSRR simulation, we treated the high-resistance silicon substrate as a lossless dielectric with a dielectric permittivity of ε = 11.9, and the DC conductivity of aluminum with 3.56 × 10 7 S/m. The x and y directions were set as the unit cell boundary conditions, while the z direction was set as the open boundary condition.

Mean Shift
Mean shift is an unsupervised machine learning method that Fukunaga [38] proposed. The fundamental mean shift algorithm was generalized in the following two ways by Cheng [39]. One was to define the kernel function family. The other was to assign different weight coefficients to different sample points.
Given n data points x i , i = 1, ..., n in the d-dimensional space R d , the multivariate kernel density estimator with kernel K(x) and a symmetric positive definite d × d bandwidth matrix H, computed in the point x, was given bŷ where The bandwidth matrix H was usually chosen in proportion to the identity matrix H = h 2 I. The kernel density estimator was computed in the following manner: The kernel was satisfying where the k(x) was called as the profile of kernel, only for x ≥ 0. The normalization constant c k,d , which makes K(x) integrate to one, was assumed to be strictly positive.
Employing the profile notation, the density estimator can be rewritten aŝ The density gradient estimator was obtained as the gradient of the density estimator by exploiting the linearity of Equation (5) Moreover, a function g(x) was defined The derivative of the kernel profile k exists for all x ∈ [0, ∞), except for a finite set of points. Using g(x) for profile, the kernel G(x) was defined as where c g,d was the corresponding normalization constant. Introducing g(x) into Equation (6) yields∇ From the Equation (5), the first term was proportional to the density estimate at x computed with the kernel Gf The second term was the mean shift vector The mean shift pseudo code is given in Algorithm 1.

Algorithm 1 Mean shift
Input: data, bandwidth Output: labels 1: Choose a point at random as the initial center point. 2: Find all points whose distance from the center point is less than the bandwidth, denoted as set S, and consider these points as belonging to cluster C.

Spectral Measurements
All measurements were taken with a time-domain spectroscopy (THz-TDS) system operating in transmission mode at normal incidence. A schematic diagram of the THz-TDS system is shown in Figure 2. A cubic beam splitter (CBS) separated a femtosecond laser beam into a pump beam and a probe beam. The pump beam was illuminated on a photoconductive antenna to elicit the THz beam. THz detection was accomplished using an electro-optic ZnTe crystal, a quarter-wave plate (QWP), a Wollaston prism (WP), and a set of balanced photodiodes (PD). The spot diameter of the THz beam focused on the sample was approximately 4 mm.
A carbendazim-ethyl alcohol solution sample was doped on the metamaterial sensor for sample measurement. The metamaterial sensor was thoroughly cleaned with deionized water following the test, and it was then dried in a dry airflow. Each measurement was averaged from ten scans to reduce the random error. All tests were conducted in a dry container with a relative humidity of less than 1% (±0.1%), and at 25 • C (±0.1 • C).  Figure 3 depicts the simulation process flow chart. Using CST2015, we designed the metamaterial sensor CWSRRs. The amplitude transmission of CWSRRs was then obtained. Simultaneously, the mechanism of resonance was investigated using the surface current. Finally, the sensitivity of the resonance dips was investigated. The simulated amplitude transmission of CWSRRs is shown in Figure 4. The resonance in CWSRRs displayed multimodal resonances, including two resonance dips at 0.576 THz and 0.622 THz, as well as a transmittance peak at 0.61 THz. For the first frequency resonance dip f = 0.576 THz, the surface current of CWSRRs is shown in Figure 5a. The surface current flows in the direction of the arrow. The various colors represent the magnitude of the surface current. Blue represents the smallest surface current, whereas red represents the largest surface current. We observed that the surface current was distributed on the CW and SRRs. The surface current on the CW was directly excited by the external field. Then, the field generated by the CW excited the surface current of SRRs through the near field. The color of the surface current on the CW was closer to red. This means that the surface current on the CW was larger than that on SRRs. Thus, the first resonance dip originated from electric dipole oscillations. For the second resonance dip f = 0.622 THz, the surface current of CWSRRs is shown in Figure 5c. The surface current was mainly distributed on SRRs. Compared with the first resonance dip, the surface current on SRRs was enhanced because the energy transferred from the CW to SRRs increased. Therefore, the second resonance dip was attributed to inductor-capacitor oscillations. For the transmittance peak at f = 0.61 THz, the surface current was distributed on the CW and SRRs, as shown in Figure 5b. The CW was directly excited by the external field as the bright mode. Additionally, the SRRs were in the dark mode, which cannot be directly excited by the external field. The dark mode was excited by the bright mode through the near-field coupling. The resonance peak occurred because of the absorption cancellation by the bright mode and the dark mode coherence and interference. Furthermore, we investigated the sensitivity of the two resonance dips. The analyte's thickness was set at 4 µm. We varied the permittivity from ε = 1 to ε = 4 with an incremental step of 1. The total electric capacity of the sensor was C = C 1 + C 2 + C 3 + C 4 [40], C 1 was the electric capacity of the substrate, C 2 was the electric capacity between the substrate and the sensor structure, C 3 was the electric capacity of the sensor structure, and C 4 was the electric capacity between sensor structure and the analyte. As we know, the electric capacity C = εS/d. Thus, C 4 increased with the permittivity of the analyte that covered the sensor. The two resonance dips shifted to a low frequency as the permittivity of the analyte increased, as shown in Figure 6. Taking the permittivity ε = 1 as a reference, the frequency offset value of the two resonance dips with different permittivities is shown in Figure 7. The frequency offset value was defined as the difference between the resonance frequency of the reference and the analyte. The X axis was the permittivity, and the Y axis was the frequency offset value. At the same permittivity value, the frequency offset value of the first resonance dip was more significant than the second resonance dip. With the permittivity increasing, the frequency offset value of the first resonance dip varied from 15 GHz to 43 GHz, and the second resonance dip changed from 12 GHz to 33 GHz. The sensitivity of the first and second resonance dip was 43 GHz/RIU and 33 GHz/RIU.  Figure 8 shows the flow chart for the experiment process. The THz-TDS system obtained the amplitude transmission without/with the carbendazim-ethyl alcohol mixtures on CWSRRs. Then, the mean shift was employed to analyze the amplitude transmission spectra. We measured the amplitude transmission of the bare metamaterial sensor CWSRRs, as illustrated in Figure 9. The resonance dips were at 0.563 THz and 0.613 THz, which was in good agreement with the simulation.  Figure 10 shows the amplitude transmission of the carbendazim-ethyl alcohol mixtures doped on CWSRRs. The two resonance dips gradually shifted to a lower frequency than without the mixture on the sensor. When the carbendazim concentration was 100 mg/L, the two resonance dips were at 0.554 THz and 0.604 THz. The variation in carbendazim concentration caused the permittivity of the carbendazim-ethyl alcohol mixtures to change. For the permittivity of the 2 mg/L sample and 0.5 mg/L sample, the difference was not significant due to the carbendazim concentration being similar. When the carbendazim concentration was 2 mg/L, the two resonance dips were at 0.557 THz and 0.605 THz. Additionally, when the carbendazim concentration was 0.5 mg/L, the two resonance dips were at 0.556 THz and 0.605 THz. Thus, when the carbendazim concentration was down to 2 mg/L and 0.5 mg/L, the resonance dips were almost the same. It was difficult to tell one from the other. Using the CWSRRs, the carbendazim limit of detection was 100 mg/L. Additionally, we used the mean shift unsupervised learning method to raise the minimum detectable concentration on the CWSRRs for metamaterial sensors. A total of six amplitude transmission spectrum samples for three carbendazim concentrations (0.5 mg/L, 2 mg/L, 100 mg/L) were analyzed. Before applying the mean shift, we reduced the dimension of the amplitude transmission spectra using principal component analysis (PCA). We discovered that the cumulative variance contribution rate of the first two principal components (PCs) was 96.1%. Usually, the original dataset may be replaced when the cumulative variance contribution rate is greater than 85% [41]. Thus, we set the bandwidth to 15 and used the first two PCs as the input of the mean shift. After performing PCA, the six samples were found to be in a plane without overlapping, as shown in Figure 11a. The mean shift execution process is shown in Figure 11b-d. Initially, a sample was randomly selected as a center point(old center point). Then, using the mean shift, the new center point was discovered (see Figure 11b). The center of a cluster was discovered when the mean shift satisfied the conditions M h,G (x) ≤ ε (set ε as 10 −45 ), as shown in Figure 11c. We repeated that process until all cluster centers had been discovered. Finally, the outcome of the mean shift is shown in Figure 11d. The dot indicates the cluster's center point. Additionally, the samples are denoted by an asterisk. Three center points fall between the cluster samples. Thus, the six samples were split into three clusters in Figure 11d that correspond to values of 0.5 mg/L, 2 mg/L, and 100 mg/L, respectively. The group of samples in the upper-left corner of the plot had a carbendazim concentration of 100 mg/L. Another was the group of samples in the lower-right corner of the plot with a carbendazim concentration of 2 mg/L. The remaining samples, which had a carbendazim concentration of 0.5 mg/L, are situated in the plot's upper-right corner. This indicates that the mean shift could identify the sample successfully. By combining the metamaterial sensor and mean shift, the carbendazim limit of detection was 0.5 mg/L. As mentioned above, the carbendazim limit of detection was 100 mg/L when only the metamaterial sensor was used. Our proposed method enhanced the detection sensitivity 200 times compared to the sensitivity achieved only using the metamaterial sensor.

Analysis of Experiment Results
We also contrasted our proposed approach with other ones from the literature. The method under comparison operated in the terahertz band. Table 1 displays the results of the comparison. Our proposed method yielded a 0.5 mg/L limit of detection for carbendazim. It outperformed comparable methods in the literature.

Conclusions
In this study, we combined a metamaterial sensor and mean shift to implement highly sensitive detection of carbendazim. The simulation and experiment results demonstrate that our proposed method could effectively detect carbendazim. The achieved carbendazim limit of detection was 0.5 mg/L; thus, sensitivity was improved by a factor of 200 times compared to the case of using the metamaterial sensor only. Since our method was based on measuring the change in the dielectric properties of the sample, it could be universally used to detect other benzimidazole fungicides. Nevertheless, the precision and accuracy of the test results were extremely sensitive to the deposition of nontarget substances. Selectivity should be considered in our future work. To implement selectivity, we will concentrate on preventing nontarget substances from contaminating the metamaterials during sample preparation and measurement.

Data Availability Statement:
The data presented in this study are available on request from the corresponding author. The data are not publicly available due to privacy.