Skip to content
/ DCT Public

[ICCVW 2021] Dynamic Color Transform Networks for Wheat Head Detection

Notifications You must be signed in to change notification settings

cxliu0/DCT

Repository files navigation

DCT

This repository includes the official implementation of the paper:

Dynamic Color Transform Networks for Wheat Head Detection

Plant Phenomics, 2022

& Dynamic Color Transform for Wheat Head Detection

International Conference on Computer Vision Workshops (ICCVW), 2021

Chengxin Liu, Kewei Wang, Hao Lu, Zhiguo Cao

Huazhong University of Science and Technology, China

Highlights

  • DCT is intuitive and steerable
  • We won 2nd Place in Global Wheat Challenge 2021 based on DCT
  • DCT is also applicable to other vision tasks, e.g., crowd counting

dct

Installation

Python Pytorch

  • Set up environment
# env
conda create -n dct python=3.7
conda activate dct

# install pytorch
conda install pytorch==1.10.0 torchvision==0.11.0 -c pytorch -c conda-forge
  • Install
# clone 
git clone https://github.com/cxliu0/DCT.git
cd DCT

# install dependecies
pip install -r requirements/build.txt

Data Preparation

DCT
├── data
│    ├── gwhd_2021
│         ├── images
│         ├── competition_test.csv
│         ├── competition_train.csv
│         ├── competition_val.csv
├── configs
├── models
├── ...
  • Preprocess data
python preprocess_data.py

Training

We follow a two-step training strategy.

  • Step 1: train a baseline Scaled-YOLOv4 model
sh train_baseline.sh
  • Step 2: fix the weights of the baseline model, and train DCT:
sh train_dct.sh

Evaluation

We implement the evaluation of ADA following Global Wheat Challenge 2021 (GWC 2021). Note that the tested ADA in this repository seems slightly lower than the official one.

  • Modify test_ADA.sh

weights: modify it to the path of your locally trained model

  • Run
sh test_ADA.sh

Pretrained models (Tested on the GWHD 2021 Dataset)

We also provide pretrained DCT models. You can download the models if you do not want to train DCT.

DCT Type DCT Arch Val ADA Test ADA Weights
Regression ResNet18 0.787 0.629 regDCT.pt
Classification ResNet18 0.782 0.630 clsDCT.pt

Citation

If you find this work or code useful for your research, please consider citing:

@article{liu2022dct,
  title = {Dynamic Color Transform Networks for Wheat Head Detection},
  author = {Chengxin Liu  and Kewei Wang  and Hao Lu  and Zhiguo Cao },
  journal = {Plant Phenomics},
  year={2022}
}

@INPROCEEDINGS{liu2021dct,
  author={Liu, Chengxin and Wang, Kewei and Lu, Hao and Cao, Zhiguo},
  booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision Workshops (ICCVW)}, 
  title={Dynamic Color Transform for Wheat Head Detection}, 
  year={2021},
  pages={1278-1283},
}

Acknowledgment

This repository is based on Scaled-YOLOv4.

About

[ICCVW 2021] Dynamic Color Transform Networks for Wheat Head Detection

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published