Zing Forum

Reading

Machine Learning Solution for Predicting Vertical Farming Cube Hatch Status Using Temperature and Humidity Sensors

This article introduces a practical project applying machine learning to vertical farming environments, predicting the open/closed status of planting hatch doors using temperature and humidity sensor data, and comparing the performance of three algorithms: Random Forest, Support Vector Machine (SVM), and XGBoost.

垂直农业机器学习传感器数据分类模型支持向量机随机森林XGBoost智能农业物联网
Published 2026-06-01 08:46Recent activity 2026-06-01 08:48Estimated read 4 min
Machine Learning Solution for Predicting Vertical Farming Cube Hatch Status Using Temperature and Humidity Sensors
1

Section 01

Introduction: Machine Learning Solution for Predicting Vertical Farming Hatch Status Using Temperature and Humidity Sensors

This project aims to predict the open/closed status of vertical farming cube hatch doors using temperature and humidity sensor data, and compare the performance of three algorithms: Random Forest, Support Vector Machine (SVM), and XGBoost. The results show that SVM performs best with an accuracy of 99.36%, providing technical support for the intelligence of vertical farming.

2

Section 02

Project Background and Core Objectives

Vertical farming has high requirements for environmental stability, and the hatch status affects temperature and humidity balance as well as energy consumption. Traditional manual inspection is inefficient. The goal of this project is to build a machine learning classification model to automatically predict the open/closed status of hatches, supporting intelligent agricultural applications such as automated control and anomaly detection.

3

Section 03

Dataset and Model Training Methods

The dataset contains 32,000 records. Input features include Cube ID, temperature and humidity of layers A/B, and timestamp. The target variable is the hatch status (0 for closed / 1 for open). Feature engineering steps: convert timestamp to Unix format, apply Min-Max normalization to numerical features. EDA analysis confirms that there are learnable patterns between temperature/humidity and hatch status. The models selected are Random Forest, SVM, and XGBoost, and the dataset is split into training/test sets in an 8:2 ratio.

4

Section 04

Model Performance Evaluation Results

Performance comparison of three models:

Model Accuracy Precision Recall F1 Score
Random Forest 99.20% 99.12% 99.27% 99.20%
SVM 99.36% 99.37% 99.34% 99.35%
XGBoost 99.23% 99.24% 99.21% 99.23%
SVM has the best overall performance. Confusion matrix analysis shows that the model performs balanced in predicting both classes.
5

Section 05

Application Value and Future Expansion Directions

Application Value: Automated hatch control, energy consumption optimization, anomaly detection, intelligent agriculture integration. Future Expansion: Introduce light/CO₂ sensors, combine with time-series models, explore the performance of deep learning on large-scale data.

6

Section 06

Project Summary

This project completes a full machine learning workflow from data preprocessing to multi-model comparison, building a hatch status prediction model with an accuracy of over 99%, where SVM performs best. This solution provides a feasible path for the intelligent upgrade of vertical farming and demonstrates the application potential of machine learning in the traditional agricultural field.