Mihai Gabriel MATACHE, Carmen BĂLȚATU, Dragoș SĂCĂLEANU, Adrian IOSIF, T. A. Ene, Cristina Dobre
Control of greenhouse microclimate requires the interpretation of several environmental and substrate-related parameters, including air temperature, relative humidity, light intensity, carbon dioxide concentration and soil moisture. This paper compares three machine learning models, Random Forest, Extreme Gradient Boosting (XGBoost) and a multilayer perceptron (MLP), for 30-minute-ahead prediction of irrigation, ventilation and shading states in a greenhouse. The models were trained using data collected from a wireless sensor network (WSN) with four sensor nodes installed in the protected cultivation area. After preprocessing, scaling, error removal, temporal synchronization and resampling at 10-minute intervals, a structured dataset of 7063 records was obtained. Individual sensor readings, spatially aggregated variables, time-related features, rolling averages and short-term differences were used to describe both the current and recent evolution of the greenhouse environment. The dataset was split chronologically into training, validation and test subsets, corresponding to 70%, 15% and 15% of the records, respectively, while preserving the temporal order of the measurements. The best average performance was obtained by XGBoost, with a mean F1-score of 0.9237, followed by Random Forest with 0.9045 and MLP with 0.5862. Random Forest achieved the best results for irrigation and ventilation control, with F1-scores of 0.9630 and 0.9611, respectively, while XGBoost achieved the best result for shading control, with an F1-score of 0.8571. XGBoost also achieved the highest mean accuracy, 0.9506, and mean balanced accuracy, 0.8904. The results indicate that tree-based ensemble models are more suitable than the tested MLP architecture for predictive greenhouse control based on multi-sensor WSN data. The proposed framework supports the selection of a final control model according to prediction performance, stability and interpretability.