# Detection of Volatile Organic Compounds (VOCs) in Livestock Houses Based on Electronic Nose
## 3 Results and Discuss
### Odor Identification of Livestock Farms
All electronic nose data obtained from airbags were randomly divided into training sets and test sets for each fold of cross-validation and this process of randomization was carried out 10 times, and the data for each training set and test set are different. Finally, the average recognition rate was used to judge the model; to some extent, this avoids the sample correlation caused by deliberate division. Figure 5: LDA chart of different time at the same position in pig house with features of average values: (**a**) pregnancy-exhaust; (**b**) pregnancy-middle; (**c**) nursery-middle; (**d**) nursery-window. We carried out parameter optimization and established the KNN and SVM models with the better parameter. Table 4 shows the gas classification accuracy of KNN and SVM for the same sampling location and different sampling times when the features were at the average value and maximum value. The accuracy of KNN's classification of odor in the same location in the piggery for four periods is above 80%, and the correct rate of SVM classification is above 85%. This shows that SVM has a better correct rate of odor classification at different times in the piggery, but the feature selection has no significant effect on the classification results. Therefore, from comparing the three classification methods for the gas recognition results at different times in the piggery, it can be concluded that SVM has the highest classification accuracy, but the feature selection has little effect on the classification results, except for nursery-window, KNN, and LDA, the latter of which had the worst effect. Table 5 shows the gas classification accuracy of KNN and SVM with the same sampling time and different sampling locations. KNN has a classification accuracy rate of more than 69% for gas in different locations of the piggery, and the SVM classification accuracy rate is more than 86%. Obviously, the classification accuracy rate of SVM is higher than KNN, but \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Features** & **KNN/SVM** & **Pregnancy-Echaust** & **Pregnancy-Middle** & **Nursery-Middle** & **Nursery-Window** \\ \hline \multirow{3}{*}{Average} & KNN & 91.94\% & 83.61\% & 82.26\% & 80.00\% \\  & SVM & 95.16\% & 95.08\% & 93.55\% & 85.00\% \\ \cline{1-1}  & KNN & 87.10\% & 88.52\% & 91.94\% & 83.33\% \\ \cline{1-1}  & SVM & 96.77\% & 95.08\% & 96.77\% & 95.00\% \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The accuracy for odor classification in the same sampling location of piggery at different sampling times. Figure 6: LDA chart of different times at the same position in the pig house with features of maximum values: (**a**) pregnancy-exhaust; (**b**) pregnancy-middle; (**c**) nursery-middle; (**d**) nursery-window. the feature selection has no significant impact on the classification accuracy rate. SVM is more suitable for the identification of piggery gas. Figure 7: LDA chart of different positions at the same time in pig house: (**a**) morning when features are at average value; (**b**) afternoon when features are at average value; (**c**) evening when features are at average value; (**d**) morning when features are at maximum value; (**e**) afternoon when features are at maximum value; (**f**) evening when features are at maximum value. To summarize, the accuracy of KNN for the odor classification of the chicken houses at different sampling times is shown in Table 6. Obviously, the correct rate of KNN for odor classification of the chicken houses at different time is above 78%, and the correct rate of SVM classification is above 92%. The accuracy of SVM classification is higher than that of KNN, and the feature selection has no significant impact on the classification accuracy rate. And SVM is more suitable for chicken house odor identification.