Next Article in Journal
Comparative Genomic and Secretome Analysis of Phytophthora capsici Strains: Exploring Pathogenicity and Evolutionary Dynamics
Previous Article in Journal
Combined Effects of Magnetized Irrigation and Water Source on Italian Lettuce (Lactuca sativa L. var. ramosa Hort.) Growth and Gene Expression
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Deep Learning for Stomatal Opening Recognition in Gynura formosana Kitam Leaves

1
College of Agricultural Engineering, Shanxi Agricultural University, Taigu, Jinzhong 030801, China
2
College of Life Sciences, Shanxi Agricultural University, Taigu, Jinzhong 030801, China
3
College of Food Science and Engineering, Shanxi Agricultural University, Taigu, Jinzhong 030801, China
4
College of Information Science and Engineering, Shanxi Agricultural University, Taigu, Jinzhong 030801, China
*
Author to whom correspondence should be addressed.
Agronomy 2024, 14(11), 2622; https://doi.org/10.3390/agronomy14112622
Submission received: 10 October 2024 / Revised: 3 November 2024 / Accepted: 4 November 2024 / Published: 6 November 2024
(This article belongs to the Section Precision and Digital Agriculture)

Abstract

:
Gynura formosana Kitam possesses beneficial properties such as heat-clearing, detoxification, and cough suppression, making it a highly nutritious plant with significant economic value. During its growth, the plant’s leaves are prone to infections that can impair stomatal function and hinder growth. Effective identification of stomatal openings and timely application of appropriate chemicals or hormones or indirect environmental adjustments (such as light, temperature, and humidity) to regulate stomatal openings are essential for maintaining the plant’s healthy growth. Currently, manual observation is the predominant method for monitoring stomatal openings of Gynura formosana Kitam, which is complex, labor-intensive, and unsuitable for automated detection. To address this, the study improves upon YOLOv8s by proposing a real-time, high-precision stomatal detection model, Refined GIoU. This model substitutes the original IoU evaluation methods in YOLOv8s with GIoU, DIoU, and EIoU while incorporating the SE (Squeeze-and-Excitation) and SA (Self-Attention) attention mechanisms to enhance understanding of feature representation and spatial relationships. Additionally, enhancements to the P2 layer improve the feature extraction and scale adaptation. The effectiveness of the Refined GIoU is demonstrated through training and validation on a dataset of 1500 images of Gynura formosana Kitam stomata. The results show that the Refined GIoU achieved an average precision (mAP) of 0.935, a recall of 0.98, and an F1-score of 0.88, reflecting an excellent overall performance. The GIoU loss function is better suited to detecting stomatal openings of Gynura formosana Kitam, significantly enhancing the detection accuracy. This model facilitates the automated, real-time monitoring of stomatal openings, allowing for timely control measures and improved economic benefits of Gynura formosana Kitam cultivation.

1. Introduction

Gynura formosana Kitam (scientific name: Pseudognaphalium affine) belongs to the Asteraceae family of plants of the genus Panax quinquefolium, and it is rich in nutrients, delicious in flavor, and a component of health care and medicinal diets [1]. Its entire plant is utilized in traditional medicine. Because of its strong adaptability under various growth conditions and rapid propagation, it has become an important experimental material. Gynura formosana Kitam is not only a beneficial edible and medicinal plant but also holds significant scientific value. Through further exploration and utilization, its potential applications in health care, medicine, and agriculture can be expanded, contributing positively to human health and sustainable development. With the increasing importance of people’s awareness of health, Gynura formosana Kitam has gradually attracted widespread attention from related industries. However, relevant research is still very scarce.
Stomata in the leaves of Gynura formosana Kitam affine play crucial roles in regulating vital physiological processes, including gas exchange, water balance, and temperature control, which are essential for understanding the ecosystem [2,3,4]. The stomatal characteristics of Gynura formosana Kitam are influenced by both genetic factors and external environmental conditions [5,6]. Research indicates that the density, size, and distribution of the stomata may adjust with changes in the growth environment to fully ensure the photosynthetic efficiency and water use efficiency [7,8,9,10]. The regulation of stomatal opening and closing significantly impacts the plant’s physiological functions and its response to environmental stresses. During drought or under disease conditions, Gynura formosana Kitam can enhance its stress tolerance and chances of survival by effectively regulating stomatal conductance to minimize water loss and pathogen invasion [11,12]. This defense mechanism not only enhances the immunity of Gynura formosana Kitam but also helps maintain its growth and breeding stability.
In plant science research, accurate measurement and analysis of stomatal aperture and density are essential. Traditional methods typically involve manually counting stomata under a microscope, as demonstrated by researchers such as Takahashi, Peel, and Sumathi, who used manual counting techniques to determine the number of stomata on plant leaf epidermises [13,14,15]. This approach is labor-intensive and prone to errors such as miscounts or omissions. To enhance the accuracy and efficiency, many experts have turned to the use of computer software such as ImageJ (Windows-based) for stomatal measurements [16]. ImageJ, a widely used image processing tool, offers automated algorithms for analyzing stomatal morphology and density. However, the process of annotating images with ImageJ is still time-consuming and labor-intensive. Consequently, researchers have continually sought ways to streamline the process to improve measurement efficiency. Early image processing technologies also had limitations based on plant species, presenting significant constraints for practical applications.
In recent years, image processing technology has been applied to various practical scenarios, particularly in leaf feature and stomatal analyses [17]. Jing Zhu et al. improved the identification accuracy of 14 plant species by processing images to extract leaf feature information, achieving a test accuracy of 92% [18]. Ji-you Zhu utilized remote sensing image processing software to analyze stomata on poplar leaves [19]. This method relies on capturing high-quality microscopic images of leaves and manually adjusting the software’s parameters to optimize the image processing, ensuring satisfactory results from the collected images. Millstead et al. employed the AlexNet algorithm for stomatal recognition using data from individual stomata, optimizing the processing speed and aiding research on plant physiology and ecology [20]. SANYAL analyzed tomato stomatal morphology using electron scanning microscopy, which provides high-resolution images, which are essential for detailed data on plant physiological functions [21].
Although existing methods effectively detect the location and number of stomata, detailed recognition of stomatal apertures remains challenging. Accurate measurement of stomatal apertures is crucial for understanding a plant’s environmental adaptability and photosynthetic efficiency. To address this issue, this study focuses on improving the YOLOv8s model and conducting detailed research on the stomatal opening sizes of Gynura formosana Kitam leaves. By optimizing and adjusting the model, we can accurately and efficiently identify the stomatal opening of Gynura formosana Kitam.
In plant research, the YOLO [22] (You Only Look Once) deep learning model has been used for stomatal detection and counting; however, most methods lack detailed recognition of stomatal apertures. To address this issue, this study enhances the YOLOv8s model to analyze stomatal apertures on Gynura formosana Kitam leaves by substituting the original IoU evaluation method with GIoU, DIoU, and EIoU, incorporating SE and SA attention mechanisms, and strengthening the P2 layer [23,24,25]. By comparing the accuracy, the improved model with the best results was named Refined GIoU and validated using three parts—leaf base, leaf middle, and leaf tip—to achieve more accurate and efficient identification of stomatal apertures of Gynura formosana Kitam.
In practical application scenarios, under the influence of external factors, such as environmental or temperature changes, stomatal openings on Gynura formosana Kitam leaves can be reasonably controlled by accurately identifying the leaves’ stomatal opening information, ensuring that Gynura formosana Kitam can absorb carbon dioxide for photosynthesis and water regulation. This is crucial for the healthy growth and adaptation of Gynura formosana Kitam under various environmental conditions.

2. Materials and Methods

2.1. Materials

2.1.1. Data Sources

To ensure the quality and representativeness of the data, this study used Gynura formosana Kitam (Puxian Bureau of Agriculture, Linfen, China) as the experimental subject. The data collection work was carried out during the mature stage, at about 3–4 months after sowing, with a specific collection time span from 7 July 2023 to 10 August 2023. During the data collection process, three time periods—morning, middle, and evening—were recorded, under all weather conditions, to ensure precise measurement of the stomatal apertures on Helianthus annuus leaves. During the data collection process (as shown in Figure 1), stomata were collected from the following three parts of the leaf: the base, middle, and tip. Stomatal images were captured using an upright fluorescence microscope (DM6B, Leica, Wetzlar, Germany) with a vertical 90° orientation. To ensure the data’s accuracy, various leaf peeling methods were compared, and the epidermal peeling method was ultimately selected to achieve clearer observations of the stomatal apertures.

2.1.2. Dataset Production Process

The experimental data were obtained using an upright fluorescence microscope. Subsequently, the stomata of the Gynura formosana Kitam were observed under 10×, 20×, and 40× magnifications, as illustrated in Figure 2, to summarize the stomatal aperture patterns. Data annotation was then performed on the stomata observed at 20× magnification to facilitate computational recognition of the stomatal apertures.
In the field of plant leaf identification, data augmentation is widely employed to enhance model performance and robustness. This study extensively utilized data augmentation techniques. As shown in Table 1, data expansion was performed after dividing the data into training, testing, and validation sets. As illustrated in Figure 3, these methods not only increased the quantity and diversity of the dataset but also effectively balanced the differences among the various classes. This allowed the model to learn and understand the characteristics of the different leaf samples more comprehensively, thereby improving its generalization ability.
To enhance the accuracy of leaf aperture recognition, the labelImg tool was employed for meticulous annotation of the captured images. The different states of the stomatal apertures of Gynura formosana Kitam were precisely labeled using the following data tags: sopen (slightly open), mopen (moderately open), lopen (fully open), and close (closed). The dataset was divided into training, validation, and test sets in an 8:1:1 ratio, resulting in 2405 images for training, 300 images for validation, and 302 images for testing. This distribution ensured sufficient training data for the model, facilitated optimization and selection using the validation set, and enabled evaluation of the model’s final performance through the test set.

2.2. Methods

The schematic diagram of the stomatal aperture recognition system for Gynura formosana Kitam leaves is shown in Figure 4, where the GIoU metric is used in place of the IoU evaluation standard in YOLOv8s.
To ensure accurate detection of stomata in Gynura formosana Kitam leaves, we propose the Refined GIoU model, building upon data sources, augmentation techniques, and the YOLOv8s network architecture. The key innovation of this model is the application of the GIoU metric, which improves upon the traditional IoU metric for nonoverlapping regions. The calculation formula is as follows:
GIoU = I C A B C
where A is the prediction box; B is the real box; C is the minimum overlapping area of A and B; I is the value of IoU; and G is the GIoU value. The GIoU evaluation method can also be optimized, with its loss function defined as follows:
L GIoU = 1 G
The calculation steps for the GIoU evaluation method are as follows:
Input: prediction box B P = ( x 1 , p , y 1 , p , x 2 , p , y 2 , p ) , real box B g = ( x 1 , g , y 1 , g , x 2 , g , y 2 , g ) ; output: L G I oU .
(1)
Calculate the area of B p and B g :
B p = ( x 2 , g x 1 , p ) × ( y 2 , p y 1 , p ) .
B g = ( x 2 , g x 1 , g ) × ( y 2 , g y 1 , g )
(2)
Calculate the overlap area I x , y between B p and B g :
x 1 = max ( x ^ 1 , p , x 1 , g ) , x 2 = min ( x ^ 2 , p , x 2 , g )
y 1 = max ( y ^ 1 , p , y 1 , g ) , x 2 = min ( y ^ 2 , p , y 2 , g )
I x , y = ( x 2 x 1 ) × ( y 2 y 1 ) , x 2 x 1 , y 2 y 1 , 0 , else ;
(3)
Let the area with the smallest B P B g be B c :
x 1 , c = min ( x ^ 1 , p , x 1 , g ) , x 2 , c = max ( x ^ 2 , p , x 2 , g ) , y 1 , c = min ( y ^ 1 , p , y 1 , g ) , x 2 , c = max ( y ^ 2 , p , y 2 , g ) ;
(4)
Calculate the area of B c :
B c = ( x 2 , c x 1 , c ) × ( y 2 , c y 1 , c )
(5)
IoU: I = I x , y B p + B g I x , y
(6)
GIoU: G = I B c ( B p + B g I x , y ) B c
(7)
Final loss L G I oU = 1 G .

2.2.1. YOLOv8s

In scientific research, ensuring the accuracy of stomatal aperture information for Gynura formosana Kitam leaves is crucial. Compared to traditional object detection algorithms, YOLOv8s offers not only faster detection speeds but also superior accuracy. This is particularly evident in the detection of small targets, where YOLOv8s, with its high speed and simple network architecture, has gained widespread recognition. Although early versions such as YOLOv5 and YOLOv7 have also made significant strides in the field of object recognition, the selection of YOLOv8s for this study is based on various considerations. YOLOv8s is noted for its balanced performance and practical effectiveness, earning considerable acknowledgment in the research community.
YOLOv8s comprises the following three main components: backbone, neck, and detection head. The backbone consists of the C2F, CBS, and SPPF modules, which extract features from the input image. The C2F module performs deep feature extraction through specific operations and branching structures, enabling effective feature extraction and fusion. The CBS module typically applies convolutional operations to the input image or feature maps. The SPPF module pools feature maps at different scales to capture richer feature information. The neck integrates and processes multiscale features extracted by the backbone network. Finally, the detection head utilizes these multiscale features to achieve accurate object detection.

2.2.2. Refined GIoU Model for Identifying Stomatal Apertures of Gynura formosana Kitam

The Refined GIoU model incorporates the minimum external matrix of both the predicted and truth boxes, positioning it as a leading approach in identifying stomatal apertures of Gynura formosana Kitam leaves. By introducing the minimum external matrix of the predicted and truth boxes, the model effectively addresses the issue of gradient vanishing when there is no overlap between target objects. This model features precise feature extraction and rapid spatial recognition capabilities, resulting in improved accuracy. These improved effects can prevent some target objects from being missed during recognition, providing a performance advantage over other recognition applications.
In the computation of the loss function in YOLO, the primary focus is on the IoU loss function. The IoU is calculated by taking the intersection of the predicted box (A) and the truth box (B), divided by their union. The formula is as follows:
I O U = A B A B
However, when calculating the IoU, if there is no overlap between the two targets, it will be zero. In such cases, if the gradient of the IoU as a loss function is equal to 0 in the absence of overlapping targets, the model cannot be optimized. Furthermore, the IoU does not accurately reflect the extent of the overlap between the targets.
Given the characteristics of the detection objects in this study, several issues arise. The surface of Gynura formosana Kitam leaves not only contains stomata but also includes structures such as chloroplasts and epidermal cells. As illustrated in Figure 5, these features make accurate detection in complex data environments and of complex network features more challenging. Specifically, the variability in the surrounding environment of the stomata complicates the task of clearly identifying the stomata when they overlap with other substances. Traditional IoU loss functions perform inadequately in handling overlapping regions between the target object and other substances. To address this, the study introduces a novel loss function, GIoU. Unlike IoU, which only considers the overlapping area, GIoU also takes into account the nonoverlapping regions, thereby providing a more effective solution for the complex task of detecting stomata on Gynura formosana Kitam leaves.

2.2.3. Coordination of Attention Mechanisms

This study primarily focuses on improving and comparing the following two attention mechanisms: SE and SA. The coordinated attention mechanism in the model is designed to identify and emphasize key information related to the target objects. Its main goal is to selectively focus on the most relevant parts of the data based on varying feature requirements. The model coordination attention mechanism is more likely to require mutual coordination among components or modules of different models to allocate recognition attention weights more effectively.
The SE attention mechanism mainly consists of two parts—Squeeze and Excitation—which improve the results in terms of accuracy and robustness by enhancing important features and suppressing redundant information. Its structure is shown in Figure 6.
The SA attention mechanism mainly enhances the model’s ability to pay attention to key information by calculating the relationships among input features. Its principle architecture is shown in Figure 7.

2.2.4. Additions to the P2 Small Target Detection Layer

In the process of object recognition, to achieve higher precision and the fine recognition of target objects, this study made improvements to the P2 layer, allowing for accurate recognition of small target details. Convolutional neural networks (CNNs) extract features from input images, which, along with confidence scores and other information, are combined to produce the final detection results. Compared to other types of substances, the P2 layer demands greater accuracy in boundary recognition.
In this study, an overall technical roadmap was drawn, demonstrating the process and sequence of the methods and technologies used, as well as outlining the actual experimental steps. The roadmap is shown in the Figure 8.

2.3. Performance Indicators

In evaluating models for Gynura formosana Kitam stomata recognition, this study employs mAP, average precision (AP), F1-score, and parameters for assessment. The primary metric is the model’s average precision, as both average precision and recall are fundamental quantitative evaluation metrics in fields such as information retrieval and model recognition, typically used to assess the performance and effectiveness of object detection algorithms. The F1-score balances precision and recall, highlighting the model’s ability to achieve a balance between accurate detection and comprehensive identification. The formulas for these performance metrics are as follows:
P is the precision rate, which is expressed as follows:
P = T P T P + F P × 100 % .
R is the recall rate, which is expressed as follows:
R = T P T P + F N × 100 % .
F1-score is the average of the precision and recall, as follows:
F 1 = 2 P R P + R × 100 % .
where TP is the number of cases that were detected as being in direct proportion, and the true value is also in direct proportion. FP is the number of cases that were predicted to be in direct proportion but were actually in negative proportion, and FN is the number of cases that were predicted to be negative but were actually in direct proportion. C is the number of detection categories, which was C = 4 in this study.

3. Results

This study used a Windows 10 laptop for model training and validation. The specific configuration and operating environment were as follows: the CPU was an I7-14650HX, the GPU was an RTX4060, the memory was 16GiB, the compiler was PyCharm 2023, and the main development environment was Python 3.9, CUDA 11.6, etc.

3.1. Results of the Identification of Stomatal Openings on Gynura formosana Kitam Leaves Using the Refined GIoU Model

