<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN" "journalpublishing.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" article-type="research-article" dtd-version="2.3" xml:lang="EN">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Plant Sci.</journal-id>
<journal-title>Frontiers in Plant Science</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Plant Sci.</abbrev-journal-title>
<issn pub-type="epub">1664-462X</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.3389/fpls.2024.1349209</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Plant Science</subject>
<subj-group>
<subject>Original Research</subject>
</subj-group>
</subj-group>
</article-categories>
<title-group>
<article-title>Counting nematodes made easy: leveraging AI-powered automation for enhanced efficiency and precision</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author" corresp="yes">
<name>
<surname>Saikai</surname>
<given-names>Kanan K.</given-names>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
<xref ref-type="aff" rid="aff2">
<sup>2</sup>
</xref>
<xref ref-type="author-notes" rid="fn001">
<sup>*</sup>
</xref>
<uri xlink:href="https://loop.frontiersin.org/people/2263241"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-original-draft/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-review-editing/"/>
</contrib>
<contrib contrib-type="author" corresp="yes">
<name>
<surname>Bresilla</surname>
<given-names>Trim</given-names>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
<xref ref-type="author-notes" rid="fn001">
<sup>*</sup>
</xref>
<role content-type="https://credit.niso.org/contributor-roles/writing-original-draft/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-review-editing/"/>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Kool</surname>
<given-names>Janne</given-names>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
<uri xlink:href="https://loop.frontiersin.org/people/1210546"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-review-editing/"/>
</contrib>
<contrib contrib-type="author">
<name>
<surname>de Ruijter</surname>
<given-names>Norbert C. A.</given-names>
</name>
<xref ref-type="aff" rid="aff3">
<sup>3</sup>
</xref>
<uri xlink:href="https://loop.frontiersin.org/people/2581764"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-review-editing/"/>
</contrib>
<contrib contrib-type="author">
<name>
<surname>van Schaik</surname>
<given-names>Casper</given-names>
</name>
<xref ref-type="aff" rid="aff4">
<sup>4</sup>
</xref>
<role content-type="https://credit.niso.org/contributor-roles/writing-review-editing/"/>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Teklu</surname>
<given-names>Misghina G.</given-names>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
<uri xlink:href="https://loop.frontiersin.org/people/1793579"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-review-editing/"/>
</contrib>
</contrib-group>
<aff id="aff1">
<sup>1</sup>
<institution>Agrosystems Research, Plant Science Group, Wageningen University and Research</institution>, <addr-line>Wageningen</addr-line>, <country>Netherlands</country>
</aff>
<aff id="aff2">
<sup>2</sup>
<institution>Ceradis B.V.</institution>, <addr-line>Wageningen</addr-line>, <country>Netherlands</country>
</aff>
<aff id="aff3">
<sup>3</sup>
<institution>Laboratory of Cell and Developmental Biology, Department of Plant Sciences, Wageningen University and Research</institution>, <addr-line>Wageningen</addr-line>, <country>Netherlands</country>
</aff>
<aff id="aff4">
<sup>4</sup>
<institution>Laboratory of Nematology, Department of Plant Sciences, Wageningen University and Research</institution>, <addr-line>Wageningen</addr-line>, <country>Netherlands</country>
</aff>
<author-notes>
<fn fn-type="edited-by">
<p>Edited by: Andreas Westphal, University of California, Riverside, United States</p>
</fn>
<fn fn-type="edited-by">
<p>Reviewed by: Haoyu Niu, Texas A and M University, United States</p>
<p>Chuanlei Zhang, Tianjin University of Science and Technology, China</p>
<p>Long Chen, RWTH Aachen University, Germany, in collaboration with reviewer CZ</p>
</fn>
<fn fn-type="corresp" id="fn001">
<p>*Correspondence: Kanan K. Saikai, <email xlink:href="mailto:Kanan.Kutsuwa@ceradis.com">Kanan.Kutsuwa@ceradis.com</email>; Trim Bresilla, <email xlink:href="mailto:trim.bresilla@wur.nl">trim.bresilla@wur.nl</email>
</p>
</fn>
</author-notes>
<pub-date pub-type="epub">
<day>26</day>
<month>06</month>
<year>2024</year>
</pub-date>
<pub-date pub-type="collection">
<year>2024</year>
</pub-date>
<volume>15</volume>
<elocation-id>1349209</elocation-id>
<history>
<date date-type="received">
<day>04</day>
<month>12</month>
<year>2023</year>
</date>
<date date-type="accepted">
<day>07</day>
<month>06</month>
<year>2024</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#xa9; 2024 Saikai, Bresilla, Kool, de Ruijter, van Schaik and Teklu</copyright-statement>
<copyright-year>2024</copyright-year>
<copyright-holder>Saikai, Bresilla, Kool, de Ruijter, van Schaik and Teklu</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/">
<p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.</p>
</license>
</permissions>
<abstract>
<p>Counting nematodes is a labor-intensive and time-consuming task, yet it is a pivotal step in various quantitative nematological studies; preparation of initial population densities and final population densities in pot, micro-plot and field trials for different objectives related to management including sampling and location of nematode infestation foci. Nematologists have long battled with the complexities of nematode counting, leading to several research initiatives aimed at automating this process. However, these research endeavors have primarily focused on identifying single-class objects within individual images. To enhance the practicality of this technology, there&#x2019;s a pressing need for an algorithm that cannot only detect but also classify multiple classes of objects concurrently. This study endeavors to tackle this challenge by developing a user-friendly Graphical User Interface (GUI) that comprises multiple deep learning algorithms, allowing simultaneous recognition and categorization of nematode eggs and second stage juveniles of <italic>Meloidogyne</italic> spp. In total of 650 images for eggs and 1339 images for juveniles were generated using two distinct imaging systems, resulting in 8655 eggs and 4742 <italic>Meloidogyne</italic> juveniles annotated using bounding box and segmentation, respectively. The deep-learning models were developed by leveraging the Convolutional Neural Networks (CNNs) machine learning architecture known as YOLOv8x. Our results showed that the models correctly identified eggs as eggs and <italic>Meloidogyne</italic> juveniles as <italic>Meloidogyne</italic> juveniles in 94% and 93% of instances, respectively. The model demonstrated higher than 0.70 coefficient correlation between model predictions and observations on unseen images. Our study has showcased the potential utility of these models in practical applications for the future. The GUI is made freely available to the public through the author&#x2019;s GitHub repository (<ext-link ext-link-type="uri" xlink:href="https://github.com/bresilla/nematode_counting">https://github.com/bresilla/nematode_counting</ext-link>). While this study currently focuses on one genus, there are plans to expand the GUI&#x2019;s capabilities to include other economically significant genera of plant parasitic nematodes. Achieving these objectives, including enhancing the models&#x2019; accuracy on different imaging systems, may necessitate collaboration among multiple nematology teams and laboratories, rather than being the work of a single entity. With the increasing interest among nematologists in harnessing machine learning, the authors are confident in the potential development of a universal automated nematode counting system accessible to all. This paper aims to serve as a framework and catalyst for initiating global collaboration toward this important goal.</p>
</abstract>
<kwd-group>
<kwd>nematode diagnostic</kwd>
<kwd>deep-learning</kwd>
<kwd>Meloidogyne</kwd>
<kwd>root-knot nematode</kwd>
<kwd>(CNN) convolutional neural network</kwd>
</kwd-group>
<contract-num rid="cn001">IF2022-12</contract-num>
<contract-sponsor id="cn001">Wageningen UR<named-content content-type="fundref-id">10.13039/501100006626</named-content>
</contract-sponsor>
<counts>
<fig-count count="8"/>
<table-count count="1"/>
<equation-count count="0"/>
<ref-count count="16"/>
<page-count count="13"/>
<word-count count="6335"/>
</counts>
<custom-meta-wrap>
<custom-meta>
<meta-name>section-in-acceptance</meta-name>
<meta-value>Technical Advances in Plant Science</meta-value>
</custom-meta>
</custom-meta-wrap>
</article-meta>
</front>
<body>
<sec id="s1" sec-type="intro">
<label>1</label>
<title>Introduction</title>
<p>The process of nematode counting is both labor-intensive and time-consuming, yet it serves as a crucial step in numerous quantitative nematological studies, including the preparation of initial population and final population densities related to nematode management in pot, micro-plot and field trials (<xref ref-type="bibr" rid="B2">Barker and Campbell, 1981</xref>). Accurate results heavily depend on the expertise of taxonomy of nematodes of the individuals conducting this task. This study aims to streamline the nematode counting process for <italic>Meloidogyne</italic> spp. juveniles and eggs by implementing a deep learning algorithm for automation.</p>
<p>Traditionally, nematode counting has been a manual process (<xref ref-type="bibr" rid="B10">Hussey and Barker, 1973</xref>; <xref ref-type="bibr" rid="B14">Seinhorst, 1988</xref>). Following the extraction of nematodes from plant materials or soil, they are collected in a water suspension and subjected to counting. Prolonged storage in water suspension makes the task of counting and identifying nematodes progressively challenging, even for experienced nematologists, as nematode might die due to depletion of stored food. In some cases, all nematodes in the entire sample are counted, but this can be impractical, especially when dealing with a large number of samples or a high nematode density per sample, due to the considerable time required. Consequently, many laboratories opt to count nematodes by analyzing subsamples from the mother suspension, although this approach can introduce errors and diminish statistical accuracy when few nematodes are counted (<xref ref-type="bibr" rid="B13">Schomaker and Been, 1998</xref>). Furthermore, the manual nematode counting process is susceptible to inconsistency when carried out by different individuals or prone to errors that may arise when an individual spends an extended period behind a microscope.</p>
<p>Nematologists have long recognized the challenges associated with nematode counting, prompting a few research initiatives to automate the process. <xref ref-type="bibr" rid="B3">Been et&#xa0;al. (1996)</xref> introduced ANECS (Automatic NEmatode Counting System), a software program designed to count juveniles of <italic>Globodera</italic> spp in water suspension. While this method achieved high detection accuracy, its widespread adoption among nematologists was hindered by the need for specialized and expensive hardware and image analysis systems. In more recent years, <xref ref-type="bibr" rid="B8">Holladay et&#xa0;al. (2016)</xref> adapted ImageJ, an open-source image analysis software, to create a standard curve for automated nematode counting based on the black and white pixel sizes in individual images. However, this method is limited to samples containing a single species of similarly sized nematodes and excludes samples with soil and root debris. Given the recent advancements in artificial intelligence, these challenges encountered during automated nematode counting can now be effectively tackled.</p>
<p>Deep learning, a broader realm within machine learning encompassing various architectures like Convolutional Neural Networks (CNNs), has garnered significant research attention among nematologists, as indicated by recent studies (<xref ref-type="bibr" rid="B1">Akintayo et&#xa0;al., 2018</xref>; <xref ref-type="bibr" rid="B5">Chen et&#xa0;al., 2020</xref>, <xref ref-type="bibr" rid="B4">2022</xref>; <xref ref-type="bibr" rid="B12">Kalwa et&#xa0;al., 2019</xref>; <xref ref-type="bibr" rid="B16">Uhlemann et&#xa0;al., 2020</xref>). The utilization of neural networks for computer-assisted nematode identification dates as early as 2000 when it was proposed by <xref ref-type="bibr" rid="B6">Diederich et&#xa0;al. (2000)</xref>. CNNs, the focus of this study, are computer programs designed to replicate how our brains process visual information, proving highly effective in the analysis of biological images, such as microscope pictures. Notably, there are compelling examples of AI-driven approaches for automating nematode counting. In their work, <xref ref-type="bibr" rid="B1">Akintayo et&#xa0;al. (2018)</xref> applied a deep learning architecture originally designed for detecting rare objects in cluttered images to the task of identifying eggs of <italic>Heterodera glycines</italic>. They designed the Convolutional Selective Autoencoder (CSAE) architecture, which facilitated rapid detection, consistency, and accuracy in identifying nematode eggs amidst debris. Likewise, <xref ref-type="bibr" rid="B12">Kalwa et&#xa0;al. (2019)</xref> developed a modified version of the U-Net convolutional autoencoder model learning algorithm, specifically customized for detecting <italic>H. glycines</italic> eggs in purified samples. In contrast to typical approaches using microscopic images, their imaging systems employed a high-resolution scanner and a light-emitting diode (LED) to illuminate the processed sample flowing through a microfluidic flow chip, along with a CMOS image sensor. Both studies necessitated prior staining. In 2020, Chen et&#xa0;al. adapted the standard U-Net architecture to automate the counting of worm-shaped objects. Instead of employing the standard bounding box detection method used in other studies, they utilized the skeleton to address overlapping and curled nematodes. Their initial model was primarily assessed on <italic>C. elegans</italic>. Subsequently, in 2022, Chen et&#xa0;al. extended their work by developing a segmentation model for cyst detection in soil debris. This was accomplished by leveraging the standard U-Net architecture and ResNet architecture. While not focused on counting, <xref ref-type="bibr" rid="B16">Uhlemann et&#xa0;al. (2020)</xref> effectively employed CNNs to differentiate between three entomopathogenic nematode species within the same family. To select the most appropriate architecture for their study, the researchers initially screened 13 CNN architectures available in 2020. They ultimately decided to employ Xception due to its highest accuracy among the options. Additionally, <xref ref-type="bibr" rid="B15">Shabrina et&#xa0;al. (2023)</xref> devised a deep-learning model aimed at automatically identifying 11 different genera of plant-parasitic nematodes commonly found in Indonesia. Although their primary focus was classification rather than quantification like <xref ref-type="bibr" rid="B16">Uhlemann et&#xa0;al. (2020)</xref>, they investigated four distinct architectures, ResNet101V2, CoAtNet-0, EfficientNetV2Bo, and EfficientNetV2M, across various augmentation processes. Their research culminated in the creation of a website capable of analyzing nematode images and providing genus-level identification.</p>
<p>While the aforementioned studies have demonstrated the effectiveness of deep learning for automating nematode counting, they have primarily been limited to single-class object identification within individual images. To make this technology more practical, there is a need for an algorithm capable of simultaneously detecting and classifying multiple objects, even when they cohabit with other objects that are confusing shapes and sizes, such as root and soil debris or non-target nematodes within individual samples. This study aims to address this challenge by developing a deep learning algorithm that can simultaneously identify and classify nematode eggs and juveniles of <italic>Meloidogyne</italic> spp. while distinguishing them from free-living nematodes and other clutter in the sample. The resulting algorithm will be shared as open-source software on GitHub for public use.</p>
</sec>
<sec id="s2" sec-type="materials|methods">
<label>2</label>
<title>Materials and methods</title>
<sec id="s2_1">
<label>2.1</label>
<title>Sample preparation</title>
<p>Eggs and second stage juveniles (J2) of <italic>Meloidogyne</italic> spp (RKN). were acquired from cultures maintained on tomato plants by the Plant Science Group at Wageningen University &amp; Research. Eggs were extracted from tomato roots using the bleach method (<xref ref-type="bibr" rid="B10">Hussey and Barker, 1973</xref>) and J2s were obtained by incubating 5-cm pieces of infected tomato roots in a mist chamber (<xref ref-type="bibr" rid="B14">Seinhorst, 1988</xref>). To create varying densities of nematodes in water suspension containing either eggs or J2s, we diluted the original suspensions. This allowed us to replicate scenarios with specimens in low abundance (non-overlapping specimens) to high density (commonly overlapping specimens) (<xref ref-type="fig" rid="f1">
<bold>Figure&#xa0;1</bold>
</xref>). The J2 suspensions occasionally contained free-living nematodes as contaminations. Before imaging, the J2 suspensions in a petri dish were subjected to a temperature of 40&#xb0;C for a period ranging from 30 seconds to 1 minute. This heat treatment was employed to minimize their movement and facilitate the imaging process. For further imaging, each well of the CELLSTAR 24 Well Cell Culture Plate (Greiner Bio-One B.V., Alphen aan den Rijn, The Netherlands), was filled with 2ml of either the egg or J2 suspensions.</p>
<fig id="f1" position="float">
<label>Figure&#xa0;1</label>
<caption>
<p>Illustrative samples of nematode egg and juvenile annotated images captured with LEITZ DM IRB. Images show eggs with low abundance <bold>(A)</bold> and high abundance <bold>(B)</bold>, annotated using bounding box annotations, as well as juveniles with low abundance <bold>(C)</bold> and high abundance <bold>(D)</bold>, annotated using segmentation.</p>
</caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fpls-15-1349209-g001.tif"/>
</fig>
</sec>
<sec id="s2_2">
<label>2.2</label>
<title>Image acquisition and annotation</title>
<p>The primary imaging tool for both eggs and J2s was the Leica Stellaris 5 Confocal LSM on a DMi8 microscope (Leica Microsystems, Wetzlar, Germany). Image acquisition was facilitated using LAS-X software V4.40 (Leica Microsystems) with LAS-X Navigator with Assay Editor to automatically visit any assigned location in Multiwell plates, resulting in a total of 600 images for eggs and 1289 images for J2s, which were automatically stitched (at 10% overlap) to display overviews of 24 well plates at a chosen resolution. To ensure image diversity for the algorithm development, two different magnifications and resolutions were employed at standard speed of 600 &#xb5;m/s, using 400 Hz scan speed at 512 x 512 pixels. Eggs and juveniles were imaged with 5x (NA 0.15) or 10x (NA 0.40) objective. The bright field images used in this study were captured as full transmission images and do not display a confocal z-slice. To further enhance the variety of images for computer learning during the algorithm development process, another LEITZ DM IRB inverted microscope (Leica Microsystems, Wetzlar, Germany) was utilized. Image acquisition was facilitated using ZEISS ZEN lite software (Carl Zeiss NTS Ltd, Oberkochen, Germany) equipped with a Zeiss Axiocam-712 color camera. With a 10x objective (NA 0.22), this camera captured 50 images each for both eggs and juveniles for annotation. A confocal image can be adjusted to any pixel density compatible with the resolution provided by the objective&#x2019;s numerical aperture (NA), while images captured using the LEITZ DM IRB system with the Axiocam 712 are set at a fixed, high pixel density. The acquisition methods differ significantly: the confocal acquires data pixel by pixel using the XY scanner, whereas the CMOS chip in the Axiocam 712 captures entire frames simultaneously.</p>
<p>Annotation for egg images involved two distinct object classes: dead egg (including eggshells) and nematode egg. These annotations were created using bounding box annotations (<xref ref-type="fig" rid="f1">
<bold>Figures&#xa0;1A, B</bold>
</xref>). Nematode eggs possess an oval morphology, which renders them amenable to straightforward detection techniques, such as bounding box annotations. Specifically, we employed LabelImg, an open-source graphical image annotation tool. Users can access this tool through its GitHub repository at [<ext-link ext-link-type="uri" xlink:href="https://github.com/tzutalin/labelImg">https://github.com/tzutalin/labelImg</ext-link>]. In the case of nematode juvenile images, we annotated two distinct object classes: root-knot nematode (RKN) and free-living nematode (FLN). This was achieved through segmentation annotation, utilizing Darwin V7 developed by V7 Labs (<xref ref-type="fig" rid="f1">
<bold>Figures&#xa0;1C, D</bold>
</xref>). The vermiform body structure of nematodes is well-suited for the use of segmentation-based methodologies. The segmentation algorithms are particularly effective in properly delineating objects with distinct shapes due to the well-adapted bounds of their thin forms. Further details about Darwin V7 can be found on the V7 Labs website: [<ext-link ext-link-type="uri" xlink:href="https://www.v7labs.com">https://www.v7labs.com</ext-link>]. A total of 8655 eggs and 5379 dead eggs were annotated from the egg images, along with 4742 RKNs and 1153 FLNs from the juvenile images.</p>
</sec>
<sec id="s2_3">
<label>2.3</label>
<title>Model development</title>
<sec id="s2_3_1">
<label>2.3.1</label>
<title>Environment setup</title>
<p>The training approach employed a resilient hardware setup. To facilitate expedited computations for deep learning, a specialized NVIDIA GTX 4080Ti Graphics Processing Unit (GPU) with a memory capacity of 12 GB GDDR6X was employed. The necessary computational assistance was facilitated by an Intel Core i9&#x2013;10900K processor, which possesses a default clock speed of 3.7 GHz and is equipped with 10 cores. The efficiency of data administration and model optimization was enhanced by the system&#x2019;s utilization of 64 GB of high-speed DDR4 RAM. Additionally, the inclusion of a 1 terabyte Solid-State Drive (SSD) facilitates expedited data retrieval and efficient storing of model checkpoints.</p>
<p>The training environment utilized Ubuntu 20.04 LTS, a widely-adopted and reliable Linux system renowned for its robustness in supporting deep learning activities. The utilization of GPU acceleration was achieved by the utilization of CUDA Toolkit 11.2, which was specifically designed for the NVIDIA GTX 4080ti GPU. The assurance of GPU compatibility was achieved with the installation of NVIDIA Driver version 465.19.01. Python 3.8.10 was utilized as the principal programming language to facilitate smooth connection with deep learning frameworks. Additionally, the OpenCV library version 4.5.3 was incorporated to enable sophisticated image processing operations.</p>
<p>The Mamba package manager, which serves as a viable alternative to Conda, was employed to handle the training environment. The rationale for this choice was rooted in the enhanced effectiveness of Mamba in handling package dependencies and resolving conflicts within the environment. The &#x2018;yolo_env&#x2019; Conda environment was constructed using Python 3.8. The integration of Mamba into the installation process facilitated the design of the environment and the installation of packages, ensuring a configuration that was free from errors and efficient. Afterwards, the necessary software packages, such as OpenCV and other relevant components, were installed via Mamba in order to achieve a smooth integration of libraries inside the system. This approach not only facilitated expedited environment configuration, but also enhanced the reliability and replicability of the training pipeline.</p>
</sec>
<sec id="s2_3_2">
<label>2.3.2</label>
<title>YOLOv8 model</title>
<p>YOLOv8, the most recent iteration of YOLO (You Only Look Once) object detection architecture as of January 10 in 2023, was chosen to build a deep learning model for the classification and detection of nematode eggs and juveniles. YOLOv8 is a highly adaptable solution that excels in many tasks related to object recognition and picture segmentation. It effectively combines attributes such as speed, accuracy, and user-friendliness, resulting in a successful and efficient approach. The versatility of the system is demonstrated by its capacity to handle big datasets, and its effectiveness across a range of hardware platforms, including both CPUs and GPUs, is noteworthy. YOLOv8 stands out for its superior performance in terms of both accuracy and execution speed compared to other models. To set up the latest version of the YOLOv8 library in a Python environment, the &#x201c;ultralytics&#x201d; package was imported, as detailed in <ext-link ext-link-type="uri" xlink:href="https://yolov8.com/">https://yolov8.com/</ext-link>. The Ultralytic repository provides a comprehensive description of the YOLOv8 model architecture.</p>
<p>In a nutshell, it&#x2019;s important to note that YOLOv8&#x2019;s anchor-free detection method improves its ability to handle a wide range of object sizes and shapes, all while simplifying the training process. The anchor-free detection in YOLOv8, predicting object centers directly, bypassing the need for predefined anchor boxes. This improves flexibility and efficiency, eliminating manual selection challenges and potential suboptimal results. Additional change in the YOLOv8 architecture which is relevant to our models is the replacement of C3 with C2f in the backbone, which altered the structure. Both C3 and C2f refer to distinct layers within the neural network architecture utilized for object detection. C3 represents a convolutional layer in the YOLO network, which comprises several layers followed by fully connected layers. In contrast, C2f serves as the fully connected layer succeeding the convolutional layers in YOLO&#x2019;s architecture. The C2f layer is responsible for processing the high-level features extracted by the convolutional layers to generate the final predictions. This alternation in the structure includes switching a 3x3 for the initial 6x6 convolution in the stem. In C2f, outputs from the Bottleneck are integrated, unlike in C3 where only the final output is used. YOLOv8 still maintains YOLOv5&#x2019;s Bottleneck structure, with the first convolution shifting from 1x1 to 3x3, aligning with the REsNEt block defined in 2015.</p>
<p>We employed the YOLOv8 Extra Large (YOLOv8x) model, which is the most precise but also the slowest among the five YOLOv8 models currently accessible. We used the default settings for both the convolutional layers and hyperparameters. The annotation data was divided into training and validation sets, with 6800 eggs and 4140 dead eggs in the training set, and 1855 eggs and 1239 dead eggs in the validation set, and 3840 RKN and 897 FLN in the training set and 902 RKN and 256 FLN in the validation set. The model&#x2019;s iterations were halted when the mean Average Precision at a 50% Intersection over Union (IoU) threshold for bounding boxes (metrics/mAP50(B)) reached a plateau, while the loss function indicated that the model was learning. IoU quantifies the overlap between predicted and ground truth bounding boxes, with values ranging from 0 to 1; 0 indicating no overlap and 1 indicating perfect overlap. The loss function evaluates the disparity between a model&#x2019;s predicted output and the actual target output, providing a measure of its performance on a given task. Minimizing this loss function during training aims to enhance accuracy in object detection. This step was taken to prevent overfitting. The source code for developing our models is available to readers on the author&#x2019;s GitHub repository (<ext-link ext-link-type="uri" xlink:href="https://github.com/bresilla/nematode_counting">https://github.com/bresilla/nematode_counting</ext-link>).</p>
</sec>
<sec id="s2_3_3">
<label>2.3.3</label>
<title>GUI development</title>
<p>A graphical user interface (GUI) was created to seamlessly integrate segmentation and detection models for nematode eggs and juveniles. This GUI was built using Python and leveraged the &#x201c;Tkinter&#x201d; packages. The specific capabilities and features of the GUI are elaborated in the results section. The source code for the development of our GUI can be accessed by readers on the author&#x2019;s GitHub repository (<ext-link ext-link-type="uri" xlink:href="https://github.com/bresilla/nematode_counting">https://github.com/bresilla/nematode_counting</ext-link>).</p>
<p>
<xref ref-type="fig" rid="f2">
<bold>Figure&#xa0;2</bold>
</xref> demonstrates the operational workflow of SEGNEMA. Following the user&#x2019;s selection of either a singular image or a batch of images, the application proceeds to partition the designated image into multiple smaller segments. The user retains the autonomy to specify the level of segmentation or opt for an undivided representation. Subsequent to this, the segmented images undergo simultaneous processing by two distinct models: the nematode detection model, responsible for segmentation, and the egg detection model, tasked with generating bounding boxes. Both models result in outputs detailing the quantity of detected and segmented objects. The segmented images are subsequently consolidated, and comprehensive labels, encompassing both detections and segmentations, are embedded. Furthermore, an independent module examines the results, probing for potential overlaps between segmentations and detections. To mitigate potential anomalies, such as duplicate edge detections, a post-consolidation step is employed to rectify redundant counts. This de-duplication process utilizes Intersection over Union (IoU) metrics. IoU measures the overlap between two bounding boxes drawn around detected objects, calculated as the area of overlap divided by the area of union between the two bounding boxes. By setting a threshold for IoU, redundant or overlapping detections can be effectively removed, thereby enhancing the accuracy and efficiency of object detection systems. Additionally, instances wherein an egg is erroneously identified as a nematode are addressed, with any overlaps exceeding the threshold of 60% leading to the elimination of the misidentified egg.</p>
<fig id="f2" position="float">
<label>Figure&#xa0;2</label>
<caption>
<p>The operational workflow of SEGNEMA.</p>
</caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fpls-15-1349209-g002.tif"/>
</fig>
</sec>
</sec>
<sec id="s2_4">
<label>2.4</label>
<title>Inference on unseen images</title>
<p>The performance of GUI SEGNEMA was evaluated using a dataset of previously unseen images that included both eggs and juveniles. In total, 100 images were captured, with 50 from the Stellaris 5 Confocal LSM and 50 from the LEITZ DM IRB microscope, each taken at a magnification of 10x. Before being processed by the trained model, an expert conducted object counting for each class within individual images. To evaluate the model&#x2019;s accuracy, the object count results obtained through the trained model were compared with those determined by the expert. In this evaluation, we examined the relationship between the two counting approaches by calculating the correlation coefficient and analyzing the discrepancies (residuals) between them. Furthermore, linear regression was conducted to assess a linear relationship between the observation and the model prediction for the classes of eggs and J2s. Given the premise that no objects should be detected in the absence of class objects within the images, we set the intercept to zero. This decision was made after conducting additional test runs of linear regression with an intercept and verifying that it was not significantly different from zero. The analyses mentioned earlier were carried out using R version 4.2.2, along with the default library.</p>
<p>Additionally, 10 well overviews from a 24-multiwell plate were made by stitching images with the Stellaris 5 Confocal LSM at a speed of 600 &#xb5;m/s at a magnification of 10x. Each well contained 2ml of a water with both nematode eggs and juveniles. All images being auto-captured with 10% overlap and stitched by the LAS-X software V4.40, were processed with SEGNEMA to assess the model&#x2019;s performance. The adjacent images used in the stitching process overlap by 10% of their width and height. This overlap helps in ensuring smooth transitions between the images when they are stitched together, reducing the chances of visible seams or discontinuities in the final stitched image. After being processed by the GUI, an expert performed object counting on the same 2ml of the test suspension using the conventional method of taking aliquot subsamples. In this method, the nematode eggs and juveniles were individually counted in one milliliter of the suspension in four repetitions after diluting to in total of 10ml with water, and the average count was used to determine the total number of test objects in the entire suspension volume. Similarly, to the aforementioned inference images, the relationship between the two counting approaches was analyzed by calculating the correlation coefficient and the residuals to estimate the discrepancy between the two approaches.</p>
</sec>
</sec>
<sec id="s3" sec-type="results">
<label>3</label>
<title>Results</title>
<sec id="s3_1">
<label>3.1</label>
<title>Model trained for eggs</title>
<p>By the time it reached the 500<sup>th</sup> iteration, the model achieved its highest level of accuracy. This was evident through the mean Average Precision at a 50% Intersection over Union (IoU) threshold for bounding boxes (metrics/mAP50(B)) reaching to 0.86, which serves as a measure of the overall quality of object detection (<xref ref-type="supplementary-material" rid="SF1">
<bold>Supplementary Figure&#xa0;1A</bold>
</xref>). Furthermore, the box loss score suggested that the trained model was still in the midst of learning, confirming that overfitting had not occurred yet. (<xref ref-type="supplementary-material" rid="SF1">
<bold>Supplementary Figure&#xa0;1B</bold>
</xref>). Examining the confusion matrix (<xref ref-type="fig" rid="f3">
<bold>Figure&#xa0;3</bold>
</xref>), it was found that 94% of instances correctly identified eggs as eggs, and 78% accurately classified dead eggs as dead eggs. Conversely, there was a 2% error rate where instances mistakenly categorized eggs as dead eggs, and a 9% error rate where they erroneously labeled dead eggs as eggs. The model exhibited a failure to detect eggs in 4% of instances and had a similar failure rate of 13% for dead eggs. In specific cases, the model also mistakenly labeled background as one of the two classes, with an 54% occurrence for egg and a 46% occurrence for dead egg, respectively.</p>
<fig id="f3" position="float">
<label>Figure&#xa0;3</label>
<caption>
<p>Confusion matrix for the detection of nematode eggs using the YOLOv8x deep-learning model.</p>
</caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fpls-15-1349209-g003.tif"/>
</fig>
</sec>
<sec id="s3_2">
<label>3.2</label>
<title>Model trained for second stage juveniles of <italic>Meloidogyne</italic> spp.</title>
<p>In a manner akin to the trained model for eggs, mAP50(M), which is similar to mAP50(B) but for segmentation, reached its zenith at 0.87 around the 200th iteration (<xref ref-type="supplementary-material" rid="SF2">
<bold>Supplementary Figure&#xa0;2A</bold>
</xref>). Both the mAP50(M) and box loss score affirmed that the model attained the utmost level of accuracy without the risk of overfitting problem (<xref ref-type="supplementary-material" rid="SF2">
<bold>Supplementary Figure&#xa0;2B</bold>
</xref>). Analysis of the confusion matrix (<xref ref-type="fig" rid="f4">
<bold>Figure&#xa0;4</bold>
</xref>) revealed that J2s of RKN were correctly identified as RKN in 93% of cases, and FLN were accurately classified as FLN in 79% of instances. Conversely, there was a 4% misclassification rate instances where J2s of RKN were mistakenly categorized as FLN, and 18% misclassification rate where FLN instances were erroneously labeled as J2s of RKN. Furthermore, the model encountered a failure to detect 3% of instances for J2s of RKN and 3% for FLN. In certain scenarios, the model also made the mistake of mislabeling the background as one of the two classes. When it occurs, 70% of such instances were for J2s of RKN and the remaining 30% were for FLN.</p>
<fig id="f4" position="float">
<label>Figure&#xa0;4</label>
<caption>
<p>Confusion matrix for the detection of nematode juveniles using the YOLOv8x deep-learning model.</p>
</caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fpls-15-1349209-g004.tif"/>
</fig>
</sec>
<sec id="s3_3">
<label>3.3</label>
<title>Instructions for GUI SEGNEMA</title>
<p>The GUI, named SEGNEMA, was developed with individual models trained for egg and juvenile detection and classification (<xref ref-type="fig" rid="f5">
<bold>Figure&#xa0;5</bold>
</xref>). To use this GUI, the user system must meet certain environment requirements; The GUI itself doesn&#x2019;t need any special requirements apart from a Python environment. However, to run the models, the computer needs to be set up to run neural networks. Specifically, it needs Pytorch installed. All the requirements and setup guide are within the shared link for the code (<ext-link ext-link-type="uri" xlink:href="https://github.com/bresilla/nematode_counting">https://github.com/bresilla/nematode_counting</ext-link>). Users are prompted to make a choice between selecting a folder or an image for analysis through the user interface, specifying the file path accordingly. The interface offers additional options, such as &#x201c;Threshold&#x201d; to establish a detection accuracy threshold for each juvenile (&#x201c;Threshold JUV&#x201d;) and egg model (&#x201c;Threshold EGG&#x201d;), which are set at 50% as default. Users are responsible for adjusting the thresholds through trial and error to achieve optimal detection performance. This can be visually assessed by examining the location of each class object with its bounding box and the associated detection probability values when the models are executed using images captured with a new imaging system. The &#x201c;Set Grids&#x201d; option to partition an image into selected grid sizes. Furthermore, users need to define the output file path for a CSV file, which contains the numbers of computer-detected objects for each class, and for output images that display bounding boxes indicating the object locations within the image, as exemplified in <xref ref-type="fig" rid="f6">
<bold>Figure&#xa0;6</bold>
</xref>.</p>
<fig id="f5" position="float">
<label>Figure&#xa0;5</label>
<caption>
<p>The interface of the GUI, SEGNEMA, which comprising the both nematode egg and juvenile detection models using YOLOv8x deep-learning models.</p>
</caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fpls-15-1349209-g005.tif"/>
</fig>
<fig id="f6" position="float">
<label>Figure&#xa0;6</label>
<caption>
<p>Illustrative samples of the output images of SEGNEMA, displaying the location of each class object with bounding box and their corresponding detection probability values, on the input images captured by Stellaris 5 Confocal LSM <bold>(A)</bold> and LEITZ DM IRB <bold>(B)</bold>.</p>
</caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fpls-15-1349209-g006.tif"/>
</fig>
</sec>
<sec id="s3_4">
<label>3.4</label>
<title>Inference for unseen images</title>
<p>The SEGNEMA GUI was used to perform inference on previously unseen images containing both nematode eggs and juveniles. The predefined thresholds were configured at 0.5 and 0.75 for juveniles, and 0.5 and 0.45 for eggs, specifically for the Stellaris 5 Confocal LSM and LEITZ DM IRB images, respectively. It normally took approximately 4 to 5 seconds to process a single image with the environment facilitated in this study. The model&#x2019;s performance resulted in correlation coefficient values of 0.81 and 0.98 for J2s of RKNs, and 0.72 and 0.96 for eggs in the Stellaris 5 Confocal LSM and LEITZ DM IRB images, respectively (<xref ref-type="table" rid="T1">
<bold>Table&#xa0;1</bold>
</xref>). The model performed well for eggs and J2s, as evidenced by the results in <xref ref-type="table" rid="T1">
<bold>Table&#xa0;1</bold>
</xref>, even in scenarios where the samples were densely populated with objects (<xref ref-type="fig" rid="f7">
<bold>Figure&#xa0;7</bold>
</xref>). The model demonstrated the capability to differentiate between overlapped nematodes when their heads were oriented in different directions, effectively treating them as distinct entities. Moreover, the models exhibited successful object detection, even when the objects were only partially visible within the image. However, the model exhibits a tendency to encounter difficulties when processing irregularly shaped objects, such as nematodes forming spiral patterns or when two objects overlap, giving the impression of a single entity. On occasion, the model may mistakenly identify fibers present in the samples or plate scratches as nematodes, particularly categorizing them as free-living nematodes. Additionally, when nematodes adopt a curled configuration, resembling a round shape, the model tends to struggle in distinguishing whether it is a nematode or an egg. The linear regression models showed that the predicted number of eggs could be obtained by multiplying the manual counting (observation) by 0.98 for Stellaris 5 Confocal LSM and 0.94 for LEITZ DM IRB (<italic>P</italic>-value &lt; 0.01). Similarly, the predicted number of J2s could be obtained by multiplying the manual counting by 0.75 and 0.89 for Stellaris Confocal LSM and LEITZ DM IRB, respectively (<italic>P</italic>-value &lt; 0.01).</p>
<table-wrap id="T1" position="float">
<label>Table&#xa0;1</label>
<caption>
<p>Correlation coefficients, mean, and median of residuals (the number of observed instances in an image - the number of model-predicted instances in an image) for each class taken by two different imaging systems.</p>
</caption>
<table frame="hsides">
<thead>
<tr>
<th valign="bottom" align="center">Image system</th>
<th valign="bottom" align="center">Class</th>
<th valign="bottom" align="center">Coefficient Correlation</th>
<th valign="bottom" align="center">Residual mean*</th>
<th valign="bottom" align="center">Residual median</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="bottom" align="left">Stellaris 5 Confocal LSM</td>
<td valign="bottom" align="left">Egg</td>
<td valign="bottom" align="center">0.72</td>
<td valign="bottom" align="center">-0.32</td>
<td valign="bottom" align="center">0</td>
</tr>
<tr>
<td valign="bottom" align="center"/>
<td valign="bottom" align="left">Dead-egg</td>
<td valign="bottom" align="center">0.71</td>
<td valign="bottom" align="center">2.32</td>
<td valign="bottom" align="center">2</td>
</tr>
<tr>
<td valign="bottom" align="center"/>
<td valign="bottom" align="left">RKN</td>
<td valign="bottom" align="center">0.81</td>
<td valign="bottom" align="center">2.32</td>
<td valign="bottom" align="center">2</td>
</tr>
<tr>
<td valign="bottom" align="left">
</td>
<td valign="bottom" align="left">FLN</td>
<td valign="bottom" align="center">0.34</td>
<td valign="bottom" align="center">-2.04</td>
<td valign="bottom" align="center">-1.5</td>
</tr>
<tr>
<td valign="bottom" align="left">LEITZ DM IRB</td>
<td valign="bottom" align="left">Egg</td>
<td valign="bottom" align="center">0.96</td>
<td valign="bottom" align="center">0.52</td>
<td valign="bottom" align="center">0</td>
</tr>
<tr>
<td valign="bottom" align="center"/>
<td valign="bottom" align="left">Dead-egg</td>
<td valign="bottom" align="center">0.96</td>
<td valign="bottom" align="center">-0.82</td>
<td valign="bottom" align="center">0</td>
</tr>
<tr>
<td valign="bottom" align="center"/>
<td valign="bottom" align="left">RKN</td>
<td valign="bottom" align="center">0.98</td>
<td valign="bottom" align="center">4.44</td>
<td valign="bottom" align="center">4</td>
</tr>
<tr>
<td valign="bottom" align="left">
</td>
<td valign="bottom" align="left">FLN</td>
<td valign="bottom" align="center">0.10</td>
<td valign="bottom" align="center">0</td>
<td valign="bottom" align="center">0</td>
</tr>
</tbody>
</table>
<table-wrap-foot>
<fn>
<p>*Residual = (observation)-(model prediction).</p>
</fn>
</table-wrap-foot>
</table-wrap>
<fig id="f7" position="float">
<label>Figure&#xa0;7</label>
<caption>
<p>Linear regression analysis between model predictions and observation for nematode eggs <bold>(A)</bold> and <italic>Meloidogyne</italic> J2s <bold>(B)</bold> for two imaging systems.</p>
</caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fpls-15-1349209-g007.tif"/>
</fig>
<p>Furthermore, the performance of SEGNEMA was assessed on 10 stitched images of an entire well that contained 1 ml of nematode suspension captured using Stellaris 5 Confocal LSM (<xref ref-type="fig" rid="f8">
<bold>Figure&#xa0;8</bold>
</xref>). The alteration made from the aforementioned configuration for the stitched images involved setting the grid size to 10x10 (Grid Size: 10x10). This adjustment allowed for the segmentation of a large-scale image, such as a 69.7MB stitched image, into a 10x10 grid. Consequently, this segmentation enabled processing by SEGNEMA. As per the conventional counting method, the counts of 10 stitched images for juveniles varied between 547 and 1553, while the counts for eggs ranged from 168 to 455. In contrast, using SEGNEMA, the counts of 10 stitched images for juveniles ranged from 492 to 1520, and for eggs, they ranged between 182 and 432. The correlation coefficients between the traditional nematode counting using subsampled aliquots and the counts produced by SEGNEMA were 0.99 for RKNs and 0.98 for eggs. The average and median values of the residuals for the J2s of RKN were 42.5 and 38.5, respectively. Similarly, for eggs, the average and middle values were -2.6 and -2.25, respectively. SEGNEMA processed 10 stitched images in about 3.5 minutes, while performing the same task manually took around 2.5 hours.</p>
<fig id="f8" position="float">
<label>Figure&#xa0;8</label>
<caption>
<p>Illustrative sample of the output image of SEGNEMA, displaying the location of each class object with bounding box on the stitched input images captured by Stellaris 5 Confocal LSM.</p>
</caption>
<graphic mimetype="image" mime-subtype="tiff" xlink:href="fpls-15-1349209-g008.tif"/>
</fig>
</sec>
</sec>
<sec id="s4" sec-type="discussion">
<label>4</label>
<title>Discussion</title>
<p>Our research showcased the effectiveness of the trained models, which attained a detection accuracy of over 90% for both life stages of <italic>Meloidogyne</italic> spp. eggs and juveniles, a genus known for its economic importance in various crops (<xref ref-type="bibr" rid="B11">Jones et&#xa0;al., 2013</xref>). To make these models easily accessible, we have created an open-source application called SEGNEMA, which can be found on the author&#x2019;s GitHub account (<ext-link ext-link-type="uri" xlink:href="https://github.com/bresilla/nematode_counting">https://github.com/bresilla/nematode_counting</ext-link>). SEGNEMA enables the simultaneous detection and classification of nematodes and eggs. In the future, additional models can be independently created for different genera, including cyst nematodes like <italic>Globodera</italic> spp. and <italic>Heterodera</italic> spp., as well as <italic>Pratylenchus</italic> spp. These models can then be seamlessly incorporated into the same GUI through the use of transfer learning techniques.</p>
<p>While our models have exhibited high accuracy in detecting and classifying objects, they have encountered challenges that are commonly reported in similar studies, as noted by <xref ref-type="bibr" rid="B1">Akintayo et&#xa0;al. (2018)</xref>, <xref ref-type="bibr" rid="B3">Been et&#xa0;al. (1996)</xref>, and <xref ref-type="bibr" rid="B4">Chen et&#xa0;al. (2022)</xref>. Like the models developed by <xref ref-type="bibr" rid="B1">Akintayo et&#xa0;al. (2018)</xref> and <xref ref-type="bibr" rid="B3">Been et&#xa0;al. (1996)</xref>, our models faced difficulties in distinguishing overlapped objects as distinct entities and in discerning nematodes from organic debris within samples. Furthermore, our models exhibited reduced detection accuracy when it came to FLN compared to the other class objects in this study. This can be attributed to both the limited number of instances for this particular class and the diverse range of lengths and shapes that FLN can assume. Nevertheless, these challenges can be mitigated by incorporating additional images that specifically address these conditions. This study has introduced a framework that can serve as a universal automation solution for nematode detection amidst multiple objects. However, it&#x2019;s crucial to recognize that no model is flawless, and ongoing improvements in object detection and classification are essential. Therefore, developers and users alike should remain vigilant in identifying scenarios where models may fall short.</p>
<p>In addressing some of the challenges encountered during the development of our model for this study, we experimented with various techniques. Initially, we employed bounding boxes for annotating nematodes, a method commonly used in object detection (<xref ref-type="bibr" rid="B9">Huang et&#xa0;al., 2016</xref>), as seen in the work by <xref ref-type="bibr" rid="B1">Akintayo et&#xa0;al. (2018)</xref>. However, we found that this approach did not yield the desired level of detection accuracy, especially when dealing with objects like nematodes that exhibit diverse shapes, overlap with each other, or are surrounded by debris in the sample. Subsequently, after the unsuccessful attempt with bounding boxes, we explored alternative annotation methods and ultimately concluded that segmentation offered the highest level of detection accuracy. We also investigated the utilization of the skeleton, referred to as key-point detection, as suggested in the study by <xref ref-type="bibr" rid="B5">Chen et&#xa0;al. (2020)</xref>, which demonstrated successful detection of intertwined and overlapping worm-shaped objects. However, for the small preliminary dataset we used, segmentation proved to be more effective in distinguishing RKN J2s from FLN. Additionally, it&#x2019;s worth mentioning that even with 10 key-points required to annotate an object, the process was quite labor-intensive and frequently necessitated additional key-points, particularly when annotating curled nematodes. With Darwin V7, the annotation system we employed, which allows for auto-segmentation of objects, facilitated the generation of the large annotated dataset in our study. The utilization of segmentation has also been applied successfully in other studies, such as the detection and phenotyping of cysts in samples with debris, as demonstrated by <xref ref-type="bibr" rid="B4">Chen et&#xa0;al. (2022)</xref>. Segmentation proved to be a valuable technique for annotating nematodes with diverse shapes, leading to noticeable enhancements in the model&#x2019;s ability to correctly identify curled nematodes as nematodes, rather than misclassifying them as eggs. However, it&#x2019;s important to note that further improvement in this regard would benefit from an increased dataset comprising more images depicting such cases.</p>
<p>Moreover, we observed a notable enhancement in our models&#x2019; object detection performance across different images and a notable increase in the mAP50 after integrating annotated images obtained from an additional microscope system. Specifically, the mAP50 for the egg model improved from 0.79 to 0.86, while for the juvenile model, it increased from 0.82 to 0.87. Prior to the inclusion of annotated images from the LEITZ DM IRB microscope, our models exhibited high accuracy in object detection primarily on images taken by the Stellaris 5 Confocal LSM system only. However, this performance improved considerably, as illustrated in <xref ref-type="table" rid="T1">
<bold>Table&#xa0;1</bold>
</xref> for the final model. Despite the fact that we utilized only two imaging systems in this study, this expansion in the variety of images has a profound impact on the models&#x2019; ability to achieve accurate detection. As machine learning models benefit from exposure to a wider array of images, this development translates to enhanced detection accuracy across different imaging systems, beyond those used in this particular study.</p>
<p>An issue previously raised in the context of automated counting systems was their reliance on specialized and costly hardware and image analysis systems, as highlighted by <xref ref-type="bibr" rid="B3">Been et&#xa0;al. (1996)</xref>. In our study, we addressed this concern by creating a user-friendly GUI called SEGNEMA, which is open source and freely accessible (<ext-link ext-link-type="uri" xlink:href="https://github.com/bresilla/nematode_counting">https://github.com/bresilla/nematode_counting</ext-link>). Once the optimal detection threshold is determined for eggs and juveniles, users should be able to maintain it consistently for the same imaging system, streamlining the usability of SEGNEMA for their specific needs. While SEGNEMA does necessitate a computer environment equipped with substantial graphics processing units (GPUs), this requirement remains reasonably accessible to a wide range of users. The processing time per image using SEGNEMA was typically around 4 to 5 seconds for our images, though this duration may vary depending on the image size. This provides a significantly faster alternative to manual labor for nematode counting, contributing to increased efficiency and productivity in the analysis process. For example, at a magnification of x10 and a speed of 600 &#xb5;m/s with the Stellaris 5 Confocal LSM, capturing 10 stitched images required 58 minutes. Adjusting the speed can enhance image resolution, but this comes at the cost of a longer image capture time. It&#x2019;s essential for readers to recognize the trade-off between efficiency (speed) and reliability (resolution). Even when considering the processing time using SEGNEMA, the total time is still less than half of what is typically needed for the conventional nematode counting method involving aliquot subsampling. Moreover, because the imaging system&#x2019;s stitching process is automated, the waiting period during image acquisition can be utilized for other tasks. Crucially, SEGNEMA ensures consistency in nematode counting, uninfluenced by variations in conditions, unlike manual counting methods.</p>
<p>Our research has effectively demonstrated the promising practical applications of these models, particularly through the user-friendly GUI that enables simultaneous detection and classification of nematodes. Presently, this GUI is tailored for nematode juveniles and eggs, but it possesses significant potential for broader applications across various nematode genera and in different media beyond aqueous solutions. The potential of acquiring fluorescent images simultaneous with the bright field images obtained from the confocal microscope is large and opens doors to automated multiplex (high content) acquisition with no time loss. Without any incubation or staining the autofluorescent images or spectra of nematodes can e.g. provide information on their viability (<xref ref-type="bibr" rid="B7">Forge and MacGuidwin, 1989</xref>), and probes can be used to add further specificity to the nematode discrimination.</p>
<p>It&#x2019;s also crucial to address the challenges identified in our study and similar research endeavors. However, tackling these challenges cannot be the sole responsibility of a single laboratory or research institution. Instead, it requires a collaborative effort, bringing together expertise from both nematologists and AI researchers across multiple organizations and research groups. For our GUI to be thorough in nematode detection and diagnostics, it&#x2019;s imperative to acquire a wider array of images captured through diverse imaging systems and develop models for different genera. Achieving this goal necessitates enhanced collaboration with fellow nematologists to access their image collections and tap into their expertise in nematode diagnostics. Given the growing interest among nematologists in harnessing the potential of machine learning, we are confident that the development of a universal automated nematode counting system accessible to everyone is within reach. The authors of this paper hope that it serves as a framework and catalyst for initiating global collaboration toward this important goal.</p>
</sec>
<sec id="s5" sec-type="disclaimer">
<title>Author&#x2019;s note</title>
<p>The subsequent authors following the first author are arranged in alphabetical order.</p>
</sec>
<sec id="s6" sec-type="data-availability">
<title>Data availability statement</title>
<p>The raw data used to develop models presented in this article will be made available by the authors, without reservation.</p>
</sec>
<sec id="s7" sec-type="author-contributions">
<title>Author contributions</title>
<p>KS: Writing &#x2013; original draft, Writing &#x2013; review &amp; editing. TB: Writing &#x2013; original draft, Writing &#x2013; review &amp; editing. JK: Writing &#x2013; review &amp; editing. NdR: Writing &#x2013; review &amp; editing. CvS: Writing &#x2013; review &amp; editing. MT: Writing &#x2013; review &amp; editing.</p>
</sec>
</body>
<back>
<sec id="s8" sec-type="funding-information">
<title>Funding</title>
<p>The author(s) declare financial support was received for the research, authorship, and/or publication of this article. This study was implemented with the support by the internal funding (Funding number IF2022-IF2023-12) of Agro-Systems Research, Plant Science Group of Wageningen Research.</p>
</sec>
<sec id="s9" sec-type="COI-statement">
<title>Conflict of interest</title>
<p>Author KS is employed by Ceradis B.V.</p>
<p>The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.</p>
</sec>
<sec id="s10" sec-type="disclaimer">
<title>Publisher&#x2019;s note</title>
<p>All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.</p>
</sec>
<sec id="s11" sec-type="supplementary-material">
<title>Supplementary material</title>
<p>The Supplementary Material for this article can be found online at: <ext-link ext-link-type="uri" xlink:href="https://www.frontiersin.org/articles/10.3389/fpls.2024.1349209/full#supplementary-material">https://www.frontiersin.org/articles/10.3389/fpls.2024.1349209/full#supplementary-material</ext-link>
</p>
<supplementary-material xlink:href="Image_1.tiff" id="SF1" mimetype="image/tiff">
<label>Supplementary Figure&#xa0;1</label>
<caption>
<p>Scores of mAP50(B) <bold>(A)</bold> and Box Loss <bold>(B)</bold> over iterations for the YOLOv8x deep-learning model for nematode egg detection.</p>
</caption>
</supplementary-material>
<supplementary-material xlink:href="Image_2.tiff" id="SF2" mimetype="image/tiff">
<label>Supplementary Figure&#xa0;2</label>
<caption>
<p>Scores of mAP50(M) <bold>(A)</bold> and Box Loss <bold>(B)</bold> over iterations for the YOLOv8x deep-learning model for nematode juvenile detection.</p>
</caption>
</supplementary-material>
</sec>
<ref-list>
<title>References</title>
<ref id="B1">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Akintayo</surname> <given-names>A.</given-names>
</name>
<name>
<surname>Tylka</surname> <given-names>G. L.</given-names>
</name>
<name>
<surname>Singh</surname> <given-names>A. K.</given-names>
</name>
<name>
<surname>Ganapathysubramanian</surname> <given-names>B.</given-names>
</name>
<name>
<surname>Singh</surname> <given-names>A.</given-names>
</name>
<name>
<surname>Sarkar</surname> <given-names>S.</given-names>
</name>
</person-group> (<year>2018</year>). <article-title>A Deep learning framework to discern and count microscopic nematode eggs</article-title>. <source>Sci. Rep.</source> <volume>8</volume>, <fpage>9145</fpage>. doi:&#xa0;<pub-id pub-id-type="doi">10.1038/s41598&#x2013;018-27272-w</pub-id>
</citation>
</ref>
<ref id="B2">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Barker</surname> <given-names>K.</given-names>
</name>
<name>
<surname>Campbell</surname> <given-names>C.</given-names>
</name>
</person-group> (<year>1981</year>). &#x201c;<article-title>Sampling nematode populations</article-title>,&#x201d; in <source>Plant parasitic nematodes</source>. Eds. <person-group person-group-type="editor">
<name>
<surname>Zuckerman</surname> <given-names>B. M.</given-names>
</name>
<name>
<surname>Rohde</surname> <given-names>R. A.</given-names>
</name>
</person-group> (<publisher-name>Academic Press</publisher-name>, <publisher-loc>New York</publisher-loc>), <fpage>451</fpage>&#x2013;<lpage>474</lpage>.</citation>
</ref>
<ref id="B3">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Been</surname> <given-names>T. H.</given-names>
</name>
<name>
<surname>Meijer</surname> <given-names>E. M. J.</given-names>
</name>
<name>
<surname>Beniers</surname> <given-names>A. E.</given-names>
</name>
<name>
<surname>Knol</surname> <given-names>J. W.</given-names>
</name>
</person-group> (<year>1996</year>). <article-title>Using image analysis for counting larvae of potato cyst nematodes (<italic>Globodera</italic> spp.)</article-title>. <source>Fundam. Appl. Nematol.</source> <volume>19</volume>, <fpage>297</fpage>&#x2013;<lpage>304</lpage>.</citation>
</ref>
<ref id="B4">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Chen</surname> <given-names>L.</given-names>
</name>
<name>
<surname>Daub</surname> <given-names>M.</given-names>
</name>
<name>
<surname>Luigs</surname> <given-names>H.-G.</given-names>
</name>
<name>
<surname>Jansen</surname> <given-names>M.</given-names>
</name>
<name>
<surname>Strauch</surname> <given-names>M.</given-names>
</name>
<name>
<surname>Merhof</surname> <given-names>D.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>High-throughput phenotyping of nematode cysts</article-title>. <source>Front. Plant Sci.</source> <volume>13</volume>, <elocation-id>965254</elocation-id>. doi:&#xa0;<pub-id pub-id-type="doi">10.3389/fpls.2022.965254</pub-id>
</citation>
</ref>
<ref id="B5">
<citation citation-type="confproc">
<person-group person-group-type="author">
<name>
<surname>Chen</surname> <given-names>L.</given-names>
</name>
<name>
<surname>Strauch</surname> <given-names>M.</given-names>
</name>
<name>
<surname>Daub</surname> <given-names>M.</given-names>
</name>
<name>
<surname>Jiang</surname> <given-names>X.</given-names>
</name>
<name>
<surname>Jansen</surname> <given-names>M.</given-names>
</name>
<name>
<surname>Luigs</surname> <given-names>H.-G.</given-names>
</name>
<etal/>
</person-group>. (<year>2020</year>). &#x201c;<article-title>A CNN framework based on line annotations for detecting nematodes in microscopic images</article-title>,&#x201d; in <conf-name>2020 IEEE 17th International Symposium on Biomedical Imaging (ISBI)</conf-name>, <conf-loc>USA</conf-loc>. <fpage>508</fpage>&#x2013;<lpage>512</lpage> (<publisher-name>IEEE, IA</publisher-name>). doi:&#xa0;<pub-id pub-id-type="doi">10.1109/ISBI45749.2020.9098465</pub-id>
</citation>
</ref>
<ref id="B6">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Diederich</surname> <given-names>J.</given-names>
</name>
<name>
<surname>Fortuner</surname> <given-names>R.</given-names>
</name>
<name>
<surname>Milton</surname> <given-names>J.</given-names>
</name>
</person-group> (<year>2000</year>). <article-title>Genisys and computer-assisted identification of nematodes</article-title>. <source>Nematology</source> <volume>2</volume>, <fpage>17</fpage>&#x2013;<lpage>30</lpage>. doi:&#xa0;<pub-id pub-id-type="doi">10.1163/156854100508863</pub-id>
</citation>
</ref>
<ref id="B7">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Forge</surname> <given-names>T. A.</given-names>
</name>
<name>
<surname>MacGuidwi</surname> <given-names>A. E.</given-names>
</name>
</person-group> (<year>1989</year>). <article-title>Nematode autofluorescence and its use as an indicator of viability</article-title>. <source>J. Nematol</source> <volume>21</volume>, <fpage>399</fpage>&#x2013;<lpage>403</lpage>.</citation>
</ref>
<ref id="B8">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Holladay</surname> <given-names>B. H.</given-names>
</name>
<name>
<surname>Willett</surname> <given-names>D. S.</given-names>
</name>
<name>
<surname>Stelinski</surname> <given-names>L. L.</given-names>
</name>
</person-group> (<year>2016</year>). <article-title>High throughput nematode counting with automated image processing</article-title>. <source>BioControl</source> <volume>61</volume>, <fpage>177</fpage>&#x2013;<lpage>183</lpage>. doi:&#xa0;<pub-id pub-id-type="doi">10.1007/s10526-015-9703-2</pub-id>
</citation>
</ref>
<ref id="B9">
<citation citation-type="confproc">
<person-group person-group-type="author">
<name>
<surname>Huang</surname> <given-names>J.</given-names>
</name>
<name>
<surname>Rathod</surname> <given-names>V.</given-names>
</name>
<name>
<surname>Sun</surname> <given-names>C.</given-names>
</name>
<name>
<surname>Zhu</surname> <given-names>M.</given-names>
</name>
<name>
<surname>Korattikara</surname> <given-names>A.</given-names>
</name>
<name>
<surname>Fathi</surname> <given-names>A.</given-names>
</name>
<etal/>
</person-group>. (<year>2016</year>). &#x201c;<article-title>Speed/accuracy trade-offs for modern convolutional object detectors</article-title>,&#x201d; in <conf-name>Proc. IEEE CVPR</conf-name>. (<publisher-loc>Honolulu, HI, USA</publisher-loc>: <publisher-name>IEEE Conference on Computer Vision and Pattern REcognition (CVPR)</publisher-name>). <fpage>3296</fpage>&#x2013;<lpage>3297</lpage>.</citation>
</ref>
<ref id="B10">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Hussey</surname> <given-names>R. S.</given-names>
</name>
<name>
<surname>Barker</surname> <given-names>K. R.</given-names>
</name>
</person-group> (<year>1973</year>). <article-title>A comparison of methods for collecting inocula for <italic>Meloidogyne</italic> spp. including a new technique</article-title>. <source>Plant Dis. Rep.</source> <volume>57</volume>, <fpage>1025</fpage>&#x2013;<lpage>1028</lpage>.</citation>
</ref>
<ref id="B11">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Jones</surname> <given-names>J. T.</given-names>
</name>
<name>
<surname>Haegeman</surname> <given-names>A.</given-names>
</name>
<name>
<surname>Danchin</surname> <given-names>E. G. J.</given-names>
</name>
<name>
<surname>Gaur</surname> <given-names>H. S.</given-names>
</name>
<name>
<surname>Helder</surname> <given-names>J.</given-names>
</name>
<name>
<surname>Jones</surname> <given-names>M. G. K.</given-names>
</name>
<etal/>
</person-group>. (<year>2013</year>). <article-title>Top 10 plant-parasitic nematodes in molecular plant pathology</article-title>. <source>Mol. Plant Pathol.</source> <volume>14</volume>, <fpage>946</fpage>&#x2013;<lpage>961</lpage>. doi:&#xa0;<pub-id pub-id-type="doi">10.1111/mpp.12057</pub-id>
</citation>
</ref>
<ref id="B12">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Kalwa</surname> <given-names>U.</given-names>
</name>
<name>
<surname>Legner</surname> <given-names>C.</given-names>
</name>
<name>
<surname>Wlezien</surname> <given-names>E.</given-names>
</name>
<name>
<surname>Tylka</surname> <given-names>G.</given-names>
</name>
<name>
<surname>Pandey</surname> <given-names>S.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>New methods of removing debris and high-throughput counting of cyst nematode eggs extracted from field soil</article-title>. <source>PloS One</source> <volume>14</volume>, <elocation-id>e0223386</elocation-id>. doi:&#xa0;<pub-id pub-id-type="doi">10.1371/journal.pone.0223386</pub-id>
</citation>
</ref>
<ref id="B13">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Schomaker</surname> <given-names>C. H.</given-names>
</name>
<name>
<surname>Been</surname> <given-names>T. H.</given-names>
</name>
</person-group> (<year>1998</year>). &#x201c;<article-title>Errors due to subsampling of soil samples with <italic>Globodera rostochiensis</italic> and <italic>G. pallida</italic>, and to other laboratory procedures</article-title>,&#x201d; in <source>
<italic>Quantitative studies on the management of potato cyst nematode (Globodera</italic> spp.<italic>) in The Netherlands</italic>
</source>. Eds. <person-group person-group-type="editor">
<name>
<surname>Been</surname> <given-names>T. H.</given-names>
</name>
<name>
<surname>Schomaker</surname> <given-names>C. H.</given-names>
</name>
</person-group> (<publisher-name>Wageningen University</publisher-name>, <publisher-loc>Wageningen</publisher-loc>), <fpage>35</fpage>&#x2013;<lpage>70</lpage>.</citation>
</ref>
<ref id="B14">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Seinhorst</surname> <given-names>J. W.</given-names>
</name>
</person-group> (<year>1988</year>). <article-title>The estimation of densities of nematode population in soil and plants</article-title>. <source>Vaxtskyddsrapporder</source> <volume>51</volume>, <fpage>107</fpage>.</citation>
</ref>
<ref id="B15">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Shabrina</surname> <given-names>N. H.</given-names>
</name>
<name>
<surname>Lika</surname> <given-names>R. A.</given-names>
</name>
<name>
<surname>Indarti</surname> <given-names>S.</given-names>
</name>
</person-group> (<year>2023</year>). <article-title>Deep learning models for automatic identification of plant-parasitic nematode</article-title>. <source>Artif. Intell. Agric.</source> <volume>7</volume>, <fpage>1</fpage>&#x2013;<lpage>12</lpage>. doi:&#xa0;<pub-id pub-id-type="doi">10.1016/j.aiia.2022.12.002</pub-id>
</citation>
</ref>
<ref id="B16">
<citation citation-type="confproc">
<person-group person-group-type="author">
<name>
<surname>Uhlemann</surname> <given-names>J.</given-names>
</name>
<name>
<surname>Cawley</surname> <given-names>O.</given-names>
</name>
<name>
<surname>Kakouli-Duarte</surname> <given-names>T.</given-names>
</name>
</person-group> (<year>2020</year>). &#x201c;<article-title>Nematode identification using artificial neural networks</article-title>,&#x201d; in <conf-name>Proceedings of the 1st International Conference on Deep Learning Theory and Applications</conf-name>. <fpage>13</fpage>&#x2013;<lpage>22</lpage> (<publisher-loc>Setubal, Portugal</publisher-loc>: <publisher-name>SCITEPRESS-Science and Technology Publications, Lda</publisher-name>). doi:&#xa0;<pub-id pub-id-type="doi">10.5220/0009776600130022</pub-id>
</citation>
</ref>
</ref-list>
</back>
</article>