Next Article in Journal
Soil Texture Mediates the Short-Term Influence of Wheat Straw Biochar Amendment on Crop Yield and Soil Bacterial Community
Previous Article in Journal
Synergistic Effects of Pulsed Electric Field (PEF) Intensity and Malaxation Time on the Extraction Yield and Quality of ‘Picual’ and ‘Arbequina’ Virgin Olive Oils
Previous Article in Special Issue
Potato-Free: Eliminating Model Training for Disease Detection and Localization in Potato Tubers
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Development of a Vision-Based Growth-Stage Determination and PLC-Based Fertigation Parameter Invocation System for Greenhouse Blueberry

Yunnan International Joint Laboratory of Intelligent Crop Production, Yunnan Agricultural University, Kunming 650201, China
*
Author to whom correspondence should be addressed.
Agriculture 2026, 16(15), 1638; https://doi.org/10.3390/agriculture16151638
Submission received: 12 May 2026 / Revised: 11 July 2026 / Accepted: 27 July 2026 / Published: 30 July 2026

Abstract

To address the difficulty of directly incorporating crop growth-stage information into industrial control processes and the limited adaptability of control parameters to different developmental stages in conventional greenhouse fertigation management, this study developed a vision-based growth-stage determination and PLC-based fertigation parameter invocation system for greenhouse blueberry cultivation. The system integrated greenhouse blueberry image acquisition, edge-based visual recognition, STM32-based encoding conversion, PLC control, human–machine interaction, and actuator linkage. Image samples were collected from greenhouse blueberry plants, whereas system-level linkage verification was conducted on a small greenhouse prototype platform. The edge vision module was used to output preliminary blueberry growth-stage labels, while environmental and substrate sensor data were used for sensor status verification and control safety validation. The final growth-stage label was converted by the STM32 unit into a discrete coded signal and then transmitted to the PLC. Based on a predefined stage-strategy table, the PLC invoked the corresponding target parameters and drove the irrigation, fertilizer delivery, supplemental lighting, ventilation, and shading devices for coordinated control. The image-level stage classification evaluation based on an independent test set showed that different lightweight YOLO classification models exhibited different performance levels in identifying the major growth stages of blueberry. YOLO11n-cls achieved the highest Accuracy and Macro F1-score, reaching 85.71% and 84.81%, respectively. YOLOv8n-cls achieved an Accuracy, Macro F1-score, and Macro AP of 80.95%, 81.10%, and 91.25%, respectively, showing a favorable balance between model size and recognition performance. The confusion matrix indicated that misclassifications mainly occurred between the fruit expansion stage and the ripening stage, reflecting the morphological continuity of blueberry fruit development during the transitional period. The system linkage test results showed that blueberry growth-stage labels could be output by the edge vision terminal, converted by the STM32 unit, read by the PLC, and used for stage-specific target parameter invocation. Sensor acquisition, HMI display, and actuator response were completed cooperatively. The single determination and output time of the edge terminal was 500–1000 ms, and the remote-control response delay was 0.3–1.0 s. No obvious communication interruption, command loss, or abnormal shutdown occurred during system operation. These results indicate that blueberry growth-stage recognition results can serve as input conditions for PLC parameter invocation and device-control testing on a small greenhouse prototype platform. This study did not conduct a complete closed-loop cultivation experiment under real production greenhouse conditions or establish long-term blueberry cultivation control treatments. Therefore, no quantitative conclusions are drawn regarding water and fertilizer use efficiency, fertilizer application reduction, plant physiological responses, yield, or fruit quality improvement.

1. Introduction

Protected greenhouses can effectively reduce the adverse effects of external environmental fluctuations on crop growth, yield, and quality by regulating key factors such as temperature, humidity, light, irrigation, and fertilization. With the development of protected agriculture toward digitalization, precision management, and intelligent control, greenhouse management based on multi-sensor perception and intelligent decision-making has become an important direction in protected cultivation [1]. Blueberry is a shallow-rooted berry crop that is sensitive to changes in the root-zone water and nutrient environment, and its water and nutrient requirements vary considerably across growth stages. The timeliness and precision of water and nutrient supply directly affect plant physiological status, fruit yield, and fruit quality [2]. Previous studies have shown that substrate composition significantly affects blueberry plant growth, physiological responses, and fruit development [3]. In addition, digital irrigation tools have shown promising potential for water saving and efficiency improvement in berry crop production [4]. Therefore, developing greenhouse fertigation strategies that can be dynamically adjusted according to blueberry growth status has potential application value for subsequent resource-use optimization, improved fertigation management, and fruit-quality maintenance.
In recent years, greenhouse fertigation technology has gradually shifted from traditional scheduled and fixed-amount supply toward precision regulation based on real-time monitoring and intelligent decision-making [5,6]. The development of drip fertigation, multi-sensor management systems, and smart irrigation methods has provided an engineering basis for greenhouse environmental regulation and fertigation management [7,8]. Meanwhile, greenhouse control studies based on fuzzy control, model predictive control, and data-driven methods have continued to develop, providing new technical approaches for the precision management of different crops [9,10,11]. However, most existing systems still mainly rely on fixed thresholds of environmental or substrate parameters for control, and their control logic remains essentially parameter-driven [5,12]. For blueberry, a crop with distinct growth-stage differences and high sensitivity to the root-zone environment, long-term use of uniform thresholds or fixed fertigation recipes may lead to mismatches between supply and plant developmental requirements, thereby affecting plant growth, fruit yield, and quality [2,3]. Therefore, incorporating crop growth-stage information into the fertigation control process is a key issue for improving the stage-specific management of greenhouse blueberry fertigation.
Crop growth-stage information serves as an important link between crop status perception and precision regulation. Blueberry growth and development have a relatively clear basis for stage division, and stages such as bud development, flowering, fruit development, and ripening can be standardized using the BBCH scale [13]. Compared with relying solely on environmental and substrate parameters, visual information can more directly characterize canopy morphology, leaf status, and fruit developmental features; therefore, it has particular advantages in growth-stage recognition. In recent years, deep learning and computer vision technologies have gradually expanded from general object detection to crop phenology classification and growth-stage determination. Related studies have shown that vision-based stage recognition has considerable application potential in crop precision management [14,15]. Meanwhile, studies on deep learning-based image segmentation and visual perception have shown that complex backgrounds, ambiguous object boundaries, variations in annotation quality, limited sample sizes, and real-time deployment requirements remain key factors constraining the reliable application of visual models in engineering scenarios [16]. At the same time, the development of edge computing enables visual models to be deployed and inferred close to the data source, reducing network dependence while improving recognition timeliness. This provides technical conditions for online crop status perception in greenhouse scenarios [16,17]. However, in practical applications, recognition results based on a single visual source remain susceptible to illumination variation, local occlusion, background interference, and indistinct transitional-stage features, which may cause fluctuations in stage determination. By contrast, environmental and substrate sensor data, such as temperature, humidity, light intensity, soil temperature and moisture, EC, and pH, can provide auxiliary characterization of crop growth from the perspectives of the environment and root-zone status. Therefore, combining visual recognition results with sensor data for growth-stage determination and parameter calling can help improve the stability of growth-stage labels and their applicability in the control process. Therefore, before the vision-based recognition results are used for PLC parameter invocation, sensor status verification, anomaly detection, and temporal consistency constraints are introduced to improve the stability and usability of the growth stage labels during control operation.
From the perspective of intelligent greenhouse management, research is gradually shifting from single-factor environmental monitoring or localized automated control toward system-level integration jointly enabled by multi-source information and edge computing. Studies on data-driven modeling for complex industrial processes have shown that, under conditions characterized by strong noise, high dimensionality, time-varying behavior, and multi-sensor correlations, a single data source or model is often insufficient to adequately represent the system state. Feature extraction, uncertainty handling, and multi-source information modeling are therefore required to improve model interpretability and engineering applicability [18,19]. Within this context, the reliable incorporation of crop status information into control decisions and its subsequent use in stage-specific irrigation and fertigation parameter adjustment remain important challenges in intelligent control for protected agriculture. Meanwhile, the integration of edge-intelligent control and machine vision with industrial control systems can support real-time decision-making in both agricultural and industrial applications [20]. However, research on fertigation management methods that link blueberry growth stage identification with PLC-based control remains limited in greenhouse blueberry production. In particular, a clearly defined implementation pathway is still lacking for integrating sensor information with vision-based recognition to perform sensor status verification and control safety validation, using the finalized growth stage label to invoke the corresponding stage-specific parameters in the PLC, and simultaneously ensuring system real-time performance, stability, and operational safety.
Based on the above considerations, this study developed a vision-based blueberry growth-stage determination and PLC-based fertigation parameter invocation system for greenhouse blueberry cultivation. The focus of this study was not to propose a new object-detection algorithm, nor to evaluate the long-term agronomic effects of fertigation control on blueberry yield, quality, or water–fertilizer use efficiency. Instead, the objective was to verify whether blueberry growth-stage labels could be stably output by an edge vision terminal, converted through STM32-based encoding, and then introduced into the PLC control layer for stage-specific target parameter invocation and actuation-device response. The specific objectives were as follows:
  • To construct major growth-stage labels based on images of greenhouse blueberry plants;
  • To establish the correspondence among the major blueberry growth stages, BBCH codes, morphological determination criteria, and PLC-based parameter invocation targets;
  • To conduct image-level stage classification evaluation and compare the performance of different lightweight YOLO classification models in blueberry growth-stage recognition;
  • To construct a small greenhouse prototype system consisting of a K210 vision module, an STM32 encoding unit, a PLC controller, an HMI interface, and fertigation actuation devices;
  • To verify the operational performance of growth-stage recognition results after STM32-based encoding and PLC input, as well as their participation in stage-specific parameter invocation and device control.

2. Materials and Methods

2.1. System Framework and Experimental Platform

