Skip to content

A lightweight convolutional neural network model for effectively classifying common insects and pests.

License

Notifications You must be signed in to change notification settings

ZhijunBioinf/GDnet-IP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GDnet-IP: Grouped Dropout-Based Convolutional Neural Network for Insect Pest Recognition

Downloads Stargazers Forks

DESCRIPTION

We introduce a grouped dropout strategy and modify the CNN architecture to improve the accuracy of multi-class insect recognition. Leveraging the Inception module’s branching structure and the adaptive grouping properties of the WeDIV clustering algorithm, we developed two grouped dropout models, the iGDnet-IP and GDnet-IP. Experimental results on a dataset containing 20 insect species (15 pests and five beneficial insects) with 73,635 images demonstrated an increase in cross-validation accuracy from 84.68% to 92.12%, with notable improvements in the recognition rates for difficult-to-classify species. Our model showed significant accuracy advantages over standard dropout methods on independent test sets, with much less training time compared to four conventional CNN models, highlighting the suitability for mobile applications.

Architecture of GDnet-IP

(A)

          (B)                            (C)

Grouped dropout-based CNN for insect pest recognition. (A) Architecture of GDnet-IP; (B) Inception-based GDnet-IP, where the grey branch is randomly deactivated; (C) Clustering-based GDnet-IP, where the channels in 'Group 2' are randomly deactivated.

Getting Started

Prerequisites

  • Python 3.7+
  • Required libraries:
    • PyTorch
    • NumPy
    • SciPy
    • Pandas

Steps to Install

  1. Clone the repository:
git clone https://github.com/ZhijunBioinf/GDnet-IP.git
cd GDnet-IP
  1. Install dependencies:
pip install -r requirements.txt

(back to top)

Usage

Prepare Your Dataset

Organize your insect images into folders based on their class. For example:

data/
├── ants/
│   ├── image1.jpg
│   ├── image2.jpg
├── bees/
│   ├── image1.jpg
│   ├── image2.jpg

Train the Model

To train the model, run:

python GDnet-IP.py --train

Test the Model

To test the model on new images, run:

python GDnet-IP.py --test

Customize the Configuration

Adjust training parameters such as batch size and learning rate by modifying the config.py file or using command-line arguments.

(back to top)

Contributors

This project was developed by:

We welcome contributions from the community! Feel free to submit pull requests or raise issues.

(back to top)

Dongcheng Li, Yongqi Xu, Zheming Yuan, Zhijun Dai*. GDnet-IP: Grouped Dropout-Based Convolutional Neural Network for Insect Pest Recognition. Agriculture, 2024, 14(11), 1915.

(back to top)

About

A lightweight convolutional neural network model for effectively classifying common insects and pests.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages