GithubHelp home page GithubHelp logo

toannguyen1904 / dewi Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 0.0 585 KB

Official code of the paper "Deep-Wide Learning Assistance for Insect Pest Classification"

Python 100.00%
computer-vision convolutional-neural-network insect-classification machine-learning neural-network smart-agriculture

dewi's Introduction

Deep-Wide Learning Assistance for Insect Pest Classification

Official code of "Deep-Wide Learning Assistance for Insect Pest Classification."

avatar We propose DeWi, the novel learning assistance for insect pest classification. With a one-stage and alternating training strategy, DeWi simultaneously enhances several Convolutional Neural Networks in two perspectives: discrimination (by leveraging the benefit of triplet margin loss in a supervised training manner) and generalization (with the help of data augmentation). From that, DeWi can learn discriminative and in-depth features of insect pests (deep) yet still generalize well to a large number of categories (wide).

image Our DeWi models are better at focusing on meaningful features than the baseline methods.

Getting Started

We highly recommend you to create a separate conda environment for the project. Please follow the below steps to set up the environment and install the necessary packages.

conda create -n dewi python=3.8
conda activate dewi
conda install pytorch pytorch-cuda=11.6 -c pytorch -c nvidia
conda install pip
pip install -r requirements.txt

Data

Download the IP102 dataset from this URL and the D0 dataset from this URL. After downloading, change the dataset_path in config.py to the path of the images folder.

Running script

  • Change the root and checkpoint_path in config.py to the appropriate paths.

  • Assume you use the DeWi model with ResNet-152 variant, then run the following command to start training:

      python3 train.py dewi_resnet152
    

    After training each epoch, the validation and testing phases are automatically executed. The log files and checkpoint models are saved in the checkpoint_path. Replace name = k[:] by name = k[7:] in utils/auto_load_resume if you want to training a model which is trained on multiple GPUs.

Acknowledgement

Our source code is based on Ung et al.. Special thanks to them.

Contact

For any concerns, please contact Nguyen Thanh Binh (Associate Professor at University of Science Ho Chi Minh city) via [email protected].

dewi's People

Contributors

toannguyen1904 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.