Ability to detect the size of stomatal openings on Gynura formosana Kitam leaves using the Refined GIoU model. The confusion matrix and P-R curve of the improved algorithm are shown in Figure 9. The data in Figure 10 are borrowed from the loss function to measure the extent to which the predicted values are not the same as the true values, and to some extent, the performance of the model can be judged.
As shown in Figure 10, during the initial phase, the model underwent 150 iterations of training. The train/box_loss decreased from 1.5 to 1.3, reflecting the model’s adaptability in capturing the stomatal apertures of Gynura formosana Kitam leaves. The train/cls_loss decreased from 1.5 to 0.3 within the first 120 iterations and then stabilized at around 0.2, indicating the model’s ability to accurately predict object categories under various conditions. The train/dfl_loss, which measures the difference between predicted and actual values, decreased sharply from 1.10 to 1.03 initially and then gradually to a negligible 0.01, demonstrating the model’s precision in learning object orientation and angle information. On the validation set, the val/box_loss progressively declined from 1.27 to 1.05 and eventually to 0.20 between the 100th and 150th iterations. The val/cls_loss approached zero after 150 iterations, highlighting the high accuracy of the model’s category predictions during the validation phase. The val/dfl_loss decreased sharply from 1.02 to 0.98 at the start and then stabilized around 0.94 between the 100th and 150th iterations, further validating the model’s capability to capture object details and orientation information with the validation set.
During the validation phase, as illustrated in Figure 10, an analysis of the metrics/precision curve reveals the model’s accuracy in detecting Gynura formosana Kitam leaf stomatal openings. The metrics/mAP50 rapidly increased from the initial value to 0.90 and then gradually approached 0.95, indicating the model’s proficiency at a 50% IoU threshold. The metrics/recall, a crucial metric for evaluating model performance in object detection, started at 0.750 and improved over time. The metrics/mAP50-95, which measures the mean average precision across IoU thresholds from 50% to 95%, increased steadily to 0.70, providing a more nuanced assessment of the model’s performance across varying IoU thresholds. The analysis of all information presented in Figure 10 confirms that the Refined GIoU model effectively identifies complex features of stomatal apertures on Gynura formosana Kitam leaves, demonstrating its accuracy in handling recognition tasks.
Figure 11 shows the comparative validation effect of the stomatal openings of Gynura formosana Kitam, highlighting the performance of the Refined GIoU model on the validation dataset. By accurately comparing (a) and (b) in Figure 11, it can be clearly seen that the recognition rate of the stomatal aperture is very high, which is consistent with the basic facts of this study. These realistic data results further demonstrate the effectiveness and superiority of the Refined GIoU model in identifying stomatal openings on Gynura formosana Kitam leaves.
In this study, the input image size was set to 3840 pixels × 2400 pixels. To enhance the convergence speed, the weight decay coefficient was set to 0.0005, and the momentum parameter was set to 0.8. The training was conducted using the stochastic gradient descent algorithm with a total of 150 epochs.

3.2. Model Comparison of YOLOv8 for Improved Stomatal Opening Recognition on Gynura formosana Kitam Leaves

To investigate the impacts of various improvement methods on algorithm performance, this study conducted training and validation experiments with eight different algorithm enhancement combinations on the Gynura formosana Kitam stomatal dataset. These were compared with YOLOv8s. The results, as shown in Table 2, demonstrate a significant improvement in performance for stomatal opening detection on Gynura formosana Kitam leaves following model enhancements.
The model autonomously combines and improves its attention mechanism through learning, helping it better focus on important parts of the input data. This improves the accuracy of the recognition model, reduces shortcomings such as missed detections, and thus, provides a guarantee for the accuracy of the model in recognizing stomatal apertures on Gynura formosana Kitam leaves. Compared to traditional attention mechanisms, SE and SA are both innovative approaches. SA originates from the field of natural language processing and is particularly suitable for sequential data. It focuses on the relative positional relationships in the input sequence. Each element can directly interact with all other elements to generate new contextual representations. This mechanism emphasizes global correlations and can capture long-term dependencies. Based on the data comparison shown in Table 2 and combined with the recognition model in this study, SA is more suitable for improving the recognition of stomatal opening on the leaves of Gynura formosana Kitam. In terms of the loss function, this study’s model was also improved. As shown in Table 2, the GIoU, DIoU, and EIoU loss functions improved, all of which are based on the IoU. Specifically, as follows:
GIoU: Based on the IoU, the minimum bounding rectangles of the predicted box and the true box are considered. By introducing the minimum bounding rectangles of the predicted box and the true box, the weights of the predicted box and true box in the closure region are obtained, thus solving the problem of a zero gradient when two targets do not intersect. DIoU: Based on the IoU, it directly regresses the Euclidean distance between the center points of the two boxes, accelerating the convergence speed. The penalty term of the DIoU is based on the ratio of the distance between the center point and the diagonal distance. This avoids a situation in which the GIoU generates a large closure when the distance between the two boxes is large, resulting in a high loss value that is difficult to optimize. EIoU: On the basis of the CIoU, the aspect ratios were separated to clearly measure the differences in three geometric factors, namely, overlapping area, center point, and edge length.
Specifically, in terms of the overall performance, each improved model demonstrated a significant enhancement in the mAP values, as shown in Table 2. Among them, the Refined GIoU model exhibited the best performance when considering the practical context. In this study, it is considered the optimal combination model for identifying stomatal openings on Gynura formosana Kitam leaves.
Although there are some differences between the training and testing results, these variations did not impact the model’s recognition performance. Overall, the testing outcomes show a significant improvement over the training results, which provides substantial assurance of the model’s robustness.
During the process of improving the model, the most notable effect was the significant increase in the mAP values following the enhancement of the loss function. The integration of the SE and SA modules also contributed significantly to the model’s performance, resulting in higher mAP values. However, when compared to the improved GIoU loss function, the recognition accuracies of the models incorporating SE and SA were lower. Specifically, combining the optimized GIoU with either the SE or SA modules did not achieve the same performance gains as using GIoU alone. Consequently, these models may require further optimization to achieve optimal results.
In summary, the improved models have made significant strides in recognizing stomatal apertures of Gynura formosana Kitam leaves. Among these, the Refined GIoU model stands out as the best performer across various metrics, offering substantial advancements in addressing related recognition challenges. However, some finer modules still require further refinement and optimization. This work provides valuable insights for future research in this field.

3.3. Comparison of Recognition Models of the Same Type