This study focused on the engineering implementation process by which blueberry growth-stage recognition results were introduced into the PLC control link. The work mainly consisted of three components: image dataset construction, visual model evaluation, and prototype-platform linkage verification. First, image acquisition, sample screening, stage-label construction, and image-level recognition dataset establishment were conducted based on greenhouse blueberry plants. Subsequently, an independent test set was used to evaluate the stage-recognition performance of different lightweight YOLO classification models. Finally, a small greenhouse prototype platform was used to verify the feasibility of introducing stage labels into the PLC after STM32-based encoding and using them for fertigation target-parameter invocation and actuator linkage control. Experimental platform construction, system debugging, image data acquisition, sensor data collection, visual model evaluation, and system operation testing were conducted from July 2024 to June 2025.
Image acquisition was carried out in the intelligent greenhouse blueberry cultivation environment of Yunnan Agricultural University. The target plants were potted greenhouse blueberries of the F6 cultivar. Image acquisition covered four major growth stages, namely the budding stage, flowering and fruit-setting stage, fruit expansion stage, and ripening stage. During image collection, conditions including natural light, greenhouse supplementary lighting, local shading, and different shooting angles were covered as much as possible. The image backgrounds mainly included blueberry plants, cultivation substrate, pots, drip irrigation pipelines, greenhouse support structures, and local equipment backgrounds. In the actual acquisition process, some samples contained leaf occlusion, fruit-cluster overlap, branch crossing, and background interference. These samples were retained in the dataset after screening to improve the adaptability of the model to complex greenhouse backgrounds.
The blueberry cultivation substrate was coconut coir:peat:perlite = 2:1:1. Previous studies have shown that substrate components such as peat, coconut coir, and perlite can affect the root-zone physicochemical environment, plant growth, and mineral nutrient uptake of highbush blueberry; therefore, substrate composition is an important condition that should be specified in potted blueberry and protected cultivation studies [19]. Drip irrigation was used as the main irrigation method. A fertigation mixing and delivery unit was installed in the prototype system to simulate irrigation and fertilizer-solution delivery processes at different growth stages. Because this study did not conduct a long-term cultivation control experiment under real production greenhouse conditions, no agronomic treatment replicates were established. The repeated tests described in this study refer mainly to multiple system-level debugging tests involving growth-stage label input, PLC reading, target-parameter calling, and device response.
System implementation and operation testing were conducted on the small greenhouse prototype platform. The platform consisted of a simulated greenhouse unit, a fertigation mixing and delivery unit, a control cabinet, a PLC controller, an STM32 encoding unit, an HMI interface, and actuation devices. It was mainly used to test whether the blueberry growth-stage labels output by the vision terminal could be converted by the STM32 unit, read by the PLC, and further used to complete stage-specific parameter calling and device response.
This part of the test was used only to determine whether information transfer among the hardware modules, PLC parameter calling, and device actions could be completed normally. It cannot replace long-term closed-loop agronomic experiments under real blueberry cultivation conditions. Therefore, the system connectivity test was not interpreted as evidence of improvements in water–fertilizer use efficiency, yield, fruit quality, or plant physiological responses.
The system mainly consisted of four layers: the sensor information acquisition layer, the growth-stage determination layer, the PLC control and actuation layer, and the human–machine interaction layer. The overall architecture is shown in Figure 1.
The sensor information acquisition layer was used to obtain greenhouse environmental parameters, substrate parameters, and blueberry image information. The growth-stage determination layer was centered on the K210 vision module, which performed preliminary stage determination of blueberry images. The final growth-stage label was then obtained by integrating sensor status, stage-order constraints, and temporal consistency rules. The PLC control and actuation layer called the corresponding fertigation target parameters according to the growth-stage label and drove the irrigation, fertilization, supplementary lighting, ventilation, and shading devices. The human–machine interaction layer was used for stage display, parameter setting, alarm notification, and control-mode switching.
Figure 1 mainly illustrates the internal information-transfer relationship of the system. Blueberry images were acquired and recognized by the K210 vision module, and the stage result was converted by the STM32 unit into a discrete coded signal readable by the PLC. Environmental and substrate sensor data were used, on the one hand, for PLC operation monitoring and, on the other hand, for sensor status verification and control safety assessment of the growth stage labels. After reading the stage code and sensor data, the PLC called the target parameters according to the predefined stage-strategy table and fed the control results back to the HMI interface for display.
The experimental platform consisted of a greenhouse experimental unit, a fertigation mixing and delivery unit, a control cabinet, and a human–machine interaction unit.
The layout of the greenhouse experimental unit is shown in Figure 2. The unit was equipped with a temperature and humidity sensor, a light-intensity sensor, a soil multi-parameter sensor, supplementary lighting lamps, a shade curtain, inlet and outlet ventilation fans, a drip irrigation device, and a sprinkler irrigation device.
The layout of the fertigation mixing and delivery unit is shown in Figure 3. It consisted of components such as a clean-water inlet, fertilizer solution tanks, a fertilizer-mixing pump, a mixing tank, solenoid valves, a flowmeter, and water pumps.
The layout of the control cabinet is shown in Figure 4. It integrated the PLC, STM32 unit, relay modules, power supply module, stepper motor control module, and HMI touch screen, and was used for recognition-result input, logic operation, status display, and execution control.

2.2. System Workflow

The system operation mainly included five steps: data acquisition, growth-stage determination, strategy matching, control execution, and feedback correction. The workflow is shown in Figure 5. First, the environmental and substrate sensors collected information including air temperature and humidity, light intensity, soil temperature and moisture, EC, pH, and N/P/K. Meanwhile, the K210 vision module acquired blueberry plant images and output the candidate growth stage and its confidence value.
Figure 5 illustrates the workflow of blueberry growth-stage label determination, temporal consistency correction, and PLC parameter calling. The system first acquired environmental, substrate, and image information, and the K210 vision module output the candidate stage label and confidence value. After confidence-threshold filtering, sensor status verification, stage-order constraint checking, and temporal consistency verification over three consecutive cycles, the final growth-stage label was converted by the STM32 unit into an 8421 code and transmitted to the PLC. The PLC then called the corresponding target ranges of soil moisture, EC, and pH according to the stage-strategy table and drove the irrigation, fertilization, supplementary lighting, ventilation, and shading devices to respond accordingly.
Before the candidate stage label entered the control system, it was processed through confidence filtering, sensor status verification, stage-order constraints, and temporal consistency checking. In this study, the confidence threshold for visual recognition was set to 0.60, and the growth-stage label output period was set to 1 s. The final growth-stage label was updated only when the same candidate stage satisfied both the confidence threshold and the stage-order constraint for three consecutive determination cycles. When low-confidence recognition, stage regression, cross-stage jumping, or sensor abnormality occurred, the system retained the previous valid stage label.
The final growth-stage label was transmitted from the K210 module to the STM32 unit through a UART serial interface. The STM32 unit converted the stage character into a discrete 8421-coded signal and sent it to the PLC digital input terminals through the GPIOA PA0–PA3 pins. After reading the stage status, the PLC called the corresponding target ranges of soil moisture, EC, and pH according to the stage-strategy table and output control commands for irrigation, fertilization, supplementary lighting, ventilation, and shading based on real-time sensor data. After execution, sensor data and HMI status display were used for subsequent operation monitoring and abnormality judgment.

2.3. Blueberry Growth-Stage Division and Correspondence with BBCH Codes

Blueberry growth and development are continuous processes, whereas the PLC control system requires discrete stage labels as the basis for parameter calling. Therefore, this study did not adopt all detailed substages of the complete BBCH system. Instead, based on the BBCH phenological description of highbush blueberry, the developmental processes closely related to greenhouse fertigation parameter calling were grouped into four control-oriented stages: the budding stage, flowering and fruit-setting stage, fruit expansion stage, and ripening stage. This classification represents a coarse-grained stage grouping for control applications. Its purpose was to provide stable and recognizable stage labels for PLC-based target parameter calling at different stages, rather than to replace a complete field phenological survey.
The BBCH system for highbush blueberry provides coded descriptions of bud development, inflorescence development, flowering, fruit development, and fruit ripening. By considering the visually observable morphological features of greenhouse blueberry and the requirements of fertigation parameter calling, this study established an approximate correspondence between the four recognition stages and BBCH codes, as shown in Table 1. Because phenological progress can be affected by blueberry cultivar, greenhouse environment, pruning practice, and cultivation season, the BBCH code ranges listed in Table 1 were used for stage-label grouping and PLC parameter calling, rather than as the sole criterion for detailed phenological investigation.

2.4. Fertigation Parameter Invocation Targets for Different Blueberry Growth Stages

In this study, fertigation mainly refers to the coordinated management of water supply and fertilizer-solution delivery through the irrigation pipeline. The PLC did not directly evaluate the agronomic effects of fertigation. Instead, it called the corresponding target ranges of soil moisture, EC, and pH according to the blueberry growth-stage labels and drove the irrigation, fertilization, and related environmental control devices to respond accordingly.
Blueberry plants have different requirements for root-zone moisture, nutrient supply, and environmental conditions at different growth stages. Long-term use of uniform thresholds or fixed recipes may cause mismatches between supply and plant developmental requirements across stages. Therefore, based on blueberry phenological development, stage-specific phenotypic characteristics, relevant cultivation literature, greenhouse management experience, and preliminary system operation, this study established a stage-specific fertigation target-parameter table for PLC parameter invocation. Previous studies have shown that highbush blueberry is sensitive to the acidic root-zone environment, fertilizer-solution pH, EC, and drip fertigation management. Appropriate water and nutrient supply, together with pH regulation, is therefore an important component of blueberry protected cultivation management [20,21,22,23].
The parameters listed in Table 2 are the working target ranges used for PLC-based stage-specific parameter invocation in the proposed system, rather than optimal fertigation parameters obtained from long-term optimization experiments. Their determination mainly integrated the acid substrate requirement of blueberry, differences in water and nutrient demands among phenological stages, existing cultivation studies, greenhouse management experience, and preliminary system operation. This study only verified whether the growth stage labels could be input into the PLC to complete target parameter invocation and actuator response; therefore, no conclusion is drawn regarding the agronomic optimality of these parameters. When a new growth stage label is output by the system, the PLC invokes the corresponding target parameter set for that stage and uses it as the reference basis for subsequent irrigation, fertilization, and environmental regulation.

2.5. Key Hardware and Multi-Source Sensing Configuration

The controller used in this study was a Siemens S7-200 SMART PLC (Siemens AG, Munich, Germany), model ST40 DC/DC/DC, with 24 digital input points and 16 digital output points. The expansion components included an EM DT08 module and an SB CM01 communication expansion board. PLC program development was performed using STEP 7-MicroWIN SMART software (v2.8). The edge visual recognition hardware consisted of a K210 vision camera (Canaan Inc., Beijing, China), and the K210-side program was developed using CanMV (v2.9.2). The intermediate control unit adopted an STM32F103C8T6 (STMicroelectronics, Geneva, Switzerland) microcontroller, and the STM32 program was developed using Keil uVision5 (v5.60).
The environmental monitoring unit mainly included an air temperature and humidity sensor and a light intensity sensor. The temperature and humidity sensor (Jinan Zhaotaisheng Electronic Technology Co., Ltd., Jinan, China) had a temperature measurement range of −30–70 °C and a humidity measurement range of 0–100% RH, with measurement accuracies of ±0.2 °C and ±3% RH, respectively. Its supply voltage was 5–24 V DC, and the communication interface was RS485. The light intensity sensor (Weihai JXCT Electronic Technology Co., Ltd., Weihai, China) had a supply voltage of 12–24 V DC, a measurement range of 0–65,535 Lux, a measurement error of no more than ±5%, and an RS485 communication interface. The substrate monitoring unit used a soil multi-parameter sensor (Hangzhou Vemsee Technology Co., Ltd., Hangzhou, China) to collect soil moisture, soil temperature, electrical conductivity, pH, and nitrogen, phosphorus, and potassium contents. The sensor had an IP68 protection rating, a moisture measurement range of 0–100%, a temperature measurement range of −40 to 80 °C, an electrical conductivity measurement range of 0–10,000 μS/cm, and a pH measurement accuracy of ±0.3. RS485 communication was used for data transmission.
The execution layer was equipped with electromagnetic valves, water pumps, a fertilizer-mixing tank, a stirring tank, drip irrigation pipelines, and a sprinkler irrigation device. Material suction, stirring, and irrigation were driven by three 12 V DC water pumps. The Hall-effect water flow sensor was model USN-HS06PS (Shandong Xinzhun Electronic Technology Co., Ltd., Jinan, China), with an operating voltage of 5–24 V DC and a measurement range of 0.1–1.5 L/min. The sprinkler irrigation device was driven by a stepper motor, the shading curtain was driven by a DC geared motor, and the ventilation unit used DC fans.
The human–machine interaction component used a Kunlun Tongtai MCGS 7032Nt-WIFI touch screen (Beijing Kunlun Tongtai Automation Technology Co., Ltd., Beijing, China). HMI configuration and script logic development were performed using McgsSetPro software (McgsPro 3.3.2). The interface was mainly used for operating status display, control mode switching, parameter configuration, growth-stage strategy setting, formulation management, and viewing operation alarm information.

2.6. Visual Recognition-Based Blueberry Growth Stage Determination Method

2.6.1. Image Acquisition and Dataset Construction

