Abstract:
Large-scale greenhouses rely on a variety of environmental control equipment, such as skylights, side windows, shade nets, negative-pressure fans and circulation fans, to regulate temperature, humidity and light. In current production systems, however, the operation status of such equipment is rarely fed back in real time: limit switches only report discrete open and closed states and cannot indicate the actual motion of the driven parts, whereas continuously running fans provide no status signal at all. As a result, control decisions may deviate from the real equipment condition, which reduces the reliability of greenhouse environmental control. To address this problem, this study developed a digital twin system for greenhouse environmental control equipment driven by virtual-real fusion, with the aim of realizing real-time monitoring and fault warning of equipment operation status. A two-stage visual detection framework integrating machine vision and deep learning was proposed for equipment type recognition and operation status detection. In the first stage, the YOLO (You Only Look Once) v8n algorithm was employed to build a recognition model for four categories of equipment, namely negative-pressure fans, skylights, shade nets and circulation fans, and the detected regions were then segmented to remove background interference. In the second stage, detection strategies were selected according to the motion characteristics of each equipment category. Negative-pressure fans exhibit an evident difference in light transmission between the open and closed states of their louvers, and were therefore assessed with the YOLOv8n model. Skylights are driven by a push rod through a linkage mechanism and show distinct pose changes, so the YOLOv8n-Pose model was used to locate the two endpoints of the push rod, from which the rod slope and the corresponding opening angle were derived. Shade nets and circulation fans undergo translation or rotation during operation, for which the frame difference method was adopted, and an independent HSV (hue, saturation, value) background model was built for each device to reduce the interference caused by overlapping displacement between adjacent frames. To couple the physical and virtual spaces, a virtual camera with the same installation position and field-of-view parameters as the physical camera was deployed in the digital twin scene, and a spatial mapping between the two cameras was established to achieve automatic matching and numbering of the equipment recognized within the physical field of view. The detected status parameters were then written into the knowledge graph of the virtual model, which drove dynamic updating of the digital twin. Furthermore, the equipment status obtained through virtual-real fusion was compared with the target status implied by the control commands issued by the environmental control decision model. Consistent results allowed the next control and monitoring cycle to proceed, whereas inconsistent results triggered a fault alarm that was annotated on the digital twin visualization panel. Experimental results showed that the equipment type recognition model achieved a mean average precision of 99.5% at an intersection over union threshold of 0.5 (mAP@0.5). In operation status detection, the YOLOv8n model for negative-pressure fans achieved an mAP@0.5 of 91.0%, the YOLOv8n-Pose model for skylight opening reached an mAP@0.5 of 99.5%, and the frame difference method attained detection accuracies of 96.3% and 95.9% for shade nets and circulation fans, respectively. The proposed system enables synchronous monitoring of the operation status of physical equipment and their virtual counterparts, provides fault alarms when control commands and actual states diverge, and offers a technical basis for intelligent greenhouse management driven by twin data.