DiscoEPG: A Python package for characterization of insect electrical penetration graph (EPG) signals

Quang Dung Dinh, Daniel Kunk, Truong Son Hy, Vamsi J. Nalam, Phuong D. DaobioRxiv 2024

TL;DR

This paper introduces DiscoEPG, a Python package that automates the analysis of insect feeding behavior using Electrical Penetration Graph (EPG) data. By leveraging machine learning, DiscoEPG significantly speeds up the traditionally manual and time-consuming process of annotating EPG signals, making this valuable research tool more accessible and efficient for scientists.

What Problem Does This Paper Address?

The Electrical Penetration Graph (EPG) technique is a powerful method for studying how piercing-sucking insects feed on plants. It works by recording electrical signals generated as an insect probes plant tissues with its stylet. These signals produce distinct waveforms that correspond to different feeding behaviors (e.g., probing, salivation, ingestion). However, analyzing EPG data has been a major bottleneck. Traditionally, a skilled technician manually annotates these waveforms, a process that can take up to 30 minutes per hour of recording. This manual annotation is not only time-consuming but also prone to human error and variability between annotators. While some automated tools exist, they often suffer from low accuracy. This paper addresses the need for a robust, accurate, and efficient automated solution for EPG data analysis.

Methods

DiscoEPG offers a multi-faceted approach to EPG analysis. Its core innovation lies in its machine learning-based automatic annotation of EPG waveforms. The package implements a three-stage pipeline:

  1. Segmentation: The raw EPG signal is divided into fixed-size segments.
  2. Waveform Classification: Machine learning models are trained to classify these segments into different feeding behaviors. The authors experimented with both traditional ML algorithms (Random Forest, XGBoost, Logistic Regression) and deep learning models (1DCNN, ResNet, 2DCNN).
  3. Label Aggregation: The predictions from the ML models are combined to generate a complete waveform annotation for the entire recording.

Beyond annotation, DiscoEPG also provides tools for:

  • Data Reading and Visualization: Efficiently loading and displaying EPG data, including interactive plots for detailed inspection.
  • Parameter Calculation: Automatically computing various EPG parameters (e.g., occurrence frequency, duration of behaviors) that are crucial for understanding feeding patterns.
  • Statistical Analysis: Performing statistical tests to compare feeding behaviors across different groups or treatments.

The package is built using Python and leverages libraries like scikit-learn, PyTorch, and plotly for ML, visualization, and interactive plotting.

Datasets

The authors utilized a comprehensive set of 5 datasets for training and evaluating their models. These datasets comprise over 332 eight-hour recordings from 4 species of aphids and 6 species of host plants. The aphid species include:

  • Rhopalosiphum padi (bird cherry-oat aphid)
  • Myzus persicae (green peach aphid)
  • Phorodon cannabis (cannabis aphid)
  • Aphis glycines (Soybean aphid)

This extensive dataset is highlighted as being significantly larger than those used in previous automated EPG analysis studies.

Key Insights and Ideas

  • ML for EPG is a Game-Changer: The paper strongly advocates for the use of machine learning to overcome the limitations of manual EPG annotation, demonstrating that ML models can achieve high accuracy and significantly reduce analysis time.
  • Deep Learning vs. Traditional ML: While both traditional ML (especially XGBoost) and deep learning (1DCNN) showed strong performance, the paper suggests that deep learning models, particularly CNNs, can learn features autonomously, potentially simplifying the process.
  • Feature Engineering Matters (for Traditional ML): For traditional ML models, the choice of features is critical. The study found that while simple statistical features are effective, the best performance was achieved with Fourier transform for 1DCNN and wavelet transform for XGBoost.
  • Visualization is Key: The inclusion of interactive plotting tools is crucial for researchers to visually inspect the data, validate ML predictions, and gain a deeper understanding of insect behavior.
  • Comprehensive Toolset: DiscoEPG isn't just an annotation tool; it's a complete EPG analysis suite, integrating data loading, visualization, annotation, parameter calculation, and statistical analysis into a single package.

Key Results

  • High Annotation Accuracy: The selected ML models (XGB and 1DCNN) achieved an overall accuracy (OA) of over 90% in the EPG signal annotation task.
  • Waveform Localization Performance: The overlap rate (OR), which measures how well predicted waveform positions coincide with ground-truth positions, reached 80.6% for XGB and 75.7% for 1DCNN.
  • Reduced Annotation Time: DiscoEPG aims to cut annotation time from hours to minutes, making large-scale EPG studies more feasible.
  • Robustness: The models demonstrated good generalization across different scenarios due to rigorous evaluation on a large, diverse dataset.

Limitations and Future Work

The authors acknowledge several limitations and suggest future directions:

  • Segmentation Flexibility: The current sliding-window segmentation creates fixed-size segments, which can sometimes miss or misclassify short or complex waveforms. They suggest exploring more flexible segmentation algorithms, such as those based on fully convolutional neural networks (like UNet), to better capture waveform boundaries.
  • Visualization Enhancements: While DiscoEPG offers good visualization, they note that tools like Stylet+ provide superior graphical representations with more interactive features for fine-detail analysis. Future work could aim to integrate or enhance these visualization capabilities.
  • Extensibility: Although initially developed for aphids, the package is designed to be extensible to other piercing-sucking insects. Further validation and adaptation for different insect species would be beneficial.
  • Post-Prediction Assessment: Users are advised to perform post-prediction assessment to address potential inaccuracies, especially with complex or short waveforms.

Summary updated

Abstract

Abstract The Electrical Penetration Graph (EPG) technique is a well-known specialized tool that entomologists use to monitor and analyze the feeding behavior of piercing-sucking insects, such as aphids, whiteflies, and leafhoppers, on plants. Traditionally, the annotation is conducted by a well-trained technician who uses expert knowledge to compare the targeted waveforms with standard waveforms of aphid feeding behavior, which takes approximately 30 minutes to annotate an 8-hour recording depending on the complexity of the insect behaviors. Machine learning (ML) models, which shown great potential in monitoring insects behaviors, have recently been used to speed up this process. However, most publicly available tools that provide automatic annotation suffer from low prediction accuracy due to only using simple distinction rules to classify waveforms. For this reason, we develop DiscoEPG , an open-source Python package which performs accurate automatic EPG signal annotation. Various ML algorithms were experimented rigorously, which reports greater prediction power and improved accuracy in comparison to previous studies. In addition, we equipped our package with novel tools for generating journal-level plots to facilitate visual inspection, while including the computation of various EPG parameters and necessary statistical analysis which are popular in the research of aphids. With DiscoEPG , we aim to facilitate the rapid characterization of analysis of piercing-sucking insects feeding behavior through EPG signal, making this technique more viable to researchers who share the same interest. Our package is publicly available at: https://github.com/HySonLab/ML4Insects .
BibTeX
@misc{dinh2024discoepg,
  author = {Quang Dung Dinh and Daniel Kunk and Truong Son Hy and Vamsi J. Nalam and Phuong D. Dao},
  title = {{DiscoEPG: A Python package for characterization of insect electrical penetration graph (EPG) signals}},
  year = {2024},
  doi = {10.1101/2024.12.05.627099},
  howpublished = {bioRxiv},
}

Loading related content...

Figure