To further validate the effectiveness of the Refined GIoU, we compared it with two similar algorithms, YOLOv5 and YOLOv7, as well as another version of YOLOv8, YOLOv8m. As shown in Table 3, YOLOv8s demonstrates a 0.122 increase in the mAP compared to YOLOv8m. YOLOv8m also shows significant advantages over YOLOv5 and YOLOv7. YOLOv5 is widely applicable and exhibits a stable performance across various scenarios and tasks, with good generalization capability. Over time, YOLOv5 maintained a relatively stable performance and achieved good accuracy on custom datasets. YOLOv7, on the other hand, offers a balance between high accuracy and efficiency, with advanced feature extraction and multiscale feature fusion technologies that enhance its ability to detect objects of varying sizes and shapes.
Different versions of the YOLO models may yield varying results depending on the application type. For instance, differences in dataset characteristics and specific data requirements can lead to divergent outcomes. YOLO models may perform differently across various scenarios and tasks, influenced by factors such as dataset features, computational resources, and specific detection needs. In practical applications, selecting the most suitable model requires considering these factors and conducting a comprehensive evaluation to ensure accuracy and efficiency in detection.
Figure 12 compares the mAP values of the Refined GIoU model with those of similar recognition models for the detection of stomatal apertures on Gynura formosana Kitam leaves. YOLOv5 exhibited a higher mAP value compared to YOLOv7. Although all three models use a similar “backbone + neck + head” network architecture, differences in design and performance remain. As illustrated in Figure 12, the Refined GIoU model demonstrates notable advantages in this context.
Based on an analysis of the data in Table 3 and Figure 12, the Refined GIoU model demonstrated an outstanding performance in terms of precision, mAP, recall, and F1-score. This study decided to use YOLOv8s. Although YOLOv5 and YOLOv7 achieved mAP values exceeding 70%, YOLOv8s presents more compelling mAP values in practical scenarios. YOLOv8s offers advantages such as high speed, multitask support, and ease of use and deployment, ensuring more reliable results. Most importantly, the versatility of the YOLOv8s model aligns well with our task of detecting stomatal apertures on Gynura formosana Kitam leaves, establishing a solid foundation for the model.
To better illustrate the performance differences among various models, Figure 13 provides a consolidated comparison. This study evaluated the Refined GIoU model for detecting stomatal apertures on Gynura formosana Kitam leaves. As shown in Figure 13, this model achieved an accuracy of 93.5% in identifying stomatal apertures. However, accurately identifying the target substance remains a challenging task among the various improved models. The differences in the results across these models are largely attributed to the variability and types of stomatal apertures on Gynura formosana Kitam leaves.

3.4. Model Validation

Fixed environmental variables in the dataset, such as lighting, temperature, and electrical fields, pose challenges to model performance. Collaborative research with plant experts has further validated our confidence in the model. As shown in Table 4, the model’s predictions for detecting stomatal apertures on Gynura formosana Kitam leaves align closely with expert evaluations, confirming the model’s accuracy, recall, and F1-score.
Based on real-world evaluation results, the model provides robust support for detecting stomatal apertures in the natural growth environment of Gynura formosana Kitam. These findings lay the foundation for the optimization and application of future models. With ongoing improvements in the field of model recognition, the Refined GIoU model is poised to play an indispensable role in agricultural development. Additionally, as the model’s performance continues to evolve, new research and technologies may further enhance the capabilities of various model versions or introduce superior target detection models. For specific target detection tasks, it is advisable to test and compare different model versions on actual data to identify the model that best meets needs.
Experimental results indicate that, on the custom dataset, YOLOv5 and YOLOv7 showed relatively better accuracy, with their performances being quite similar; however, YOLOv7 necessitates less model complexity and fewer computational resources. Yet YOLOv8 has its own advantages, potentially offering optimizations in model size and computational efficiency. However, YOLOv8 also has its own characteristics, such as optimization of model size and computational complexity. The specific advantages still need to be comprehensively evaluated based on actual applications and test results.

4. Discussion

In the detection of stomatal apertures on Gynura formosana Kitam leaves, the accuracy of the Refined GIoU model improved from 0.906 to 0.936, demonstrating its effectiveness in precise identification of stomatal apertures. This allows for accurate analysis and targeted interventions when environmental factors affect the plant, ensuring healthy growth. The overall mAP for the Gynura formosana Kitam leaf recognition model increased from 0.912 to 0.935, indicating an enhancement in the average detection accuracy across different stomatal apertures. Higher mAP values reflect a better model performance in recognizing various labels. The improvements in accuracy, mAP, recall, and F1-score signify that the model can efficiently and accurately detect stomatal apertures, which is crucial for optimizing Gynura formosana Kitam cultivation and implementing intelligent monitoring systems.
The impact of lighting during different time periods on the performance of the Refined GIoU model was divided into three time periods—morning, midday, and evening—as shown in Table 5. To ensure the accuracy of the results, the lighting conditions for each time period were maintained for approximately 50 images.
As derived from Table 5, the Refined GIoU model achieved an mAP of 92.6% under good light conditions at noon. However, in the evening, when the light was weak, the mAP drops to 77.9%, which is a 14.7% decrease. This suggests that light at different times of the day can severely affect the performance of the model.
Overall, the Refined GIoU model demonstrates significant effectiveness in identifying stomatal apertures on Gynura formosana Kitam leaves. The model clearly reveals that, at the start of the day, the stomata are closed. As the sun rises, the stomata gradually open, allowing air to enter, which provides carbon dioxide for photosynthesis and facilitates water loss. Conversely, at night, most stomata constrict, with some even closing completely, thereby reducing water evaporation and protecting the plant from water loss during the nighttime.

4.1. Impact of Environment on Performances of the Refined GIoU Models

Under these complex environmental conditions, factors such as temperature and light exposure can affect the degree of stomatal opening, leading to variability. This complexity presents additional challenges for the model.
Despite extensive work on data preprocessing and feature extraction, the performance of the Refined GIoU model, especially in complex environments, still requires further enhancement. While improvements in the model architecture have proven effective, additional refinements may demand substantial computational resources, which could pose challenges on certain platforms. The optimization of the model’s performance is closely linked to the diversity and quantity of the training data. Introducing the model to different growth environments or plant species may necessitate extensive retraining or adaptation to new datasets. External environmental factors, such as lighting conditions or the location of leaf stomatal tearing, can greatly affect the computational efficiency of the model. Although the model was effective on the current dataset, its general applicability may be limited in novel scenarios, particularly for different plant leaves or changing environmental conditions.
Addressing these challenges is crucial in real-world applications. Comprehensive field testing and model improvements are essential, particularly for different environmental conditions and plant species.

4.2. Impact of Confidence Thresholds on the Performances of Refined GIoU Models

In the field of machine learning, the confidence threshold is a crucial metric for assessing the reliability of model predictions. Balancing this threshold with model performance is particularly important in object detection, as it can impact both precision and recall. As illustrated in Figure 14a, when the confidence threshold was set to 0.895, the Refined GIoU model achieved a detection precision of 1.00 across all categories. This result indicates that the model effectively minimized false positives during prediction. Conversely, it also confirms that a reduction in the threshold could lead to a decrease in model precision.
Figure 14b presents an analysis of the recall–confidence curve. This curve demonstrates that even with the threshold approaching 0.001, the model’s average recall rate remained at 0.93. However, setting the threshold to 93% is likely to increase the rate of false positives.
The accuracy metrics achieved by the Refined GIoU model at high thresholds indicate that lowering the threshold may reduce the model’s precision while increasing recall. In practical applications, it is essential to adjust the confidence threshold appropriately to meet specific requirements. For instance, applications with stringent accuracy needs may require a higher threshold to ensure precision, whereas others might prioritize recall and, thus, benefit from a more accessible threshold.
In summary, the performance of the Refined GIoU in this study was extremely superior, but the key point of adjusting the confidence threshold cannot be ignored. Correctly and accurately adjusting the threshold size, combined with the specific needs of different applications, is a key step in achieving an optimal model performance.

5. Conclusions

The stomata in the leaves of Gynura formosana Kitam are important channels for material and energy exchange between Gynura formosana Kitam and its environment. This study proposes a new detection method to ensure the healthy growth of Gynura formosana Kitam. YOLOv8 was improved by adding a Refined GIoU loss function, which realizes the recognition and detection of stomatal openings on Gynura formosana Kitam leaves. This model helps to improve the adaptability of Gynura formosana Kitam in different environments and provides a guarantee for its healthy growth. The improved model was validated on a dataset consisting of 3007 images, and the final results were good, bringing potential economic benefits to related fields, such as health care, medicine, and agriculture. At the same time, it provides a new method for detecting stomatal openings of Gynura formosana Kitam. The conclusion of this study is as follows:
  • We propose improvements to the GIoU, DIoU, and EIoU metrics for more accurate evaluation of bounding box overlaps and improvement in the SE and SA attention mechanisms to enhance feature representation and localization accuracy. Additionally, optimization of the P2 layer refines feature extraction, thereby boosting detection performance.
  • The Refined GIoU model was employed to detect stomatal apertures on Gynura formosana Kitam leaves. Stomatal apertures were divided into the following four classes: very small, small, large, and closed. The model achieved a mean average precision (mAP) of 0.935, a recall of 0.98, and an F1-score of 0.88.
  • Comparisons were made with several other algorithms of the same type, and the improved model with the addition of Refined GIoU had the best overall performance.
The model provided an effective solution for identifying stomatal openings on Gynura formosana Kitam leaves, and exhibited a higher performance compared to other improved models. In future work, the team will further refine and optimize the Refined GIoU model to improve its robustness in different environments. In addition, the team will consider model migration to extend its application to leaf stomata of different plants and further expand its general applicability. The model is also applicable for the identification of plant leaf numbers, viruses, etc., for more accurate processing of plant leaves. More in-depth research can apply the improved model to real-life situations, such as intelligent planting systems, which can plant more efficiently using the model’s accuracy in identification to increase the economic benefits. The Refined GIoU model has significant advantages in identifying the size of stomatal openings on the leaves of Gynura formosana Kitam. Future research will further promote the development of smart agriculture and provide more accurate and effective technical support for the planting industry.

Author Contributions

Conceptualization, X.S. (Xinlong Shi); Methodology, X.S. (Xinlong Shi) and Z.L.; Software, X.S. (Xinlong Shi); Validation, Y.S.; Formal analysis, X.S. (Xinlong Shi), X.S. (Xiaojing Shi), Z.Z. and J.C.; Investigation, X.S. (Xinlong Shi) and Y.S.; Resources, Z.L.; Data curation, Y.S., W.L., Z.Z. and J.C.; Writing–original draft, X.S. (Xinlong Shi); Writing–review & editing, Z.L.; Visualization, X.S. (Xiaojing Shi), W.L. and Y.Z.; Supervision, W.L. and Z.L.; Project administration, X.S. (Xiaojing Shi) and Y.Z. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the ShanxiScholarship Council of China [grant number: 2023-092]; the Key R&D Program of Shanxi Province [grant number: 202302010101002]; Shanxi Agricultural University’s “Introduction of Talents Research Initiation Project” [grant number: 2021BQ113]; and Shanxi Province Graduate Education Innovation Project [grant number: 2022Y322].

Data Availability Statement

The data used in this study were self-collected. The dataset is undergoing further improvement; thus, it is unavailable at present.

Acknowledgments