To address the lack of crop growth-stage information input in conventional greenhouse control systems, a blueberry growth-stage determination module was developed in this study. This module was deployed in the edge vision unit and was designed to output stage labels based mainly on visible features of blueberry plants at different developmental stages, including buds, inflorescences, young fruits, fruit clusters, mature fruits, and canopy morphology. Environmental and substrate sensor information was also incorporated for control safety verification, anomaly detection, and temporal consistency processing of the growth stage labels, thereby improving the usability of stage labels before their entry into the PLC control process.
Greenhouse blueberry plants were used as the image acquisition objects in this study. Image acquisition covered four major growth stages: the budding stage, flowering and fruit-setting stage, fruit expansion stage, and ripening stage. To improve the adaptability of the dataset to practical greenhouse conditions, images were collected under different conditions as far as possible, including natural light, greenhouse supplemental lighting, local shading, and different shooting angles. The image backgrounds mainly included blueberry plants, cultivation substrate, pots, drip irrigation pipelines, greenhouse support structures, and local equipment. During image acquisition, some samples contained leaf occlusion, overlapping fruit clusters, crossed branches, and background interference. These samples were retained in the dataset after screening to enhance the adaptability of the model to complex greenhouse backgrounds.
After image screening, duplicate removal, preprocessing, and data augmentation, an image-level recognition dataset for blueberry growth-stage classification was constructed. A total of 947 raw images were collected at the preliminary stage. After manual pre-screening, 129 images with severe blur, overexposure, underexposure, missing targets, non-target growth stages, or ambiguous stage characteristics were removed, and 818 normally decodable images were retained for data organization. Subsequently, 22 completely duplicated images were removed using an image-content-based duplicate checking procedure, resulting in 796 independent raw images.
During data organization, raw images were first used as the basic unit for dataset splitting. The dataset was divided into training, validation, and test sets at an approximate ratio of 8:1:1, including 635 raw training images, 77 validation images, and 84 independent test images. To avoid data leakage, data augmentation was applied only to the training set, while the validation and test sets were not augmented. The same raw image and its augmented samples were not assigned to different data subsets. After training-set augmentation, 2054 valid images were obtained, including 1893 training images, 77 validation images, and 84 independent test images. By growth stage, the dataset contained 590 images for the budding stage, 488 images for the flowering and fruit-setting stage, 464 images for the fruit expansion stage, and 512 images for the ripening stage.
The eligible images were manually annotated according to the growth stage criteria listed in Table 1. During annotation, visible organs or tissues that best represented the current developmental stage were preferentially used as the basis for stage assignment, including buds and newly emerged shoots for the budding stage; flower buds, open flowers, and young fruit for the flowering and fruit-setting stage; green berries and enlarging fruit clusters for the fruit expansion stage; and colored berries and mature fruit clusters for the ripening stage. Because this study adopted an image-level growth stage classification approach rather than berry-level object detection or instance segmentation, each image was assigned a single dominant growth stage label.
For images containing green, transitional, and mature berries simultaneously, the image-level label was determined according to the dominant visible phenological characteristics and the prevailing developmental status of the principal fruit clusters across the entire image. Specifically, images were labeled as the fruit expansion stage when enlarging green berries and fruit clusters without obvious coloration predominated. Images were labeled as the ripening stage when colored or mature berries accounted for a relatively high proportion and characteristic maturity features, such as surface bloom and blue-purple or dark-blue coloration, were clearly visible. Images in which green, transitional, and mature berries occurred in similar proportions without a clearly dominant stage, or in which reliable stage determination was hindered by severe blurring, absence of the target, strong reflections, overexposure, or extensive occlusion, were treated as ambiguous samples and excluded from the training, validation, and test sets.
This annotation strategy ensured that the model learned the dominant growth stage at the whole-image level rather than performing object-wise classification of individual berries. To reduce the influence of illumination variability on recognition performance, brightness adjustment, contrast adjustment, and local illumination perturbation were included during image preprocessing and augmentation, thereby enabling the training set to cover conditions involving natural light, supplemental greenhouse lighting, and localized shading.
Figure 6 shows representative images of the four major growth stages of greenhouse blueberry plants, namely the budding stage, flowering and fruit-setting stage, fruit expansion stage, and ripening stage. These images were collected from real greenhouse blueberry plants and are used to illustrate the main visible morphological features on which the growth stage labels in this study were constructed.

2.6.2. Edge Vision Model Deployment

In terms of model implementation, the visual recognition algorithm adopted a lightweight YOLO-type image-level stage recognition model. Considering that the PLC control layer actually used the final growth-stage label rather than object localization results, the output of the edge vision module was defined as the image-level stage category label and its corresponding confidence score. The K210-side program was developed in the CanMV environment, and the model file was converted for edge deployment. The input image size was 320 × 240 pixels, and the pixel format was RGB565. The model outputs the candidate stage category label and its confidence score at the edge terminal. The recognition result was displayed on the LCD interface and transmitted to the STM32 intermediate processing unit through serial communication. The K210 platform integrates a KPU neural network acceleration unit, which is suitable for low-power edge vision inference under resource-constrained conditions. Therefore, it can provide the hardware basis for local output of growth-stage recognition results in the greenhouse prototype system.
The YOLOv5n-cls, YOLOv8n-cls, and YOLO11n-cls models used in this study are image classification branches of the YOLO framework rather than object detection models. Conventional YOLO-based object detectors typically output bounding-box coordinates, object classes, and detection confidence scores. In contrast, the YOLO-cls models employed here do not generate bounding-box coordinates or perform berry-level localization or counting. Instead, they extract global visual features from the entire input image and use a classification head to output class confidence scores for the different blueberry growth stages. The class with the highest confidence score is selected as the candidate growth stage label. Because the PLC control layer requires a discretized final growth stage label rather than bounding-box locations, object counts, or the spatial distribution of individual berries, image-level growth stage classification is more consistent with the requirements of stage-specific parameter invocation and integration into the control pipeline.
In the control program, although the K210 camera could continuously acquire images and display recognition results on the LCD interface, the PLC control layer did not directly use continuous video frames as control inputs. Instead, the control link adopted a 1 s stage-label output period. That is, after the K210 recognized the target category, it transmitted the corresponding stage character to the STM32 once every 1 s. This setting was mainly used to ensure a stable control period when stage labels were input into the PLC and to prevent high-frequency image fluctuations from directly causing frequent switching of PLC parameters.
At the edge deployment level, the traceable key deployment parameters in this study included an input image size of 320 × 240 pixels, an RGB565 pixel format, a K210-executable kmodel file, a recognition confidence threshold of 0.60, a stage-label output period of 1 s, and a serial communication baud rate of 9600 bps between the K210 and STM32. The kmodel format was used to adapt the model to the KPU inference environment of the K210, enabling online recognition and category-label output at the edge terminal.
The models used for image-level stage classification evaluation were trained using a unified data split and training configuration. The evaluated models included YOLOv5n-cls, YOLOv8n-cls, YOLO11n-cls, and Tiny-YOLO-cls. The input image size was 224 × 224 pixels, the number of training epochs was 30, the batch size was 16, the optimizer was AdamW, the initial learning rate was 0.00125, the weight decay coefficient was 0.0005, and the loss function was cross-entropy classification loss. Data augmentation was applied only to the training set, whereas no augmentation was applied to the validation set or the independent test set.
The model evaluation metrics included Accuracy, Precision, Recall, F1-score, class accuracy, and Macro AP. Let T P i , F P i , and F N i denote the numbers of true positives, false positives, and false negatives, respectively, for the i-th growth stage class. The Precision, Recall, and F1-score for this class were calculated as follows:
P r e c i s i o n i = T P i T P i + F P i
R e c a l l i = T P i T P i + F N i
F 1 i = 2 × P r e c i s i o n i × R e c a l l i P r e c i s i o n i + R e c a l l i
Accuracy was defined as the proportion of correctly classified images in the independent test set. Class accuracy was defined as the proportion of images correctly classified within each true growth stage class. Macro Precision, Macro Recall, and Macro F1-score were calculated as the arithmetic means of the Precision, Recall, and F1-score values, respectively, across the four growth stage classes, and were used to characterize the overall class-level classification performance of the model. Average precision (AP) was calculated from the class confidence scores using a one-vs.-rest classification scheme, and Macro AP was obtained by averaging the AP values across the four growth stage classes. In this study, Macro AP refers to the macro-averaged precision derived from class confidence scores in an image-level classification task using a one-vs.-rest strategy. Therefore, it differs from mAP@0.5 and mAP@0.5:0.95 used in object detection in terms of both its definition and evaluation target.
During K210-side system linkage debugging, this study mainly verified whether the model file could be loaded and executed at the edge terminal, whether stage labels could be stably output, and whether the recognition results could drive PLC-based parameter invocation after STM32-based encoding. Since the focus of this study was the verification of parameter invocation and actuator linkage after stage recognition results entered the PLC control link, K210-side resource occupation and energy-consumption tests were not included as major evaluation objectives. Therefore, this study reports only the model scale, stage-label output period, and end-to-end system response time, without further quantifying K210-side deployment performance indicators such as KPU memory usage, CPU/KPU utilization, real-time power consumption, and frame-by-frame FPS. Future studies should synchronously record the model quantization method, inference frame rate, memory usage, power consumption, and long-term operational stability during edge deployment, so as to more comprehensively evaluate the real-time deployability of the model on the K210 platform.

2.6.3. Sensor-Status Verification and Temporal Consistency Determination

To improve the usability of visual recognition results in the PLC control process, a confidence threshold, stage progression constraint, sensor status verification, and temporal consistency determination were applied to the preliminary visual recognition results. In each determination cycle, the visual recognition module outputs a candidate stage label and its corresponding confidence score. According to the model deployment parameters on the K210 side, the confidence threshold for visual recognition was set to 0.60. When the recognition confidence was lower than 0.60, the system did not update the stage label but retained the previous valid stage label.
Blueberry growth stages show a unidirectional progression pattern. To facilitate the description of stage progression and PLC-based parameter invocation logic, the four growth stages were defined as four sequential states at the control logic level. State 1 corresponded to the budding stage, State 2 to the flowering and fruit-setting stage, State 3 to the fruit expansion stage, and State 4 to the ripening stage. It should be noted that these state numbers were used only for describing stage sequence determination and PLC-based parameter invocation logic. In the actual serial communication between the K210 and STM32, the stage labels were not directly transmitted as the numbers 1, 2, 3, and 4, but as characters.
Specifically, after the K210 recognized different growth stages, it transmitted the corresponding character through serial communication. The character “a” represented the budding stage, “b” represented the flowering and fruit-setting stage, “c” represented the fruit expansion stage, and “d” represented the ripening stage. After receiving these characters, the STM32 converted them into the corresponding stage states and output high- and low-level signals through the PA0–PA3 pins of GPIOA in the form of 8421-coded discrete signals. These signals were finally input into the PLC digital input terminals through relays. The PLC identified the current stage according to the input discrete coded signals and invoked the corresponding stage-specific fertigation target parameters.
Stage updating was allowed only when the current stage remained unchanged or progressed to the next stage. Backward stage transition or cross-stage jumping was not permitted. The stage sequence determination was described using the stage state numbers, and the rule was as follows:
Stage difference = current candidate stage state number − previous valid stage state number.
When the stage difference was 0, the current candidate stage was consistent with the previous valid stage, and the system maintained the current stage state.
When the stage difference was 1, the current candidate stage advanced by one stage relative to the previous valid stage, which was consistent with the normal growth progression of blueberry and could enter the continuous confirmation process.
When the stage difference was less than 0, the recognition result indicated a backward stage transition, such as a change from the fruit expansion stage back to the flowering and fruit-setting stage. This result was regarded as abnormal, and the PLC did not perform stage updating.
When the stage difference was greater than 1, the recognition result indicated a cross-stage jump, such as a direct transition from the budding stage to the fruit expansion stage or ripening stage. This result was also regarded as abnormal, and the PLC did not perform stage updating.
To avoid the influence of single-frame misclassification on the control strategy, continuous temporal consistency determination was adopted in this study. The system determination cycle was set to 1 s, and the number of consecutive confirmations was set to three. In other words, the system was allowed to update the final stage label only when the same candidate stage was recognized in three consecutive determination cycles, the recognition confidence in each cycle was not lower than 0.60, and the stage transition conformed to the normal progression sequence.
The final growth stage label was updated according to three criteria: the vision-based recognition result, the growth stage progression constraint, and sensor status verification. The detailed procedure of the stage label updating strategy is presented in Algorithm 1.
Algorithm 1. Temporal consistency updating rule for stage labels.
 Input: Current candidate stage label, current candidate stage confidence, previous valid stage label, consecutive occurrence count of the same candidate stage, and sensor status.
 Output: Final stage label.
 Step 1: Determine the visual recognition confidence.
 If the confidence of the current candidate stage is lower than 0.60, the final stage label remains the previous valid stage label, and no stage update is performed.
 Step 2: Determine the sensor status.
 If the sensor data exceed the valid measurement range, communication is interrupted, sudden data fluctuation occurs, or the sensor data are seriously inconsistent with the current control target, the final stage label remains the previous valid stage label, and an alarm status is displayed on the HMI interface.
 Step 3: Determine the stage progression sequence.
 The current candidate stage label is converted into the corresponding stage state number, and the stage difference is calculated as follows:
 Stage difference = current candidate stage state number − previous valid stage state number.
 If the stage difference is less than 0, it is determined as a backward stage transition, and the stage label is not updated.
 If the stage difference is greater than 1, it is determined as a cross-stage jump, and the stage label is not updated.
 If the stage difference is 0 or 1, the process proceeds to the next step.
 Step 4: Determine the consecutive occurrence count.
 If the consecutive occurrence count of the same candidate stage is greater than or equal to 3, the final stage label is updated.
 If the consecutive occurrence count of the same candidate stage is less than 3, the previous valid stage label is retained.
 Step 5: Output the final stage label.
 When the update conditions in Steps 1 to 4 are all satisfied, the final stage label is set as the current candidate stage label. Otherwise, the final stage label remains the previous valid stage label.

