Smart Temperature and Humidity Control in Pig House by Improved Three-Way K-Means
Abstract
:1. Introduction
- (1)
- Proposed an improved three-way k-means algorithm TWKS, optimizing the selection of initial cluster centers and enhancing the performance of clustering results.
- (2)
- Using k-means, historical weather data are clustered according to a control strategy. The newly collected weather data are then classified using the K-nearest neighbor algorithm.
- (3)
- Compared to traditional threshold-based control systems, the system proposed in this paper is more intelligent as it eliminates the need for threshold settings and reduces temperature anomaly duration.
- (4)
- The intelligent control system proposed in this paper is experimented within pigsties, but it is also applicable to temperature and humidity control in other livestock buildings such as chicken coops, cowsheds, greenhouses, etc.
2. Materials and Methods
2.1. Temperature and Humidity Control Strategy
2.1.1. Sample Stability
2.1.2. Dividing the Dataset Based on Sample Stability
- (1)
- Calculate the co-occurrence frequency by formula (1) and then construct a relationship matrix P;
- (2)
- Calculate the threshold of the relationship matrix using formula (7) with P as input;
- (3)
- Calculate the stability of each sample in the dataset using formula (3) to obtain the stability set S;
- (4)
- Calculate the stability threshold using formula (7) with S as input;
- (5)
- Kernel datasetOuter dataset .
2.1.3. Three-Way k-Means Algorithm for Optimizing Initial Cluster Centers
Algorithm 1 Improved three-way k-means |
|
2.1.4. Temperature and Humidity Optimization Control Algorithm
- Determine input–output variables of the model.
- Construct three-way clustering on history data, with the number of clusters being the number of temperature and humidity control schemes. After clustering, each cluster represents a temperature and humidity control scheme.
- Using sensors to monitor weather data, such as inside temperature, outside temperature, inside humidity, outside humidity, wind speed, wind direction, surface temperature, and surface pressure, these data are used as input to cluster the data based on the clustering centers of the clustering model. Set a threshold , calculate the affiliation of the input data with the center of each cluster, and select the maximum affiliation to be recorded .
- If is greater than or equal to , then the control state to which the cluster corresponding to belongs is chosen.
- If is less than and greater than or equal to 1, then these input data may belong to the boundary domains of multiple clusters, and all the samples of the boundary domains of clusters whose affiliation with these input data is less than and greater than 1 are used as the classification dataset, and the k-nearest neighbor algorithm is used to classify the input data in terms of the control state.
- If is less than 1, then the data of entire clusters are used as a categorized dataset, and the k-nearest neighbor algorithm is used to categorize the input data in terms of control state.
- Based on the assigned cluster, determine whether temperature and humidity control is required. If not, the program ends; if yes, start or stop the corresponding devices based on the control strategy associated with the cluster.
- Using sensors to monitor weather data, repeat the above process.
2.2. Data Preprocessing
2.2.1. Abnormal Data Handling
2.2.2. Data Normalization
2.3. Experimental Setup
2.3.1. Description of the Experimental Pig House
2.3.2. Description of the Experimental Equipment
2.3.3. Description of the Experimental Site Setting
2.3.4. Description of the Experimental Data
2.3.5. Description of the Clustering Performance Experiments
2.3.6. Description of Control System Experiments
3. Results and Discussions
3.1. Experimental Results of Abnormal Data Detection
3.2. Experimental Results of Clustering Performance
3.3. Experimental Results of Microclimate Control
3.3.1. Experimental Database
3.3.2. Comparative Analyses of the Microclimate inside the Pig House without and with the Control
3.3.3. Comparative Analyses of the Temperature inside the Pig House with Threshold-Based Controller
4. Limitations
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Conflicts of Interest
References
- Quiniou, N.; Noblet, J.; van Milgen, J.; Dubois, S. Modelling heat production and energy balance in group-housed growing pigs exposed to low or high ambient temperatures. Br. J. Nutr. 2001, 85, 97–106. [Google Scholar] [CrossRef] [PubMed]
- Gautam, K.R.; Rong, L.; Zhang, G.Q.; Bjerg, B.S. Temperature distribution in a finisher pig building with hybrid ventilation. Biosyst. Eng. 2020, 200, 123–137. [Google Scholar] [CrossRef]
- Mun, H.S.; Rathnayake, D.; Dilawar, M.A.; gil Jeong, M.; Yang, C.J. Effect of ambient temperature on growth performances, carcass traits and meat quality of pigs. J. Appl. Anim. Res. 2022, 50, 103–108. [Google Scholar] [CrossRef]
- Morales, A.; Cota, S.E.M.; Ibarra, N.O.; Arce, N.; Htoo, J.K.; Cervantes, M. Effect of heat stress on the serum concentrations of free amino acids and some of their metabolites in growing pigs. J. Anim. Sci. 2016, 94, 2835–2842. [Google Scholar] [CrossRef] [PubMed]
- Hörtenhuber, S.J.; Schauberger, G.; Mikovits, C.; Schönhart, M.; Baumgartner, J.; Niebuhr, K.; Piringer, M.; Anders, I.; Andre, K.; Hennig-Pauka, I.; et al. The Effect of Climate Change-Induced Temperature Increase on Performance and Environmental Impact of Intensive Pig Production Systems. Sustainability 2020, 12, 9442. [Google Scholar] [CrossRef]
- Seidel, D.S.; Field, T.C.; Schinckel, A.P.; Stwalley, C.S.; Stwalley, R.M. Effects of temperature probe orientation on the Purdue hog cooling pad data acquisition. Comput. Electron. Agric. 2020, 175, 105609. [Google Scholar] [CrossRef]
- St-Pierre, N.; Cobanov, B.; Schnitkey, G. Economic Losses from Heat Stress by US Livestock Industries. J. Dly. Sci. 2003, 86, 52–77. [Google Scholar] [CrossRef]
- Wang, M.Q.; Li, X.; Larsen, M.L.V.; Liu, D.; Rault, J.L.; Norton, T. A computer vision-based approach for respiration rate monitoring of group housed pigs. Comput. Electron. Agric. 2023, 210, 107899. [Google Scholar] [CrossRef]
- Cao, M.B.; Zong, C.; Zhuang, Y.R.; Teng, G.H.; Zhou, S.N.; Yang, T. Modeling of Heat Stress in Sows Part 2: Comparison of Various Thermal Comfort Indices. Animals 2021, 11, 1498. [Google Scholar] [CrossRef]
- Gourdine, J.L.; Rauw, W.M.; Gilbert, H.; Poullet, N. The Genetics of Thermoregulation in Pigs: A Review. Front. Vet. Sci. 2021, 8, 770480. [Google Scholar] [CrossRef]
- Li, H.; Li, R.; Zhang, G.Q. Numerical study on the convective heat transfer of fattening pig in groups in a mechanical ventilated pig house. Comput. Electron. Agric. 2018, 149, 90–100. [Google Scholar] [CrossRef]
- Kim, B.; Reddy, K.E.; Kim, H.R.; Kim, K.H.; Lee, Y.; Kim, M.; Ji, S.Y.; Lee, S.D.; Jeong, J.Y. Effects of recovery from short-term heat stress exposure on feed intake, plasma amino acid profiles, and metabolites in growing pigs. J. Anim. Sci. Technol. 2021, 63, 531–544. [Google Scholar] [CrossRef] [PubMed]
- Yeo, U.H.; Lee, I.B.; Kim, R.W.; Lee, S.Y.; Kim, J.G. Computational fluid dynamics evaluation of pig house ventilation systems for improving the internal rearing environment. Biosyst. Eng. 2019, 186, 259–278. [Google Scholar] [CrossRef]
- Sun, G.D.; Song, X.; Zou, Y.B.; Teng, T.; Jiang, L.; Shi, B.M. Dietary Glucose Ameliorates Impaired Intestinal Development and Immune Homeostasis Disorders Induced by Chronic Cold Stress in Pig Model. Int. J. Mol. Sci. 2022, 23, 7730. [Google Scholar] [CrossRef]
- Yang, Y.W.; Chen, N.X.; Sun, L.; Zhang, Y.; Wu, Y.B.; Wang, Y.; Liao, X.D.; Mi, J.D. Short-term cold stress can reduce the abundance of antibiotic resistance genes in the cecum and feces in a pig model. J. Hazard. Mater. 2021, 416, 125868. [Google Scholar] [CrossRef]
- Jin, H.; Meng, G.; Pan, Y.Z.; Zhang, X.; Wang, C.D. An Improved Intelligent Control System for Temperature and Humidity in a Pig House. Agriculture 2022, 12, 1987. [Google Scholar] [CrossRef]
- Shin, H.; Kwak, Y.; Jo, S.K.; Kim, S.H.; Huh, J.H. Development of an optimal mechanical ventilation system control strategy based on weather forecasting data for outdoor air cooling in livestock housing. Energy 2023, 268, 126649. [Google Scholar] [CrossRef]
- Cao, M.B.; Zong, C.; Wang, X.S.; Teng, G.H.; Zhuang, Y.R.; Lei, K.D. Numerical simulations of airflow and convective heat transfer of a sow. Biosyst. Eng. 2020, 200, 23–39. [Google Scholar] [CrossRef]
- Schauberger, G.; Schönhart, M.; Zollitsch, W.; Hörtenhuber, S.J.; Kirner, L.; Mikovits, C.; Baumgartner, J.; Piringer, M.; Knauder, W.; Anders, I.; et al. Economic Risk Assessment by Weather-Related Heat Stress Indices for Confined Livestock Buildings: A Case Study for Fattening Pigs in Central Europe. Agriculture 2021, 11, 122. [Google Scholar] [CrossRef]
- Licharz, H.; Rösmann, P.; Krommweh, M.S.; Mostafa, E.; Büscher, W. Energy Efficiency of a Heat Pump System: Case Study in Two Pig Houses. Energies 2020, 13, 662. [Google Scholar] [CrossRef]
- Gomes, J.; Esteves, I.; Graciano Neto, V.V.; David, J.M.N.; Braga, R.; Arbex, W.; Kassab, M.; de Oliveira, R.F. A scientific software ecosystem architecture for the livestock domain. Inf. Softw. Technol. 2023, 160, 107240. [Google Scholar] [CrossRef]
- Havelka, Z.; Kunes, R.; Kononets, Y.; Stokes, J.E.; Smutny, L.; Olsan, P.; Kresan, J.; Stehlik, R.; Bartos, P.; Xiao, M.; et al. Technology of Microclimate Regulation in Organic and Energy-Sustainable Livestock Production. Agriculture 2022, 12, 1563. [Google Scholar] [CrossRef]
- Huang, T.; Zhang, G.Q.; Brandt, P.; Bjerg, B.; Pedersen, P.; Rong, L. An effective temperature derived from a mechanistic thermophysiological model for sows reared in hot climates. Biosyst. Eng. 2022, 220, 19–38. [Google Scholar] [CrossRef]
- Costantino, A.; Fabrizio, E.; Ghiggini, A.; Bariani, M. Climate control in broiler houses: A thermal model for the calculation of the energy use and indoor environmental conditions. Energy Build. 2018, 169, 110–126. [Google Scholar] [CrossRef]
- Kpodo, K.R.; Duttlinger, A.W.; Maskal, J.M.; McConn, B.R.; Johnson, J.S. Effects of Feed Removal during Acute Heat Stress on the Cytokine Response and Short-Term Growth Performance in Finishing Pigs. Animals 2021, 11, 205. [Google Scholar] [CrossRef] [PubMed]
- Kroscher, K.A.; Fausnacht, D.W.; McMillan, R.P.; El-Kadi, S.W.; Wall, E.H.; Bravo, D.M.; Rhoads, R.P. Supplementation with artificial sweetener and capsaicin alters metabolic flexibility and performance in heat-stressed and feed-restricted pigs. J. Anim. Sci. 2022, 100, skac195. [Google Scholar] [CrossRef] [PubMed]
- Ulpiani, G.; Borgognoni, M.; Romagnoli, A.; Di Perna, C. Comparing the performance of on/off, PID and fuzzy controllers applied to the heating system of an energy-efficient building. Energy Build. 2016, 116, 1–17. [Google Scholar] [CrossRef]
- Xie, Q.; Su, Z.; Ni, J.; Zheng, P. Control system design and control strategy of multiple environmental factors in confined swine building. Trans. Chin. Soc. Agric. Eng. 2017, 33, 163–170. [Google Scholar]
- Gao, L.A.; Er, M.W.; Li, L.H.; Wen, P.; Jia, Y.C.; Huo, L.M. Microclimate environment model construction and control strategy of enclosed laying brooder house. Poult. Sci. 2022, 101, 101843. [Google Scholar] [CrossRef]
- Xie, Q.J.; Ni, J.Q.; Bao, J.; Su, Z.B. A thermal environmental model for indoor air temperature prediction and energy consumption in pig building. Build. Environ. 2019, 161, 106238. [Google Scholar] [CrossRef]
- Li, B.; Wang, Y.; Zheng, W.; Tong, Q. Research progress in environmental control key technologies, facilities and equipment for laying hen production in China. Trans. Chin. Soc. Agric. Eng. 2020, 36, 212–221. [Google Scholar]
- Tikhomirov, D.A.; Trunov, S.S.; Kuzmichev, A.V.; Rastimeshin, S.; Shepovalova, O. Energy-efficient thermoelectric unit for microclimate control on cattle breeding premises. Energy Rep. 2020, 6, 293–305. [Google Scholar] [CrossRef]
- Du, Q.; Miao, Y.; Zhang, Y. Design of intelligent monitoring system of chicken house environment based on single-chip microcomputer. MATEC Web Conf. 2018, 227, 02008. [Google Scholar] [CrossRef]
- Li, F.J.; Qian, Y.H.; Wang, J.T.; Dang, C.Y.; Jing, L.P. Clustering ensemble based on sample’s stability. Artif. Intell. 2019, 273, 37–55. [Google Scholar] [CrossRef]
- Otsu, N. A Threshold Selection Method from Gray-Level Histograms. Automatica 1975, 11, 23–27. [Google Scholar] [CrossRef]
- Naghavi Nozad, S.A.; Amir Haeri, M.; Folino, G. SDCOR: Scalable density-based clustering for local outlier detection in massive-scale datasets. Knowl.-Based Syst. 2021, 228, 107256. [Google Scholar] [CrossRef]
- Abhaya, A.; Patra, B.K. RDPOD: An unsupervised approach for outlier detection. Neural Comput. Appl. 2022, 34, 1065–1077. [Google Scholar] [CrossRef]
- Toller, M.B.; Geiger, B.C.; Kern, R. Cluster Purging: Efficient Outlier Detection Based on Rate-Distortion Theory. IEEE Trans. Knowl. Data Eng. 2023, 35, 1270–1282. [Google Scholar] [CrossRef]
- Huang, J.W.; Zhong, M.X.; Jaysawal, B.P. TADILOF: Time Aware Density-Based Incremental Local Outlier Detection in Data Streams. Sensors 2020, 20, 5829. [Google Scholar] [CrossRef]
- Riahi-Madvar, M.; Akbari Azirani, A.; Nasersharif, B.; Raahemi, B. A new density-based subspace selection method using mutual information for high dimensional outlier detection. Knowl.-Based Syst. 2021, 216, 106733. [Google Scholar] [CrossRef]
- Hariri, S.; Kind, M.C.; Brunner, R.J. Extended Isolation Forest. IEEE Trans. Knowl. Data Eng. 2021, 33, 1479–1489. [Google Scholar] [CrossRef]
- Guo, Q.H.; Yin, Z.Y.; Wang, P.X. An Improved Three-Way K-Means Algorithm by Optimizing Cluster Centers. Symmetry 2022, 14, 1821. [Google Scholar] [CrossRef]
- Jiang, C.M.; Li, Z.C.; Yao, J.T. A shadowed set-based three-way clustering ensemble approach. Int. J. Mach. Learn. Cybern. 2022, 13, 2545–2558. [Google Scholar] [CrossRef]
- Rousseeuw, P.J. Silhouettes: A graphical aid to the interpretation and validation of cluster analysis. J. Comput. Appl. Math. 1987, 20, 53–65. [Google Scholar] [CrossRef]
- Wang, P.X.; Yang, X.B. Three-Way Clustering Method Based on Stability Theory. IEEE Access 2021, 9, 33944–33953. [Google Scholar] [CrossRef]
- Kim, J.G.; Lee, S.Y.; Lee, I.B. The Development of an LSTM Model to Predict Time Series Missing Data of Air Temperature inside Fattening Pig Houses. Agriculture 2023, 13, 795. [Google Scholar] [CrossRef]
Datasets Ratio | Samples | Attributes | Classes |
---|---|---|---|
Iris | 140 | 4 | 3 |
Wine | 178 | 13 | 3 |
Glass | 214 | 9 | 7 |
Cancer | 116 | 9 | 2 |
Sonar | 208 | 60 | 2 |
Bank | 1372 | 4 | 2 |
Outliers Ratio | Temperature Accuracy | Humidity Accuracy |
---|---|---|
0∼1% | 99.92% | 98.89% |
1∼3% | 98.37% | 97.99% |
3∼5% | 96.84% | 95.26% |
5∼10% | 87.61% | 83.44% |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Li, H.; Li, H.; Li, B.; Shao, J.; Song, Y.; Liu, Z. Smart Temperature and Humidity Control in Pig House by Improved Three-Way K-Means. Agriculture 2023, 13, 2020. https://doi.org/10.3390/agriculture13102020
Li H, Li H, Li B, Shao J, Song Y, Liu Z. Smart Temperature and Humidity Control in Pig House by Improved Three-Way K-Means. Agriculture. 2023; 13(10):2020. https://doi.org/10.3390/agriculture13102020
Chicago/Turabian StyleLi, Haopu, Haoming Li, Bugao Li, Jiayuan Shao, Yanbo Song, and Zhenyu Liu. 2023. "Smart Temperature and Humidity Control in Pig House by Improved Three-Way K-Means" Agriculture 13, no. 10: 2020. https://doi.org/10.3390/agriculture13102020