The authors thank the Editor and anonymous reviewers for providing helpful suggestions for improving the quality of this manuscript.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Vanijajiva, O.; Kadereit, J.W. A revision of Gynura (Asteraceae: Senecioneae). J. Syst. Evol. 2011, 49, 285–314. [Google Scholar] [CrossRef]
  2. Fetter, K.C.; Eberhardt, S.; Barclay, R.S.; Wing, S.; Keller, S.R. Stomata Counter: A neural network for automatic stomata identification and counting. New Phytol. 2019, 223, 1671–1681. [Google Scholar] [CrossRef] [PubMed]
  3. Laga, H.; Shahinnia, F.; Fleury, D. Image-based Plant Stomata Phenotyping. In Proceedings of the 2014 13th International Conference on Control Automation Robotics & Vision (ICARCV), Singapore, 10–12 December 2014; pp. 217–222. [Google Scholar]
  4. Hetherington, A.M.; Woodward, F.I. The role of stomata in sensing and driving environmental change. Nature 2003, 424, 901–908. [Google Scholar] [CrossRef] [PubMed]
  5. Fanourakis, D.; Giday, H.; Milla, R.; Pieruschka, R.; Kjaer, K.H.; Bolger, M.; Vasilevski, A.; Nunes-Nesi, A.; Fiorani, F.; Ottosen, C.-O. Pore size regulates operating stomatal conductance, while stomatal densities drive the partitioning of conductance between leaf sides. Ann. Bot. 2014, 115, 555–565. [Google Scholar] [CrossRef]
  6. Fanourakis, D.; Heuvelink, E.; Carvalho, S.M.P. Spatial heterogeneity in stomatal features during leaf elongation: An analysis using Rosa hybrida. Funct. Plant Biol. 2015, 42, 737–745. [Google Scholar] [CrossRef]
  7. Fanourakis, D.; Sa, E.F.A.V.G.; Giday, H.; Hyldgaard, B.; Bouranis, D.; Körner, O.; Ottosen, C.-O. Low air humidity during cultivation promotes stomatal closure ability in rose. Eur. J. Hortic. Sci. 2019, 84, 245–252. [Google Scholar] [CrossRef]
  8. Fanourakis, D.; Bouranis, D.; Tsaniklidis, G.; Nejad, A.R.; Ottosen, C.-O.; Woltering, E.J. Genotypic and phenotypic differences in fresh weight partitioning of cut rose stems: Implications for water loss. Acta Physiol. Plant. 2020, 42, 1–10. [Google Scholar] [CrossRef]
  9. Fanourakis, D.; Giday, H.; Li, T.; Kambourakis, E.; Ligoxigakis, E.K.; Papadimitriou, M.; Strataridaki, A.; Bouranis, D.; Fiorani, F.; Heuvelink, E.; et al. Antitranspirant compounds alleviate the mild-desiccation-induced reduction of vase life in cut roses. Postharvest Biol. Technol. 2016, 117, 110–117. [Google Scholar] [CrossRef]
  10. Zhang, L.; Liu, L.; Zhao, H.; Jiang, Z.; Cai, J. Differences in Near Isohydric and Anisohydric Behavior of Contrasting Poplar Hybrids (I-101 (Populus alba L.) × 84 K (Populus alba L. × Populus glandulosa Uyeki)) under Drought-Rehydration Treatments. Forests 2020, 11, 402. [Google Scholar] [CrossRef]
  11. Jarvis, P.G. The interpretation of the variations in leaf water potential and stomatal conductance found in canopies in the field. Philos. Trans. R. Soc. 2020, 1976, 593–610. [Google Scholar]
  12. Ball, J.T.; Woodrow, I.E.; Berry, J.A. Model predicting stomatal conductance and its contribution to the control of photosynthesis under different environmental conditions. In Progress in Photosynthesis; Biggens, J., Ed.; Springer: Berlin/Heidelberg, Germany, 1987; pp. 221–224. [Google Scholar]
  13. Takahashi, S.; Monda, K.; Negi, J.; Konishi, F.; Ishikawa, S.; Hashimoto-Sugimoto, M.; Goto, N.; Iba, K. Natural variation in stomatal responses to environmental changes among arabidopsis thaliana ecotypes. PLoS ONE 2015, 10, e0117449. [Google Scholar] [CrossRef] [PubMed]
  14. Peel, J.R.; Mandujano, S.M.C.; López, P.J.; Golubov, J. Stomatal density, leaf area and plant size variation of Rhizophora mangle(Malpighiales: Rhizophoraceae)along a salinity gradient in the Mexican Caribbean. Rev. Biol. Trop. 2017, 65, 701–712. [Google Scholar] [CrossRef]
  15. Sumathi, M.; Bachpai, V.K.W.; Deeparaj, B.; Mayavel, A.; Dasgupta, M.G.; Nagarajan, B.; Rajasugunasekar, D.; Sivakumar, V.; Yasodha, R. Quantitative trait loci mapping for stomatal traits in interspecific hybrids of Eucalyptus. J. Genet. 2018, 97, 323–329. [Google Scholar] [CrossRef] [PubMed]
  16. Schneider, C.A.; Rasband, W.S.; Eliceiri, K.W. NIH Image to ImageJ:25 years of image analysis. Nat. Methods 2012, 9, 671–675. [Google Scholar] [CrossRef]
  17. Mohamed, A.; Dahl, G.; Hinton, G. Acoustic modeling using deep belief network. IEEE Trans. Audio Speech Lang. Process. 2012, 20, 14–22. [Google Scholar] [CrossRef]
  18. Zhu, J.; Tian, X.; Chen, B.; Lv, J. A computerised recognition system for plant leaf types. Bot. Bull. 2005, 22, 599–604. [Google Scholar]
  19. Jiyou, Z.; Chengyang, X.; Ju, W. A rapid method to measure stomatal density and stomatal area of plant leaves based on eCognition. J. Beijing For. Univ. 2018, 40, 37–45. [Google Scholar]
  20. Millstead, L.; Jayakody, H.; Patel, H.; Kaura, V.; Petrie, P.R.; Tomasetig, F.; Whitty, M. Accelerating automated stomata analysis through simplified sample collection and imaging techniques. Front. Plant Sci. 2020, 11, 580389. [Google Scholar] [CrossRef] [PubMed]
  21. Sanyal, P.; Bhattacharya, U.; Bandyopadhyay, S.K. Analysis of SEM Images of Stomata of Different Tomato Cultivars Based on Morphological Features. In Proceedings of the 2008 Second Asia International Conference on Modelling & Simulation (AMS), Kuala Lumpur, Malaysia, 13–15 May 2008; pp. 890–894. [Google Scholar]
  22. Redmon, J.; Farhadi, A. Yolov3: An incremental im-provement. arXiv 2018, arXiv:1804.02767. [Google Scholar]
  23. Shao, Z.F.; Wu, W.J.; Wang, Z.Y.; Du, W.; Li, C.Y. SeaShips:A large-scale precisely-annotated dataset for ship detection. IEEE Trans. Multimed. 2018, 20, 2593–2604. [Google Scholar] [CrossRef]
  24. Zheng, Z.H.; Wang, P.; Liu, W.; Li, J.Z.; Ye, R.G.; Ren, D.W. Distance-IoU Loss:Faster and Better Learning for Bounding Box Regression. In Proceedings of the AAAI Innovative Applications of Artificial Intelligence Conference, New York, NY, USA, 7–12 February 2020; pp. 12993–13000. [Google Scholar]
  25. Zhang, Y.F.; Ren, W.Q.; Zhang, Z.; Jia, Z.; Wang, L.; Tan, T.N. Focal and efficient IOU loss for accurate bounding box regression. Neurocomputing 2022, 506, 146–157. [Google Scholar] [CrossRef]
Figure 1. Stomatal collection: a comprehensive analysis of time periods, leaf parts, and tearing methods.
Figure 1. Stomatal collection: a comprehensive analysis of time periods, leaf parts, and tearing methods.
Agronomy 14 02622 g001
Figure 2. Data acquisition under different magnifications. Location of leaf sampling: venation and leaf margin.
Figure 2. Data acquisition under different magnifications. Location of leaf sampling: venation and leaf margin.
Agronomy 14 02622 g002
Figure 3. Enhancement of stomatal data in leaves of Gynura formosana Kitam.
Figure 3. Enhancement of stomatal data in leaves of Gynura formosana Kitam.
Agronomy 14 02622 g003
Figure 4. Schematic diagram of the system for identifying stomatal apertures of Gynura formosana Kitam. Integration of the collected dataset at 20× into the YOLOv8 framework for classification based on aperture size and GIoU assessment.
Figure 4. Schematic diagram of the system for identifying stomatal apertures of Gynura formosana Kitam. Integration of the collected dataset at 20× into the YOLOv8 framework for classification based on aperture size and GIoU assessment.
Agronomy 14 02622 g004
Figure 5. Sample images of complex environments. A and B represent other substances on the leaf that remove stomata, and A∩B represent stomata.
Figure 5. Sample images of complex environments. A and B represent other substances on the leaf that remove stomata, and A∩B represent stomata.
Agronomy 14 02622 g005
Figure 6. Squeeze and Excitation modules. White for Squeeze and other colors for Excitation.
Figure 6. Squeeze and Excitation modules. White for Squeeze and other colors for Excitation.
Agronomy 14 02622 g006
Figure 7. Self-attention schematic.
Figure 7. Self-attention schematic.
Agronomy 14 02622 g007
Figure 8. Overall technology road map.
Figure 8. Overall technology road map.
Agronomy 14 02622 g008
Figure 9. Refined GIoU confusion matrix and P-R curve.
Figure 9. Refined GIoU confusion matrix and P-R curve.
Agronomy 14 02622 g009
Figure 10. Analysis of the data results.
Figure 10. Analysis of the data results.
Agronomy 14 02622 g010
Figure 11. Verification comparison.
Figure 11. Verification comparison.
Agronomy 14 02622 g011aAgronomy 14 02622 g011b
Figure 12. Comparison of mAP values among models of the same type.
Figure 12. Comparison of mAP values among models of the same type.
Agronomy 14 02622 g012
Figure 13. Accuracy comparison of different YOLOv8s enhanced models.
Figure 13. Accuracy comparison of different YOLOv8s enhanced models.
Agronomy 14 02622 g013
Figure 14. Detection performance evaluation based on confidence threshold analysis.
Figure 14. Detection performance evaluation based on confidence threshold analysis.
Agronomy 14 02622 g014
Table 1. Data enhancement before and after comparison.
Table 1. Data enhancement before and after comparison.
ClassifyNumber of Images in DatasetData Enhanced
Training set11772405
Test set148302
Validation set147300
Aggregate14723007
Table 2. Comparison of improved models.
Table 2. Comparison of improved models.
ModelmAP (%)RecallF1-Score
TrainTrain
YOLOv8s0.9120.980.84
YOLOv8s + SE0.9270.980.88
YOLOv8s + SA0.9310.990.87
YOLOv8s + P20.9080.990.85
YOLOv8s + DIoU0.9280.980.88
YOLOv8s + EIoU0.9180.980.86
Refined GIoU0.9350.980.88
Refined GIoU + SE0.9280.980.88
Refined GIoU + SA0.9270.990.87
Table 3. Comparison of target detection models of the same type.
Table 3. Comparison of target detection models of the same type.
ModelmAP (%)RecallF1-Score
Train (%)Train (%)
YOLOv50.7460.990.70
YOLOv70.7271.000.68
YOLOv8m0.7900.990.73
YOLOv8s0.9120.980.84
Table 4. Comparison of model predictions and expert assessments.
Table 4. Comparison of model predictions and expert assessments.
ModelmAPRecallF1-Score
Model Prediction0.9350.9800.880
Expert Assessment0.9490.9660.880
Difference−0.0140.0140.000
Table 5. Experimental results under light conditions at different time periods.
Table 5. Experimental results under light conditions at different time periods.
TimeNo. of ImagesmAP
Morning (Average light)520.847
midday (Well-lit)480.926
evening (Lower light)540.779
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

Shi, X.; Song, Y.; Shi, X.; Lu, W.; Zhao, Y.; Zhou, Z.; Chai, J.; Liu, Z. Deep Learning for Stomatal Opening Recognition in Gynura formosana Kitam Leaves. Agronomy 2024, 14, 2622. https://doi.org/10.3390/agronomy14112622

AMA Style

Shi X, Song Y, Shi X, Lu W, Zhao Y, Zhou Z, Chai J, Liu Z. Deep Learning for Stomatal Opening Recognition in Gynura formosana Kitam Leaves. Agronomy. 2024; 14(11):2622. https://doi.org/10.3390/agronomy14112622

Chicago/Turabian Style

Shi, Xinlong, Yanbo Song, Xiaojing Shi, Wenjuan Lu, Yijie Zhao, Zhimin Zhou, Junmai Chai, and Zhenyu Liu. 2024. "Deep Learning for Stomatal Opening Recognition in Gynura formosana Kitam Leaves" Agronomy 14, no. 11: 2622. https://doi.org/10.3390/agronomy14112622

APA Style

Shi, X., Song, Y., Shi, X., Lu, W., Zhao, Y., Zhou, Z., Chai, J., & Liu, Z. (2024). Deep Learning for Stomatal Opening Recognition in Gynura formosana Kitam Leaves. Agronomy, 14(11), 2622. https://doi.org/10.3390/agronomy14112622

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