2.7. PLC Control Logic and Human–Machine Interaction Implementation

The PLC served as the core control unit for system implementation and was mainly responsible for sensor data reception, stage-label reading, logical operation, target-parameter invocation, control command output, and operating status management. The PLC received real-time data from the environmental and substrate sensors, as well as growth-stage labels transmitted from the edge vision terminal after STM32-based encoding. According to the predefined stage-strategy table and control rules, the PLC determined whether the current environmental and rhizosphere conditions deviated from the target ranges and then output corresponding control commands for irrigation, fertilizer delivery, supplemental lighting, ventilation, and shading.
To improve the describability and reproducibility of the control logic, the stage-label updating process and PLC-based parameter invocation process were described as a stage-state-driven rule-based control procedure. Let S k denote the final growth-stage label in the k-th control cycle. Its value set is defined as follows:
S k { 1,2 , 3,4 }
where 1, 2, 3, and 4 represent the budding stage, flowering and fruit-setting stage, fruit expansion stage, and ripening stage, respectively. Let S ^ k denote the candidate stage output by the visual module, C k denote the corresponding confidence score, S k 1 denote the previous valid stage, N k denote the number of consecutive occurrences of the same candidate stage, and Q k denote the sensor-status variable. When the sensor data are within the valid measurement range and the communication status is normal, Q k = 1 . When the sensor data exceed the valid measurement range, communication is interrupted, or abnormal abrupt changes occur, Q k = 0 . The stage-label updating rule is expressed as follows:
S k = { S ^ k , C k 0.60 , S ^ k S k 1 { 0,1 } , N k 3 , Q k = 1 S k 1 , o t h e r w i s e
In this rule, C k 0.60 indicates that the recognition result of the candidate stage satisfies the confidence threshold. S ^ k S k 1 { 0,1 } indicates that the stage transition conforms to the normal developmental progression of blueberry, meaning that the system allows the stage to remain unchanged or advance to the next stage, but does not allow backward transition or cross-stage jumping. N k 3 indicates that the same candidate stage has appeared in three consecutive determination cycles, and Q k = 1 indicates that the sensor status is normal. Only when all the above conditions are simultaneously satisfied does the system update the final growth-stage label; otherwise, the previous valid stage label is retained. This rule can reduce the influence of single-frame misclassification, low-confidence recognition, abnormal stage transitions, and sensor anomalies on PLC-based parameter invocation.
After reading the final growth-stage label, the PLC invokes the corresponding fertigation target-parameter set according to the stage-strategy table. Let the target-parameter invocation function corresponding to stage S k be defined as follows:
Θ ( S k ) = { M min ( S k ) , M max ( S k ) , E C min ( S k ) , E C max ( S k ) , p H min ( S k ) , p H max ( S k ) }
where M min ( S k ) and M max ( S k ) denote the lower and upper target limits of soil moisture under stage S k , respectively; E C min ( S k ) and E C max ( S k ) denote the lower and upper target limits of electrical conductivity, respectively; and p H min ( S k ) and p H max ( S k ) denote the lower and upper target limits of pH, respectively. In each control cycle, the PLC reads the real-time soil moisture M k , electrical conductivity E C k , and pH value p H k , and determines the states of the irrigation and fertilization actuators according to the stage-specific target ranges.
The state of the irrigation actuator, U k M , can be expressed as follows:
U k M = { 1 , M k < M min ( S k ) 0 , M k > M max ( S k ) U k 1 M , M min ( S k ) M k M max ( S k )
where U k M = 1 indicates that irrigation is activated, and U k M = 0 indicates that irrigation is stopped. When soil moisture is lower than the target lower limit for the current stage, the PLC activates the irrigation device. When soil moisture is higher than the target upper limit, the PLC stops the irrigation device. When soil moisture remains within the target range, the irrigation state from the previous control cycle is maintained to avoid frequent actuator switching.
When U k E C = 1 :
E C k < E C min ( S k ) a n d p H min ( S k ) p H k p H max ( S k )
When U k E C = 0 :
E C k > E C max ( S k ) o r p H k [ p H min ( S k ) , p H max ( S k ) ]
When U k E C = U k E C :
E C min ( S k ) E C k E C max ( S k )
where U k E C = 1 indicates that fertilizer-solution delivery or fertilization is allowed, and U k E C = 0 indicates that fertilizer-solution delivery or fertilization is stopped. When EC is lower than the target lower limit for the current stage and pH remains within the allowable range, the PLC allows fertilization or fertilizer-solution delivery. When EC is higher than the target upper limit or pH exceeds the specified range, the PLC stops fertilization or fertilizer-solution delivery. When EC remains within the target range, the actuator state from the previous control cycle is maintained.
Supplemental lighting, shading, and ventilation devices were controlled through upper- and lower-limit linkage logic based on light intensity, temperature, and humidity conditions. When light intensity was lower than the lower limit set for the current stage, the PLC activated the supplemental lighting device. When light intensity exceeded the upper limit, the PLC activated the shading device. When temperature or humidity exceeded the safety threshold, the PLC activated the ventilation device. The above control logic belongs to a stage-label-driven rule-based control method. Its purpose is to enable the PLC to invoke different working target ranges according to different growth stages and to determine actuator start–stop states based on real-time sensor data. The control logic described in this study was used to verify whether stage recognition results could be incorporated into the PLC parameter invocation link, and it does not represent a fertigation parameter optimization model, predictive control model, or long-term agronomic regulation model.
Serial communication was adopted between the K210 and the STM32. USART1 of the STM32 was used to receive the stage characters sent by the K210. Specifically, the TX pin PA9 of the STM32 was connected to the RX pin of the K210, and the RX pin PA10 of the STM32 was connected to the TX pin of the K210, with a common ground connection between the two modules. The serial communication baud rate was 9600 bps, with 8 data bits, 1 stop bit, and no parity. After the K210 recognized the target category, it transmitted the corresponding character once every 1 s. The character “a” represented the budding stage, “b” represented the flowering and fruit-setting stage, “c” represented the fruit expansion stage, and “d” represented the ripening stage. After receiving the stage character, the STM32 converted it into the corresponding stage state according to the predefined mapping relationship and output high- and low-level signals through the PA0–PA3 pins of GPIOA in the form of 8421-coded discrete signals. The output signals were connected to the PLC digital input terminals after relay isolation. The PLC then invoked the corresponding stage-specific fertigation target parameters according to the input state.
The HMI module used an MCGS 7032Nt-WIFI touch screen to implement system status display, control-mode switching, parameter configuration, stage-specific strategy setting, recipe management, and operating alarm information display. The HMI interface included a startup interface, status monitoring interface, automatic parameter interface, recipe management interface, and Internet of Things interface. These interfaces enabled environmental parameter display, crop growth-stage display, manual/automatic control switching, and remote access. The coordination between the HMI and PLC allowed the system to support both automatic operation and manual intervention.

2.8. System Validation Design and Evaluation Scope

To verify the engineering feasibility of the constructed system in greenhouse blueberry production, this study conducted image-level stage classification evaluation, stage-label output tests, communication-link tests, and system linkage operation tests. The image-level stage classification evaluation was used to quantitatively analyze the ability of the visual module to recognize the major growth stages of blueberry and to compare the performance differences among different lightweight classification models. The stage-label output test was used to verify whether the edge vision module could output labels for different blueberry growth stages. The communication-link test was used to verify whether the stage labels could be transmitted through the K210 serial interface, converted by the STM32 unit, and read by the PLC digital input terminals. The system linkage operation test was used to verify whether the PLC could invoke the corresponding target parameters according to the stage labels and drive the coordinated operation of actuators, including irrigation, fertilizer delivery, supplemental lighting, ventilation, and shading. To visually demonstrate the growth stage classification performance of the vision model, correctly classified samples and representative misclassified samples from the independent test set were selected for comparison in the Results section. These examples were used to illustrate the model’s recognition performance for images representing typical and transitional growth stages.
The evaluation in this study consisted of two main parts. For the visual module, an independent test set was used to calculate Accuracy, Precision, Recall, F1-score, class accuracy, and Macro AP. YOLOv5n-cls, YOLOv8n-cls, YOLO11n-cls, and Tiny-YOLO-cls were compared to improve the transparency of visual module performance evaluation and model selection. For the system linkage process, the evaluation focused on edge-terminal stage-label output status, K210–STM32 serial communication status, STM32 encoding output status, PLC input reading status, HMI display status, stage-specific target parameter invocation status, and actuator response status. These tests were used to determine whether the constructed prototype system had the capability for continuous operation and engineering-level integration.
The visual module evaluation in this study was positioned as an image-level growth-stage classification task, with the evaluation focused on the stage-label determination result of the whole image. Macro AP was calculated in a one-vs-rest manner based on class confidence scores and differs from mAP@0.5 or mAP@0.5:0.95 used in object detection tasks. Because this study focused on verifying the parameter invocation and actuator response process after stage labels entered the PLC control link, object-level detection performance, real-time power consumption of the K210 terminal, KPU resource occupation, and long-term edge-terminal operational reliability were not included as primary evaluation objectives. These indicators will be further examined in subsequent practical deployment studies [24,25].
This study did not conduct a complete closed-loop cultivation experiment under real production greenhouse conditions, nor did it include different fertigation treatments, different control modes, or agronomic replications. Therefore, this study did not evaluate agronomic indicators such as water and fertilizer use efficiency, fertilizer application amount, plant physiological responses, fruit yield, fruit diameter, soluble solids content, or fruit quality. The results of this study are only used to demonstrate that the constructed prototype system could complete stage-label input, PLC reading, target-parameter invocation, and actuator response, and should not be extended to indicate that the agronomic effects of fertigation control have been experimentally validated.
The system validation conducted in this study was limited to engineering integration and functional linkage testing on a small-scale greenhouse prototype platform. The evaluation focused primarily on whether the growth stage labels could be incorporated into the PLC control pipeline and used to complete parameter invocation and actuator response. This validation should not be regarded as equivalent to commercial deployment under production-scale greenhouse conditions, nor does it demonstrate the long-term robustness of the system across different greenhouse environments, blueberry cultivars, or full-season crop management scenarios.

3. Results

3.1. Overall System Architecture and Physical Prototype Platform Implementation

Based on modules including sensor information acquisition, growth stage determination, STM32-based coding conversion, PLC control, human–machine interaction, and actuators, a small-scale greenhouse prototype system was constructed in this study for testing blueberry stage label access and PLC-based fertigation parameter invocation. The physical prototype platform is shown in Figure 7. This platform could simulate environmental parameter acquisition, stage label input, PLC-based parameter invocation, and actuator response processes, and was used to examine the operation of growth stage recognition results after being introduced into the PLC.
Real blueberry image acquisition was conducted in a greenhouse blueberry cultivation environment. The platform shown in Figure 7 was mainly used for control system construction, communication testing, and actuator response validation. This platform was not equivalent to a complete production greenhouse and was not used to conduct a full-cycle blueberry cultivation control experiment. Therefore, the results of this study are mainly used to demonstrate that parameter invocation and actuator operation could be completed after stage labels were input into the PLC, rather than to infer long-term agronomic effects.
Figure 7 shows the small-scale greenhouse prototype platform used for system linkage debugging in this study, including the simulated greenhouse unit, supplemental lighting and shading mechanisms, fertigation delivery unit, PLC control cabinet, STM32 coding unit, relay module, and HMI interface. This platform was used to test parameter invocation and actuator response after the stage recognition results were input into the PLC, rather than to conduct a full-cycle blueberry cultivation control experiment.
The system operation results showed that stable connections could be achieved among the different modules. The edge vision terminal could perform online determination of blueberry plant images and output preliminary results for the current growth stage. The STM32 intermediate processing unit could convert the stage characters output by the vision terminal into 8421-coded discrete signals and input them into the PLC digital input terminals. The PLC then outputs control commands for irrigation, fertilization, supplemental lighting, ventilation, and shading according to the corresponding stage-specific target parameter set. During the system operation test, image acquisition, stage label output, coding transmission, PLC-based parameter invocation, actuator operation, and HMI display could all be completed on the same platform, indicating that the prototype system had the basic conditions for hardware integration and operation.

3.2. Image-Level Stage Classification Performance Evaluation of the Edge Vision Model

To quantitatively evaluate the ability of the edge vision module to recognize blueberry growth stages and to further clarify the basis for model selection, this study conducted an image-level stage classification evaluation based on an independent test set. Considering that the PLC control layer actually uses the final growth-stage label rather than object localization results, the evaluation of the visual module focused on the stage-category determination of the whole image. The evaluation metrics included Accuracy, Macro Precision, Macro Recall, Macro F1-score, Macro AP, number of parameters, and model size. Macro AP was calculated in a one-vs-rest manner based on class confidence scores in the image-level classification task and is not equivalent to mAP@0.5 or mAP@0.5:0.95 in object detection tasks. The evaluation results of different lightweight classification models are shown in Table 3.
To account for the uncertainty associated with accuracy estimates derived from the limited independent test set, 95% confidence intervals for model accuracy were calculated using the Wilson score method. The accuracy values and corresponding 95% confidence intervals for YOLOv5n-cls, YOLOv8n-cls, YOLO11n-cls, and Tiny-YOLO-cls were 70.24% (59.75–78.96%), 80.95% (71.28–87.92%), 85.71% (76.67–91.64%), and 78.57% (68.65–85.99%), respectively. These results indicate that YOLO11n-cls achieved the highest classification accuracy on the current independent test set. However, given the limited test-set size, the performance differences among the models require further validation using larger datasets collected across multiple seasons and greenhouse environments.
As shown in Table 3, YOLO11n-cls achieved the highest Accuracy and Macro F1-score on the independent test set, reaching 85.71% and 84.81%, respectively, indicating that it had strong overall recognition performance in the current image-level blueberry growth-stage classification task. YOLOv8n-cls achieved an Accuracy of 80.95%, a Macro F1-score of 81.10%, and a Macro AP of 91.25%, with a model size of 2.83 MB and 1.443 M parameters. Compared with Tiny-YOLO-cls, YOLOv8n-cls achieved higher classification accuracy and Macro AP while maintaining a smaller model scale. Compared with YOLO11n-cls, YOLOv8n-cls showed slightly lower Accuracy and Macro F1-score, but had a smaller model scale and thus provided a more favorable balance for engineering deployment. Therefore, the subsequent analysis focuses on the class-wise recognition results and confusion matrix of YOLOv8n-cls to illustrate the applicability of the edge vision module for determining the major growth stages of blueberry.
As shown in Table 4, YOLOv8n-cls performed well in recognizing the budding stage and the flowering and fruit-setting stage. For the budding stage, both Recall and Class Accuracy reached 90.91%. For the flowering and fruit-setting stage, Precision reached 96.15%, and the F1-score was 89.29%. The recognition metrics for the fruit expansion stage and ripening stage were relatively lower, indicating that these two stages showed more evident transitional characteristics and feature overlap. This result is consistent with the continuous morphological transition of blueberry fruits from green fruit expansion to coloration and ripening.
To further analyze the sources of misclassification among different growth stages, the confusion matrix of YOLOv8n-cls on the independent test set was calculated, and the results are shown in Table 5.
As shown in Table 5, YOLOv8n-cls correctly classified 68 of the 84 images in the independent test set, yielding an overall accuracy of 80.95%, with 16 images misclassified. The most pronounced confusion occurred between the fruit expansion and ripening stages. Specifically, four fruit expansion images were classified as ripening, and four ripening images were classified as fruit expansion. These eight bidirectional misclassifications accounted for 50.00% of all misclassified samples. In addition, five images from the flowering and fruit-setting stage were misclassified: one as budding, two as fruit expansion, and two as ripening. Only one budding-stage image was misclassified as fruit expansion. These results indicate that the model achieved relatively stable recognition performance for the budding and flowering and fruit-setting stages, whereas most errors originated from the continuous transitional phases of fruit development.
This pattern was primarily associated with the continuous morphological changes occurring during blueberry fruit development. During the late fruit expansion and early ripening stages, some berries had already begun to develop partial coloration, while green, transitional, and mature berries could still coexist within the same fruit cluster. Consequently, the boundary between image-level growth stage classes was relatively ambiguous. For such mixed-cluster images, a multi-label annotation strategy was not adopted during dataset construction. Instead, each image was assigned a single image-level label according to its dominant phenological characteristics. Images without a clearly dominant stage, or for which a stable manual determination could not be made, were treated as ambiguous samples and excluded. Therefore, the misclassifications presented in Table 5 and Figure 8 mainly reflect errors in identifying the dominant growth stage at the whole-image level, rather than berry-level multi-object detection or multi-label classification results.
From the perspective of PLC-based control, a single-frame misclassification may cause short-term fluctuations in the growth stage label and, if directly introduced into the PLC parameter invocation pipeline, may trigger an inappropriate switch in stage-specific target parameters. To reduce this risk, the control pipeline incorporated a confidence threshold, a growth stage progression constraint, and a temporal consistency rule requiring confirmation over three consecutive cycles. Thus, an isolated misclassification did not immediately trigger an update of the PLC stage parameters. Nevertheless, if transitional-stage images are consistently misclassified over several consecutive cycles, the accuracy of stage label updates may still be affected. Future model optimization should therefore prioritize the inclusion of transitional samples from the late fruit expansion, early coloration, and early ripening stages, together with finer phenological labels or temporal information, to improve the stability of growth stage determination.
Figure 8 presents selected correctly classified samples and representative misclassified samples from the independent test set. The correctly classified examples show that the model correctly identified representative morphological features of the four major blueberry growth stages, including bud development, flowering and young fruit formation, green fruit expansion, and fruit coloration and ripening. The misclassified examples mainly involved images with mixed phenological characteristics or visually ambiguous features. In particular, during late fruit expansion and early ripening, green, partially colored, and mature berries may coexist within the same fruit cluster, making the dominant growth stage at the whole-image level less distinct. Partial occlusion, overlapping leaves or fruit clusters, and variations in illumination may further reduce class separability. Misclassification may also occur when flowering, fruit-setting, and early fruit-development features coexist within the same image. These observations are consistent with the confusion patterns shown in Table 5, particularly the frequent bidirectional confusion between the fruit expansion and ripening stages. Future dataset expansion and model optimization should therefore prioritize transitional-stage samples and images acquired under complex background and illumination conditions.

3.3. Blueberry Growth Stage Label Output and PLC Reading Results

To examine the usability of blueberry growth stage labels in the control system, this study tested the edge-terminal output, STM32-based coding conversion, and PLC reading of labels corresponding to different growth stages. The test results showed that the system could output stage labels for the budding stage, flowering and fruit-setting stage, fruit expansion stage, and ripening stage. These labels were encoded by the STM32 and then input into the PLC, allowing the PLC to invoke the corresponding target parameters for each stage. The single determination and output process at the edge terminal was controlled within the range of 500–1000 ms, which could meet the requirements for stage label updating and parameter invocation in the small-scale greenhouse prototype platform (Table 6).
This study focused primarily on the integration and use of growth stage labels within the control system rather than on a comprehensive evaluation of object detection performance. The image-level classification results presented in Section 3.2 indicate that the edge vision module could not only generate growth stage labels readable by the PLC during system integration testing, but also provide a measurable level of growth stage classification performance on the independent test set. The resulting stage labels can therefore serve as front-end inputs to the PLC parameter invocation pipeline. However, their stability under long-term production conditions requires further validation using larger datasets collected across multiple seasons and under a wider range of illumination conditions.

3.4. Transmission Delay and Operation Results Among the K210, STM32, and PLC

To evaluate the real-time performance and transmission stability after the stage labels entered the PLC, this study tested the data transmission and actuator response processes among the K210, STM32, and PLC. The system link included image acquisition and stage determination, K210 serial output, STM32 reception and 8421-code conversion, PLC digital input reading, stage-specific parameter invocation, and actuator response. The test results are shown in Table 7.
The results showed that the stage labels output by the edge vision terminal could be stably read by the PLC after STM32-based conversion and could be used for subsequent target parameter invocation. During the test, image acquisition, stage output, coding transmission, PLC reading, and actuator response were all completed normally, indicating that the prototype platform could support the participation of stage labels in the PLC control process. The results listed in Table 7 belong to system communication and actuator response tests, and were mainly used to determine whether the transmission process from recognition output to PLC reading, parameter invocation, and actuator operation could be completed normally. This study did not conduct a closed-loop control dynamic evaluation under continuous environmental disturbances; therefore, control engineering indicators such as overshoot, settling time, steady-state error, and disturbance rejection capability are not reported.
At present, this study recorded only the end-to-end operation time and system linkage status. Oscilloscopes or high-speed data acquisition devices were not used to conduct precise step-by-step timing of visual inference, serial transmission, STM32 coding, relay response, and PLC scan cycles. In future work, system latency could be further reduced and real-time performance improved by increasing the serial communication baud rate, shortening the K210 stage label output period, reducing intermediate relay conversion links, or using a PLC communication module to directly read stage labels.

3.5. PLC Parameter Invocation Results Under Different Growth Stage Labels

To examine the recognition and response of the PLC to different growth stage labels, stage signals corresponding to the budding stage, flowering and fruit-setting stage, fruit expansion stage, and ripening stage were input separately in this study. PLC-based parameter invocation, HMI display, and actuator operation were then recorded. The results showed that, after the PLC read different stage-coded signals, the system could display the corresponding stage on the HMI interface and invoke the corresponding target ranges for soil moisture, EC, pH, and fertigation management strategy listed in Table 2. The actuator layer could output the corresponding control commands according to the current parameter status, thereby achieving coordinated control of irrigation, fertilization, supplemental lighting, ventilation, and shading devices.
The results showed that the coded stage labels could be used by the PLC as the basis for parameter switching, and input signals corresponding to different growth stages could invoke different target ranges for soil moisture, EC, and pH. In the Results section, this study only reports whether stage label input, PLC-based parameter invocation, HMI display, and actuator operation could be completed, and does not treat these results as a performance comparison among different control modes. Table 8 presents a functional test of parameter invocation in the prototype system, rather than a quantitative comparative experiment between the conventional threshold-based control mode and the stage-label-driven control mode. Since this study did not conduct a long-term blueberry cultivation control experiment, nor did it measure water and fertilizer consumption, plant physiological status, fruit yield, or fruit quality, these results cannot be used to determine the extent to which the system improves water and fertilizer use efficiency, fertilizer application amount, crop growth, or fruit quality.

4. Discussion

This study focused on the application of blueberry growth-stage recognition results in a PLC-based control system and constructed a small greenhouse prototype platform consisting of an edge vision module, an STM32 encoding unit, a PLC controller, and fertigation actuators. The test results showed that the stage labels output by the edge vision terminal could be converted by the STM32 unit into discrete signals readable by the PLC and used for invoking the corresponding stage-specific target parameters. Unlike studies that only evaluate offline image recognition performance, this study placed greater emphasis on whether recognition results could be introduced into an on-site control system and converted into specific parameter invocation and device-control actions within the PLC.
The visual recognition module is the front-end basis for introducing stage labels into the PLC control link. This study conducted an image-level classification evaluation of blueberry growth stages and compared lightweight classification models, including YOLOv5n-cls, YOLOv8n-cls, YOLO11n-cls, and Tiny-YOLO-cls, under a unified data split and training configuration. The results showed that YOLO11n-cls achieved the highest Accuracy and Macro F1-score on the independent test set, whereas YOLOv8n-cls showed a favorable balance among model scale, Macro AP, and recognition performance. These results indicate that the visual module can convert the major blueberry growth stages into image-level category labels. However, a trade-off remains among recognition accuracy, model size, and engineering deployment complexity. In practical edge deployment, model selection should consider not only classification accuracy on the test set but also model size, edge-side inference speed, resource occupation, power consumption, and system linkage stability.
The class-wise recognition results showed that the model recognized the budding stage and the flowering and fruit-setting stage relatively stably, whereas misclassification was more prominent between the fruit expansion stage and the ripening stage. This phenomenon is closely related to the morphological continuity of blueberry fruit development. During the transition from green fruit expansion to coloration and ripening, green berries, transitional berries, and mature berries often coexist within the same fruit cluster, making the boundary of image-level stage labels less distinct. Previous studies on crop phenology classification have also indicated that the similarity of transitional-stage samples and ambiguous decision boundaries are common factors affecting model stability [14]. Therefore, for crops such as blueberry with strong developmental continuity in fruit morphology, subsequent dataset construction should not only increase the number of typical-stage samples but also focus on adding transitional samples from the late fruit expansion stage, early coloration stage, and early ripening stage. More refined phenological labels, temporal information, or multi-source sensor information should also be incorporated to improve the stability of stage determination.
In recent years, research on intelligent greenhouse management has gradually shifted from local automation and single-point sensing toward system-level integration driven by multi-source perception, intelligent decision-making, and coordinated execution control [26]. In this process, the development of autonomous intelligent greenhouse systems has emphasized the integration of the Internet of Things, artificial intelligence, and execution terminals to improve the timeliness and precision of environmental regulation and crop management [27]. Xinyan Chen et al. demonstrated that combining data-driven models with control strategies in greenhouse environmental control and supplemental lighting decision-making could improve regulation accuracy and reduce resource input [28]. However, most existing studies still focus on individual links such as environmental regulation, irrigation prediction, or crop-status recognition, whereas insufficient attention has been paid to how crop stage determination results enter the control chain. The main focus of this study was to establish an information interface between visual recognition results and the PLC control program, so that growth-stage recognition results are no longer limited to monitoring and display but can serve as input conditions for PLC-based parameter switching. This process provides a prototype system basis for future closed-loop fertigation experiments in real greenhouse blueberry cultivation. However, this study did not demonstrate that the stage-label-driven approach could improve water and fertilizer use efficiency, plant physiological status, fruit yield, or fruit quality. The results mainly support the usability of the system at the levels of system integration and parameter invocation and should not be directly extrapolated to fertigation control effects or crop growth effects.
The vision-based recognition result was not used as the sole basis for PLC stage-specific parameter invocation. Instead, environmental and substrate sensor information was incorporated for sensor status verification, anomaly detection, and control safety constraints. This design has clear methodological significance. Kuan et al. systematically reviewed machine learning and computer vision in precision agriculture and pointed out that their applications are expanding rapidly, but complex backgrounds, occlusion, illumination variation, and sample heterogeneity remain key factors affecting model stability [29]. In crop phenology classification studies, similarity among transitional-stage samples and ambiguity in decision boundaries are common problems [14]. To address these issues, multimodal phenotyping platforms and multi-source data collaborative analysis have been regarded as important approaches for improving the robustness of crop-status determination [30]. In addition, studies on sensing and monitoring in controlled cultivation scenarios have shown that environmental and rhizosphere parameters can provide necessary contextual information for interpreting crop status [31]. Accordingly, this study adopted a vision-led growth stage determination strategy constrained by sensor status verification. In essence, environmental consistency constraints were imposed on the stage labels while maintaining the deployability of the system. This approach better reflects the practical requirements of control applications, because the control system requires growth stage labels that are stable, suitable for parameter invocation, and temporally consistent, rather than merely high offline classification accuracy on a test set.
From the perspective of system implementation, the results of this study showed that edge visual recognition results could be integrated into the PLC control program and used for subsequent parameter invocation. In the industrial field, real-time integration of machine vision and PLC-based control has been shown to support deterministic communication and stable execution [32]. For greenhouse systems, the continuity of actuator control depends not only on the determination algorithm itself but also on whether a stable information transmission and control execution relationship can be established among sensors, communication interfaces, controllers, and actuators. Meanwhile, Karimzadeh et al. further pointed out in a nutrient-solution system that sensor reliability and fault diagnosis capability are also important for precision regulation [33]. These findings suggest that future greenhouse control systems should not focus only on recognition accuracy but should also strengthen systematic evaluation of the reliability of sensing and communication links.
From the perspective of control logic, after introducing growth-stage labels, the system could invoke target parameter sets corresponding to different growth stages at the PLC level. Compared with a fixed-threshold control mode, this approach differs in that crop developmental stage information is added to the control input, enabling the parameter invocation logic to switch according to stage-label changes. This study further formalized the stage updating process and PLC-based parameter invocation process as a stage-state-driven rule-based control model and clarified the relationships among stage labels, target parameter sets, and actuator states through upper- and lower-limit control functions. This formal expression improves the reproducibility and interpretability of the control logic and clarifies the role of visual recognition results in the industrial control link. This idea is consistent with the direction of adjusting parameters according to crop growth status in precision greenhouse irrigation research [34]. In addition, Yuanyi Niu et al. reported that considering growth-stage differences in greenhouse supplemental lighting regulation could significantly improve the rationality of target-value setting [35,36,37]. Nevertheless, stage labels serve as an additional information source for PLC-based parameter invocation and do not by themselves demonstrate higher water and fertilizer use efficiency or improved agronomic effects. Because this study did not conduct long-term comparative experiments among different control modes and did not measure water and fertilizer consumption, crop physiological responses, fruit yield, or fruit quality indicators, the logical difference cannot be directly interpreted as an improvement in resource-use efficiency or agronomic performance. Its actual agronomic value still needs to be further verified under real greenhouse blueberry cultivation conditions through full-growth-cycle, multi-treatment, and replicated experiments.
Because the current study was positioned as prototype system construction and engineering feasibility validation, several limitations remain. First, this study conducted an image-level classification evaluation of blueberry growth stages based on an independent test set and reported Accuracy, Precision, Recall, F1-score, Macro AP, and confusion matrix results. However, the test set size was still limited, and the samples were mainly obtained from a single greenhouse scenario and specific cultivation conditions. Future studies should further expand blueberry image datasets across multiple seasons, cultivars, illumination conditions, and occlusion backgrounds to improve model generalization. Second, the evaluation in this study was an image-level stage classification evaluation, with the emphasis placed on the determination of the stage label for the whole image rather than object-level detection performance. Therefore, object detection metrics such as mAP@0.5, mAP@0.5:0.95, localization error, and multi-object occlusion detection ability should be further evaluated under an object detection framework in future work. Third, although this study established the correspondence between blueberry growth stages and PLC-based fertigation parameter invocation targets, the listed soil moisture, EC, and pH ranges were working target ranges for system operation. They were determined mainly based on the literature, the acidic substrate adaptability of blueberry, greenhouse management experience, and preliminary system operation, rather than being optimal parameters obtained through multi-level optimization experiments or sensitivity analysis. Finally, system linkage validation was completed on a small greenhouse prototype platform, which can demonstrate the technical feasibility of the control link and parameter invocation logic but cannot replace long-term cultivation validation in a real production greenhouse. This study did not measure agronomic indicators such as water and fertilizer use efficiency, fertilizer application amount, plant physiological indicators, fruit yield, fruit diameter, soluble solids content, or fruit quality. Therefore, no quantitative conclusions can be drawn regarding water-saving and fertilizer-saving effects, yield improvement, or fruit quality enhancement. Future research should conduct multi-season, multi-treatment, and replicated closed-loop cultivation experiments in real greenhouse blueberry cultivation scenarios and combine full-growth-cycle observation data to systematically evaluate the actual effects of stage-label-driven fertigation control on resource-use efficiency, plant growth, and fruit quality formation.
The principal technical contribution of this study lies in the engineering integration of image-level blueberry growth stage recognition with a PLC-based control pipeline. The developed system enables growth stage labels to be generated by the edge vision module, converted by the STM32 into coded signals readable by the PLC, and subsequently used for stage-specific target parameter invocation and actuator control. The proposed method adopts a growth stage label-driven rule-based control strategy to verify the feasibility of incorporating crop developmental information into an industrial control system, rather than introducing a new deep learning architecture, an optimized fertigation decision model, or an advanced control algorithm. Accordingly, the current results support the engineering feasibility of system integration, parameter invocation, and coordinated actuator operation, but do not demonstrate superior agronomic performance relative to fixed-threshold control, model predictive control, or other optimization-based control methods. Future studies should conduct long-term comparative experiments under actual greenhouse blueberry cultivation conditions and evaluate different control strategies using water and fertilizer consumption, plant physiological responses, yield, and fruit quality as performance indicators.
In addition, the visual model comparison in this study was primarily limited to lightweight YOLO-based image classification variants and did not include systematic comparisons with classification networks such as EfficientNet, MobileNet, Vision Transformer, ConvNeXt, and ResNet. Therefore, the results only characterize the relative performance of the evaluated lightweight YOLO classification models on the current dataset and should not be interpreted as representing the optimal performance achievable by all lightweight image classification networks. Furthermore, only model size, growth stage label output interval, and end-to-end system response time were recorded on the K210 platform. CPU/KPU utilization, memory footprint, per-frame inference speed, power consumption, and long-term operational stability were not comprehensively evaluated. Consequently, edge-side computational efficiency, potential energy-efficiency advantages, and long-term deployment stability require further assessment under practical deployment conditions.

5. Conclusions

This study constructed a small-scale prototype system for greenhouse blueberry growth-stage recognition and PLC-based fertigation parameter invocation. The system consisted of an edge vision module, an STM32 encoding unit, a PLC controller, an HMI interface, and fertigation actuation devices. The system could acquire greenhouse environmental parameters, substrate parameters, and blueberry image information, output blueberry growth-stage labels through the edge vision module, and convert the stage labels into 8421-coded discrete signals readable by the PLC through the STM32 unit. After reading the stage codes, the PLC could invoke the corresponding target parameters for soil moisture, EC, pH, and fertigation management at each stage, and drive the irrigation, fertilizer delivery, supplemental lighting, ventilation, and shading devices.
The image-level classification evaluation results showed that different lightweight YOLO classification models exhibited different performance levels in recognizing the major growth stages of blueberry. Among them, YOLO11n-cls achieved the highest Accuracy and Macro F1-score on the independent test set, reaching 85.71% and 84.81%, respectively. YOLOv8n-cls achieved an Accuracy, Macro F1-score, and Macro AP of 80.95%, 81.10%, and 91.25%, respectively, showing a favorable balance among recognition performance, model scale, and engineering deployment complexity. The confusion matrix results showed that misclassifications mainly occurred between the fruit expansion stage and the ripening stage, indicating that the transitional period of blueberry fruit development remains a key focus for subsequent dataset expansion and model optimization.
The system test results showed that data transmission, encoding conversion, PLC reading, HMI display, parameter invocation, and actuator response among the K210, STM32, and PLC could all be completed normally. The edge-terminal determination and output time was 500–1000 ms, and the remote-control response delay was 0.3–1.0 s. No obvious communication interruption, command loss, or abnormal shutdown occurred during system operation. These results indicate that blueberry growth-stage recognition results can be used as input conditions for PLC-based parameter invocation and device-control testing on a small-scale prototype platform.
The scope of validation in this study was primarily limited to prototype-level feasibility testing of visual growth stage recognition, STM32-based encoding conversion, PLC parameter invocation, and coordinated actuator operation. Because neither a complete closed-loop cultivation experiment under production-scale greenhouse conditions nor a long-term comparative blueberry cultivation trial was conducted, no quantitative conclusions are drawn regarding improvements in water and fertilizer use efficiency, reductions in fertilizer application, increases in yield, or enhancements in fruit quality. Future research should expand the blueberry image dataset to include multiple seasons, cultivars, and greenhouse environments; supplement the evaluation of K210-side resource utilization, inference speed, power consumption, and long-term operational stability; and conduct full-growth-cycle, multi-treatment, and replicated closed-loop cultivation experiments under actual production-scale greenhouse conditions. Only after obtaining agronomic indicators such as water and fertilizer consumption, plant physiological responses, fruit yield, berry size, soluble solids content, and fruit quality can the actual effects of growth stage label-driven fertigation control on blueberry growth and resource-use efficiency be comprehensively evaluated.

Author Contributions

Conceptualization, W.L. and H.Z.; methodology, J.Z. and H.X.; software, J.Z. and H.X.; validation, C.W., X.L., and S.L.; formal analysis, J.Z. and C.W.; investigation, H.X., C.W., and C.G.; resources, W.L.; data curation, X.L. and X.Z.; writing—original draft preparation, J.Z.; writing—review and editing, W.L.; visualization, S.L.; supervision, H.Z.; project administration, W.L.; funding acquisition, W.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Yunnan Xingdian Talent Program, grant number yfgrc202507.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The data presented in this study are available on request from the corresponding author due to institutional data management policies and their use in ongoing follow-up studies.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Pandey, K.; Singh, K.G.; Singh, A. Multi-sensors based smart nutrient reuse management system for closed soilless culture under protected cultivation. Comput. Electron. Agric. 2023, 204, 107495. [Google Scholar] [CrossRef]
  2. Sandoval, Y.; Tighe-Neira, R.; Inostroza-Blancheteau, C.; Soto-Cerda, B.; González-Villagra, J. Melatonin improves plant water status, photosynthetic performance, and antioxidant defense system in highbush blueberry (Vaccinium corymbosum L.) plants subjected to drought stress. Sci. Hortic. 2024, 323, 112528. [Google Scholar] [CrossRef]
  3. Ortiz-Delvasto, N.; Garcia-Ibañez, P.; Olmos-Ruiz, R.; Bárzana, G.; Carvajal, M. Substrate composition affects growth and physiological parameters of blueberry. Sci. Hortic. 2023, 308, 111528. [Google Scholar] [CrossRef]
  4. Gavilan, P.; Higueras, J.L.; Lozano, D.; Ruiz, N. The Riego Berry mobile application: A powerful tool to improve on-farm irrigation performance in berry crops. Agric. Water Manag. 2024, 292, 108682. [Google Scholar] [CrossRef]
  5. Bao, L.; Zhang, S.; Liang, X.; Wang, P.; Guo, Y.; Sun, Q.; Zhou, J.; Chen, Z. Intelligent drip fertigation increases water and nutrient use efficiency of watermelon in greenhouse without compromising the yield. Agric. Water Manag. 2023, 282, 108278. [Google Scholar] [CrossRef]
  6. Hu, J.; Gettel, G.; Fan, Z.; Lv, H.; Zhao, Y.; Yu, Y.; Wang, J.; Butterbach-Bahl, K.; Li, G.; Lin, S. Drip fertigation promotes water and nitrogen use efficiency and yield stability through improved root growth for tomatoes in plastic greenhouse production. Agric. Ecosyst. Environ. 2021, 313, 107379. [Google Scholar] [CrossRef]
  7. Parra-López, C.; Abdallah, S.B.; Garcia-Garcia, G.; Hassoun, A.; Trollman, H.; Jagtap, S.; Gupta, S.; Aït-Kaddour, A.; Makmuang, S.; Carmona-Torres, C. Digital technologies for water use and management in agriculture: Recent applications and future outlook. Agric. Water Manag. 2025, 309, 109347. [Google Scholar] [CrossRef]
  8. Sharma, V.; Kaur, G.; Sreethu, S.; Chhabra, V.; Kashyap, R. Smart irrigation systems in agriculture: An overview. Comput. Electron. Agric. 2025, 239, 111008. [Google Scholar] [CrossRef]
  9. Yu, J.; Sun, C.; Zhao, J.; Ma, L.; Zheng, W.; Xie, Q.; Wei, X. Prediction and control of greenhouse temperature: Methods, applications, and future directions. Comput. Electron. Agric. 2025, 237, 110603. [Google Scholar] [CrossRef]
  10. Xu, D.; Xu, L.; Wang, S.; Wang, M.; Ma, J.; Shi, C. Rule-based year-round model predictive control of greenhouse tomato cultivation: A simulation study. Inf. Process. Agric. 2025, 12, 344–357. [Google Scholar] [CrossRef]
  11. Chen, W.-H.; You, F. Smart greenhouse control under harsh climate conditions based on data-driven robust model predictive control with principal component analysis and kernel density estimation. J. Process Control 2021, 107, 103–113. [Google Scholar] [CrossRef]
  12. Levin, A.; Nackley, L. Principles and practices of plant-based irrigation management. HortTechnology 2021, 31, 650–660. [Google Scholar] [CrossRef]
  13. Wichura, M.A.; Koschnick, F.; Jung, J.; Bauer, S.; Wichura, A. Phenological growth stages of highbush blueberries (Vaccinium spp.): Codification and description according to the BBCH scale. Botany 2024, 102, 428–437. [Google Scholar] [CrossRef]
  14. Yang, H.-C.; Zhou, J.-P.; Zheng, C.; Wu, Z.; Li, Y.; Li, L.-G. PhenologyNet: A fine-grained approach for crop-phenology classification fusing convolutional neural network and phenotypic similarity. Comput. Electron. Agric. 2025, 229, 109728. [Google Scholar] [CrossRef]
  15. Anku, K.; Percival, D.; Vankoughnett, M.; Lada, R.; Heung, B. Monitoring and prediction of wild blueberry phenology using a multispectral sensor. Remote Sens. 2025, 17, 334. [Google Scholar] [CrossRef]
  16. Wang, G.; Li, Z.; Weng, G.; Chen, Y. An overview of industrial image segmentation using deep learning models. Intell. Robot. 2025, 5, 143–180. [Google Scholar] [CrossRef]
  17. Li, K.; Shi, J.; Hu, C.; Xue, W. The intelligentization process of agricultural greenhouse: A review of control strategies and modeling techniques. Agriculture 2025, 15, 2135. [Google Scholar] [CrossRef]
  18. Gong, R.; Zhang, H.; Li, G.; He, J. Edge computing-enabled smart agriculture: Technical architectures, practical evolution, and bottleneck breakthroughs. Sensors 2025, 25, 5302. [Google Scholar] [CrossRef] [PubMed]
  19. Chen, Y.; Zhu, X.; Sheng, K. Adaptive variational empirical mode decomposition aware intelligent data-driven modeling for complex industrial processes. Intell. Robot. 2025, 5, 50–69. [Google Scholar] [CrossRef]
  20. Sapna; Gauttam, H.; Chauhan, V.; Pattanaik, K.K.; Trivedi, A.; Ghosh, H. A comprehensive review of edge computing-empowered smart agriculture: Trends, opportunities and future directions. Comput. Electron. Agric. 2026, 241, 111252. [Google Scholar] [CrossRef]
  21. Kingston, P.H.; Scagel, C.F.; Bryla, D.R.; Strik, B.C. Influence of perlite in peat- and coir-based media on vegetative growth and mineral nutrition of highbush blueberry. HortScience 2020, 55, 658–663. [Google Scholar] [CrossRef]
  22. Gallegos-Cedillo, V.M.; Álvaro, J.E.; Capatos, T.H.; Hachmann, T.L.; Carrasco, G.; Urrestarazu, M. Effect of pH and silicon in the fertigation solution on vegetative growth of blueberry plants in organic agriculture. HortScience 2018, 53, 1423–1428. [Google Scholar] [CrossRef]
  23. Bryla, D.R.; Strik, B.C. Nutrient requirements, leaf tissue standards, and new options for fertigation of northern highbush blueberry. HortTechnology 2015, 25, 464–470. [Google Scholar] [CrossRef]
  24. Caspersen, S.; Svensson, B.; Håkansson, T.; Winter, C.; Khalil, S.; Asp, H. Blueberry–soil interactions from an organic perspective. Sci. Hortic. 2016, 208, 78–91. [Google Scholar] [CrossRef]
  25. Glonek, J.; Komosa, A. Fertigation of highbush blueberry (Vaccinium corymbosum L.). Part I. The effect on growth and yield. Acta Sci. Pol. Hortorum Cultus 2013, 12, 47–57. [Google Scholar]
  26. Klippel, E.; Bianchi, A.G.C.; Delabrida, S.; Silva, M.C.; Garrocho, C.T.B.; Moreira, V.d.S.; Oliveira, R.A.R. Deep learning approach at the edge to detect iron ore type. Sensors 2022, 22, 169. [Google Scholar] [CrossRef] [PubMed]
  27. Khan, Z.; Shen, Y.; Liu, H. Object detection in agriculture: A comprehensive review of methods, applications, challenges, and future directions. Agriculture 2025, 15, 1351. [Google Scholar] [CrossRef]
  28. de Avila, F.R.; Barbosa, J.L.V. Smart environments in digital agriculture: A systematic review and taxonomy. Comput. Electron. Agric. 2025, 236, 110393. [Google Scholar] [CrossRef]
  29. Al-Najadi, R.; Al-Mulla, Y.; Goher, K. Advances in intelligent and autonomous greenhouse systems: A comprehensive review of internet of things, artificial intelligence, and robotics integration. Smart Agric. Technol. 2026, 13, 101670. [Google Scholar] [CrossRef]
  30. Chen, X.; Jiang, Z.; Yang, J.; Ren, J.; Rao, Y.; Zhang, W. Data-driven decision support scheme for multi-area light environment control in greenhouse. Comput. Electron. Agric. 2023, 211, 108033. [Google Scholar] [CrossRef]
  31. Kuan, Y.N.; Goh, K.M.; Lim, L.L. Systematic review on machine learning and computer vision in precision agriculture: Applications, trends, and emerging techniques. Eng. Appl. Artif. Intell. 2025, 148, 110401. [Google Scholar] [CrossRef]
  32. Xu, L.; Zhang, J.; Li, S.; Zhu, G.; Zhao, H.; Yang, J.; Li, W.; Nie, H.; An, W.; Yang, B.; et al. TraitDiscover: An automated high-throughput platform for multimodal plant phenotyping with real-time trait analysis. Smart Agric. Technol. 2026, 13, 101691. [Google Scholar] [CrossRef]
  33. Ahamed, M.S.; Chowdhury, M.; Inam, A.K.M.S.; Kar, K.A.; Islam, M.N.; Karimzadeh, S.; Tabassum, S.; Kabir, M.S.; Akter, N.; Momin, A. A comprehensive review of advances in sensing and monitoring technologies for precision hydroponic cultivation. Comput. Electron. Agric. 2025, 237, 110601. [Google Scholar] [CrossRef]
  34. Maślanka, M.; Jancarczyk, D.; Rysinski, J. Integration of machine vision and PLC-based control for scalable quality inspection in Industry 4.0. Sensors 2025, 25, 6383. [Google Scholar] [CrossRef] [PubMed]
  35. Karimzadeh, S.; Li, Z.; Ahamed, M.S. Machine learning-based fault detection and diagnosis of electrical conductivity and pH sensors in hydroponic systems. Comput. Electron. Agric. 2025, 237, 110544. [Google Scholar] [CrossRef]
  36. Wang, Z.; Liu, Z.; Yuan, M.; Yin, W.; Zhang, C.; Zhang, Z.; Hu, X. A machine learning-based irrigation prediction model for cherry tomatoes in greenhouses: Leveraging optimal growth data for precision irrigation. Comput. Electron. Agric. 2025, 237, 110558. [Google Scholar] [CrossRef]
  37. Niu, Y.; Li, Y.; Han, Y.; Zhang, M.; Li, H. Decision method for greenhouse tomato light regulation based on the concavity of photosynthesis response. Comput. Electron. Agric. 2024, 222, 109088. [Google Scholar] [CrossRef]
Figure 1. Information-flow architecture of the greenhouse blueberry growth-stage determination and PLC-based fertigation parameter invocation system.
Figure 1. Information-flow architecture of the greenhouse blueberry growth-stage determination and PLC-based fertigation parameter invocation system.
Agriculture 16 01638 g001
Figure 2. Layout of the experimental unit in the small greenhouse prototype platform.
Figure 2. Layout of the experimental unit in the small greenhouse prototype platform.
Agriculture 16 01638 g002
Figure 3. Pipeline layout of the fertigation mixing and delivery unit.
Figure 3. Pipeline layout of the fertigation mixing and delivery unit.
Agriculture 16 01638 g003
Figure 4. Physical layout of the control cabinet and main functional modules.
Figure 4. Physical layout of the control cabinet and main functional modules.
Agriculture 16 01638 g004
Figure 5. Workflow of greenhouse blueberry stage-label determination, temporal consistency correction, and PLC parameter calling.
Figure 5. Workflow of greenhouse blueberry stage-label determination, temporal consistency correction, and PLC parameter calling.
Agriculture 16 01638 g005
Figure 6. Representative images of different growth stages of blueberry plants.
Figure 6. Representative images of different growth stages of blueberry plants.
Agriculture 16 01638 g006
Figure 7. Small-Scale Greenhouse Prototype Platform and PLC-Based Fertigation Parameter Invocation Validation System.
Figure 7. Small-Scale Greenhouse Prototype Platform and PLC-Based Fertigation Parameter Invocation Validation System.
Agriculture 16 01638 g007
Figure 8. Representative examples of correct and incorrect image-level classification of blueberry growth stages obtained by YOLOv8n-cls on the independent test set. The top row shows correctly classified samples, whereas the bottom row shows representative misclassified samples. “True” denotes the manually assigned image-level growth-stage label, and “Predicted” denotes the model output.
Figure 8. Representative examples of correct and incorrect image-level classification of blueberry growth stages obtained by YOLOv8n-cls on the independent test set. The top row shows correctly classified samples, whereas the bottom row shows representative misclassified samples. “True” denotes the manually assigned image-level growth-stage label, and “Predicted” denotes the model output.
Agriculture 16 01638 g008
Table 1. Blueberry growth stages, BBCH codes, and morphological determination criteria.
Table 1. Blueberry growth stages, BBCH codes, and morphological determination criteria.
Growth Stage Identified in This StudyApproximate BBCH Code RangeMain Morphological Determination CriteriaMain Visual Recognition Features
Budding stageBBCH 07–11, 51–53Leaf buds or flower buds begin to swell; bud scales loosen; green leaf tips or flower buds gradually become visible; flower buds or new shoots begin to sprout.Swollen buds, exposed young leaves, and clear morphological changes at the shoot tips.
Flowering and fruit-setting stageBBCH 57–69, including initial fruit set at BBCH 71Flower buds become visible, flowers open, petals gradually fall, and small green young fruits begin to appear after petal fall.Distinct features of flower buds, flowers, inflorescences, young fruits after petal fall, and initial fruit clusters.
Fruit expansion stageBBCH 72–79Young fruits enter the green-fruit development stage; fruit volume continues to increase, and fruit clusters gradually become full, but obvious coloration has not yet occurred.Green berries, enlarged fruit clusters, and increased fruit diameter without obvious coloration.
Ripening stageBBCH 81–89Fruits begin to color and gradually reach the cultivar-specific mature color; surface wax bloom becomes increasingly evident, and the proportion of mature fruits increases.Fruit coloration, surface wax bloom, and an increased proportion of blue-purple or dark-blue mature berries.
Note: The BBCH codes listed in this table represent an approximate grouping for visual recognition and PLC parameter invocation rather than a complete BBCH-based phenological survey. Blueberry growth stages are continuous, and transitional features are particularly evident among the late flowering stage, initial fruit set, and early green-fruit expansion. Therefore, BBCH 71 was treated in this study as the initial fruit-setting stage during the transition from flowering and fruit setting to fruit expansion. In practical application, the final growth-stage label should be determined jointly based on image features, stage progression order, and temporal consistency rules.
Table 2. Fertigation parameter invocation targets and determination basis for different blueberry growth stages.
Table 2. Fertigation parameter invocation targets and determination basis for different blueberry growth stages.
Growth StageSoil Moisture Target Range (%)EC Target Range (mS·cm−1)pH Target RangeFertigation Management StrategyBasis for Parameter Determination
Budding stage65–751.0–1.24.5–5.5Low-concentration and low-frequency irrigation and fertilization to avoid prolonged substrate over-wetting.Determined based on the acid substrate requirement of blueberry, the relatively weak root uptake capacity during budding, preliminary greenhouse operation, and local management experience.
Flowering and fruit-setting stage70–801.2–1.54.5–5.5Moderately increased water and nutrient supply to maintain stable substrate moisture.Determined based on the sensitivity of blueberry plants to water fluctuation during flowering and fruit setting, the need to maintain a relatively stable rhizosphere environment during fruit set, and relevant literature reports.
Fruit expansion stage75–851.5–1.84.5–5.5Increased irrigation frequency and maintenance of a relatively high nutrient supply level.Determined based on rapid fruit enlargement during the fruit expansion stage, increased transpiration and water demand, and preliminary system debugging results.
Ripening stage65–751.2–1.54.5–5.5Moderately reduced water and fertilizer supply to avoid excessive substrate moisture, with strengthened ventilation.Determined based on the need to avoid excessive substrate moisture during ripening, reduce the risk of fruit cracking and disease, and maintain stable management during fruit maturation.
Table 3. Performance comparison of different lightweight models in the image-level blueberry growth-stage classification task.
Table 3. Performance comparison of different lightweight models in the image-level blueberry growth-stage classification task.
ModelAccuracy (%)Macro Precision (%)Macro Recall (%)Macro F1 (%)Macro AP (%)Parameters (M)Model Size (MB)Accuracy 95% CI/%
YOLOv5n-cls70.2475.7771.8171.4384.791.3822.7359.75–78.96
YOLOv8n-cls80.9580.6782.0581.1091.251.4432.8371.28–87.92
YOLO11n-cls85.7184.0187.0484.8190.561.5363.0476.67–91.64
Tiny-YOLO-cls78.5778.7581.2878.6089.027.61314.5668.65–85.99
Table 4. Class-wise classification performance of YOLOv8n-cls on the independent test set.
Table 4. Class-wise classification performance of YOLOv8n-cls on the independent test set.
Growth StagePrecision (%)Recall (%)F1-Score (%)Class Accuracy (%)AP (%)
Budding stage83.3390.9186.9690.9195.42
Flowering and fruit-setting stage96.1583.3389.2983.3397.30
Fruit expansion stage68.1878.9573.1778.9586.80
Ripening stage75.0075.0075.0075.0085.46
Table 5. Confusion matrix of YOLOv8n-cls for blueberry growth-stage classification on the independent test set.
Table 5. Confusion matrix of YOLOv8n-cls for blueberry growth-stage classification on the independent test set.
True Class/Predicted ClassBudding StageFlowering and Fruit-Setting StageFruit Expansion StageRipening StageTotal
Budding stage1001011
Flowering and fruit-setting stage1252230
Fruit expansion stage0015419
Ripening stage1141824
Total1226222484
Table 6. Test results of blueberry growth stage label output and PLC integration.
Table 6. Test results of blueberry growth stage label output and PLC integration.
Test ItemTest ResultDescription
Stage label typeBudding stage; flowering and fruit-setting stage; fruit expansion stage; ripening stageCorresponding to PLC-based stage-specific parameter invocation
Edge-terminal determination and output time (ms)500–1000Including image acquisition, stage determination, and stage character output
Output formatStage label (S_k)Used for STM32-based coding conversion
Deployment platformK210Edge-terminal deployment
Communication modeSerial communicationThe K210 sends stage characters to the STM32
Coding method8421 codeThe STM32 outputs discrete codes through PA0–PA3
PLC integration modeDigital inputStage labels are input into the PLC control layer
HMI display statusNormal displayStage labels, operating status, and parameter invocation status can be displayed
Table 7. System operation performance test results.
Table 7. System operation performance test results.
Operation Performance IndicatorResultDescription
Edge-terminal determination and output time (ms)500–1000Including image acquisition, stage determination, and stage character output
Remote control response delay (s)0.3–1.0Time range from remote command issuance to actuator response
K210–STM32 communication statusNormalSerial communication could complete stage character transmission
STM32 coding output statusNormalStage characters could be converted into 8421-coded outputs
PLC input reading statusNormalThe digital input terminals could read the stage coding signals
PLC control logic operation statusNormalStage-specific parameter invocation and logical judgment operated stably
Command execution stabilityNo obvious abnormality observedNo obvious lag, command loss, or abnormal interruption occurred
System linkage statusNormal linkageRecognition, coding, PLC reading, parameter invocation, and actuator operation could run continuously
Control pathwayK210 → STM32 → PLC → actuator layerStage labels could be input into the PLC and participate in subsequent control processing
Table 8. PLC-based parameter invocation results under different growth stage labels.
Table 8. PLC-based parameter invocation results under different growth stage labels.
Input Stage LabelPLC-Invoked Target ParametersHMI Display StatusActuator Linkage StatusDescription
Budding stageSoil moisture, EC, and pH target ranges for the budding stage were invokedNormal displayIrrigation, fertilization, and environmental actuators could be linkedLow-concentration and low-frequency fertigation strategy
Flowering and fruit-setting stageSoil moisture, EC, and pH target ranges for the flowering and fruit-setting stage were invokedNormal displayIrrigation, fertilization, and environmental actuators could be linkedModerately increased water and nutrient supply
Fruit expansion stageSoil moisture, EC, and pH target ranges for the fruit expansion stage were invokedNormal displayIrrigation, fertilization, and environmental actuators could be linkedIncreased irrigation frequency and maintenance of a relatively high nutrient supply
Ripening stageSoil moisture, EC, and pH target ranges for the ripening stage were invokedNormal displayIrrigation, fertilization, and environmental actuators could be linkedModerately reduced water and fertilizer supply with strengthened ventilation
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.

Share and Cite

MDPI and ACS Style

Li, W.; Zhao, J.; Xu, H.; Wang, C.; Liu, X.; Lou, S.; Guo, C.; Zhang, X.; Zou, H. Development of a Vision-Based Growth-Stage Determination and PLC-Based Fertigation Parameter Invocation System for Greenhouse Blueberry. Agriculture 2026, 16, 1638. https://doi.org/10.3390/agriculture16151638

AMA Style

Li W, Zhao J, Xu H, Wang C, Liu X, Lou S, Guo C, Zhang X, Zou H. Development of a Vision-Based Growth-Stage Determination and PLC-Based Fertigation Parameter Invocation System for Greenhouse Blueberry. Agriculture. 2026; 16(15):1638. https://doi.org/10.3390/agriculture16151638

Chicago/Turabian Style

Li, Wenfeng, Jianghua Zhao, Hongyao Xu, Chaoyang Wang, Xi Liu, Shu Lou, Changli Guo, Xuankai Zhang, and Huan Zou. 2026. "Development of a Vision-Based Growth-Stage Determination and PLC-Based Fertigation Parameter Invocation System for Greenhouse Blueberry" Agriculture 16, no. 15: 1638. https://doi.org/10.3390/agriculture16151638

APA Style

Li, W., Zhao, J., Xu, H., Wang, C., Liu, X., Lou, S., Guo, C., Zhang, X., & Zou, H. (2026). Development of a Vision-Based Growth-Stage Determination and PLC-Based Fertigation Parameter Invocation System for Greenhouse Blueberry. Agriculture, 16(15), 1638. https://doi.org/10.3390/agriculture16151638

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop