# Research on Soil Pesticide Residue Detection Using an Electronic Nose Based on Hybrid Models
## 2 Experimental Materials and Methods
### Experimental Data Analysis Methods
A KNN [30] is a simple and powerful classifier, which has the advantages of having a fast model training time, good prediction effect,  
Figure 3: A schematic diagram of the analysis method for pesticide residue data. (**a**) A framework diagram of the soil pesticide residue hybrid model. (**b**) The feature extraction method, and the (**c**) supervised learning classifier. and being insensitive to an outlier. The RF [31] classifier is constituted by an ensemble of decision trees, where the classification outcome is ascertained by the modal output type derived from the individual trees. It has high accuracy, can handle a large number of input variables, and can balance the error for unbalanced classification sets. The overall process for identifying soil pesticide residue hybrid models is as follows: Firstly, feature extraction is performed on the obtained soil odor data to significantly reduce data redundancy and obtain essential odor information. Then, a one-class support vector machine is used for pollution detection to determine whether the soil is contaminated. If no pollution is identified, the entire identification is complete. If pollution is identified, the odor data enters the pesticide identification step. The contaminated soil is also first subjected to feature extraction to obtain essential odor information, and then precise classifiers are used to identify pesticides. Based on the identification results, corresponding soil remediation measures can be taken to achieve safe and efficient soil remediation. Under the objective of soil residue analysis, we divide the analysis into soil health detection tasks and precise pesticide identification tasks. In the soil health detection task, considerations such as the speed of detection, training efficiency, and model scalability are addressed by employing unsupervised learning with a one-class SVM. For the precise pesticide identification task, the focus is on the accuracy of identification and whether supervised learning models were utilized. This framework of combining unsupervised and supervised models in a hybrid model allows for the rapid and accurate detection of soil residues with minimal training requirements. The feature extraction that runs through the entire process is crucial for soil pollution and pesticide identification. In this paper, wavelet transform (_WT_), Fourier transform (_FT_), maximum (_MAX_), and mean (_Mean_) are selected as candidate feature schemes [32]. _WT_ and _FT_ can effectively reflect the transient information of odor, while the _MAX_ and _Mean_ can effectively reflect the steady-state information of an odor. The wavelet transform (_WT_) disassembles the original response into components of lower and higher frequencies, exhibiting a robust resistance to interference. It facilitates multi-resolution analysis, possessing the capability to delineate local attributes of the signal across both time and frequency domains. The _WT_ feature extraction formula is as follows:  
\[WT(a,\tau)=\frac{1}{\sqrt{a}}\int\limits_{-\infty}^{\infty}f(t)*\psi\bigg{(} \frac{t-\tau}{a}\bigg{)}dt, \tag{1}\]  
where \(t\) represents time and \(f(t)\) represents the sensor's response value. Fourier transform (_FT_) constitutes the transformation of unprocessed data into a novel domain, effectuating the decomposition of the raw response into a confluence of direct current (DC) elements and various harmonic constituents. The amplitude attributes of each constituent facilitate both qualitative and quantitative assessments. The _FT_ feature extraction formula is as follows:  
\[F(\omega)=F[f(t)]=\int_{-\infty}^{\infty}f(t)e^{-int}dt, \tag{2}\]  
where \(t\) represents time and \(f(t)\) represents the sensor's response value. The _MAX_ epitomizes the ultimate steady-state attributes of the entire dynamical response sequence at equilibrium, encapsulating the maximal variation in the sensor's reaction to olfactory stimuli. This parameter is commonly employed as a predominant method for feature extraction.