# Detection of Volatile Organic Compounds (VOCs) in Livestock Houses Based on Electronic Nose
## 3 Results and Discuss
### Odor Identification of Livestock Farms  
In order to further explore the response of the sensor array, odor identification of livestock farm was carried out. The average value and maximum value of the sensor response were selected as features, and the linear classification method (LDA) and nonlinear classification method (KNN, SVM) were used, respectively, to identify the gas in different times and spaces of livestock farms. The classification results were compared to find the most suitable pattern recognition method for VOCs in livestock farms. (1) LDA  
Figures 5 and 6 show the LDA of gas at different times in the piggery when the features were at the average value and the maximum value. The cumulative contribution rate of the horizontal and vertical coordinates was 100%, which can fully represent the characteristics of sample information. When the features were at an average value, only the nursery-window-morning overlapped. When the features were the maximum value, they more or less overlapped in the three periods of gas. In summary, LDA is more suitable for piggery gas identification when the features are at average values. \begin{table}
\begin{tabular}{c c c c c c c} \hline  & \multirow{2}{*}{\begin{tabular}{c} **Days of** \\ **Experiments** \\ \end{tabular} } & \multicolumn{2}{c}{\begin{tabular}{c} **Morning** \\ **Number of** \\ **Gas Bags** \\ \end{tabular} } & \multicolumn{2}{c}{\begin{tabular}{c} **Afternoon** \\ **Number of** \\ **Gas Bags** \\ \end{tabular} } & \multicolumn{2}{c}{\begin{tabular}{c} **Evening** \\ **Tests** \\ \end{tabular} } \\ \cline{2-7}  & & \begin{tabular}{c} **Number of** \\ **Gas Bags** \\ \end{tabular} & \begin{tabular}{c} **Number of** \\ **Tests** \\ \end{tabular} & \begin{tabular}{c} **Number of** \\ **Gas Bags** \\ \end{tabular} & \begin{tabular}{c} **Number of** \\ **Tests** \\ \end{tabular} & \
\begin{tabular}{c} **Number of** \\ **Gas Bags** \\ \end{tabular} &
\begin{tabular}{c} **Number of** \\ **Tests** \\ \end{tabular} \\ \hline Pregnancy-exhaust & 3 & 3 & 21 & 3 & 20 & 3 & 21 \\ Pregnancy-middle & 3 & 3 & 20 & 3 & 20 \\ Nursery-middle & 3 & 3 & 21 & 3 & 20 & 3 & 21 \\ Nursery-window & 3 & 3 & 20 & 3 & 20 & 3 & 20 \\ \hline \end{tabular}
\end{table} 
Table 2: Gas sample information and number of electronic nose tests for pig house. Figure 4: The average of the maximum voltage calculated from the electronic nose sensor responses. Figure 7 shows the recognition of gases in different spaces of the piggery by LDA when the average value and the maximum value of the features were selected, respectively. The cumulative contribution rates of the first and second discriminant factors in Figure 7a-c are 98.93%, 98.46%, and 98%, respectively. In Figure 7d-f, the cumulative contribution rates of the first and second discriminant factors are 99.74%, 98.36%, and 98.89%, respectively, which can represent most of the characteristics of the sample information. It can be seen from the figure that the samples at different locations overlap, and the distinguishing effect is not good. This is caused by the insignificant gas difference between different locations. Figure 8 shows the results of LDA's recognition of the four samples of the chicken house when the average value and the maximum value were selected, respectively. It can be seen from the figure that LDA fails to distinguish the chicken house samples. In general, LDA can only identify the odor characteristics of the piggery at different times, and it is not effective in identifying samples from different locations in the pig house and chicken house. (2) KNN and SVM analyses  
In order to verify the recognition of gas emission in different times and places from the livestock house by the electronic nose, different recognition models and features were compared. The 10-fold cross-validation was applied to deal with all sample data in the tests. In this method, the data were divided into ten groups and nine groups were separately used as training sets, and the rest were for validation.