Git Product home page Git Product logo

wheat-head-detection's Introduction

Global-Wheat-Detection

Showcases the use of deep learning to detect wheat heads from crops. The project is based on this Kaggle Competition: https://www.kaggle.com/c/global-wheat-detection.

Here's a description of the prediction task:

In this competition, you’ll detect wheat heads from outdoor images of wheat plants, including wheat datasets from around the globe. Using worldwide data, you will focus on a generalized solution to estimate the number and size of wheat heads. To better gauge the performance for unseen genotypes, environments, and observational conditions, the training dataset covers multiple regions. You will use more than 3,000 images from Europe (France, UK, Switzerland) and North America (Canada). The test data includes about 1,000 images from Australia, Japan, and China.

- Source

Data

An overview is available here: https://www.kaggle.com/c/global-wheat-detection/data.

The dataset includes images that either have wheat heads or do not have them. Here are some examples:

(The following ones do not have any wheat heads)

I used the following command to obtain the data:

$ kaggle competitions download -c global-wheat-detection

This is an object detection task and the project uses TensorFlow Object Detection (TFOD) API .

About the files & directories

β”œβ”€β”€ faster_rcnn_resnet101_coco_11_06_2017: Contains the pre-trained checkpoints and frozen inference graph.
β”‚   β”œβ”€β”€ saved_model
β”‚   β”‚   β”œβ”€β”€ variables
β”‚   β”‚   └── saved_model.pb
β”‚   β”œβ”€β”€ checkpoint
β”‚   β”œβ”€β”€ frozen_inference_graph.pb
β”‚   β”œβ”€β”€ model.ckpt.data-00000-of-00001
β”‚   β”œβ”€β”€ model.ckpt.index
β”‚   β”œβ”€β”€ model.ckpt.meta
β”‚   └── pipeline.config
β”œβ”€β”€ test: Contains the test images of the competition. 
β”‚   β”œβ”€β”€ 2fd875eaa.jpg
β”‚   β”œβ”€β”€ 348a992bb.jpg
β”‚   β”œβ”€β”€ 51b3e36ab.jpg
β”‚   β”œβ”€β”€ 51f1be19e.jpg
β”‚   β”œβ”€β”€ 53f253011.jpg
β”‚   β”œβ”€β”€ 796707dd7.jpg
β”‚   β”œβ”€β”€ aac893a91.jpg
β”‚   β”œβ”€β”€ cb8d261a3.jpg
β”‚   β”œβ”€β”€ cc3532ff6.jpg
β”‚   └── f5a1f0358.jpg
β”œβ”€β”€ train: Contains the training images of the competition. 
β”œβ”€β”€ Basic_EDA.ipynb: Performs basic data visualization on the provided dataset.
β”œβ”€β”€ Data_Prep.ipynb: Prepares the data in a TFOD API compatible format.
β”œβ”€β”€ faster_rcnn_resnet101_pets.config: Training configuration file.
β”œβ”€β”€ generate_tfrecord.py: Utility script for generating TFRecords from `.csv` files.
β”œβ”€β”€ label_map.pbtxt: Label map file.
β”œβ”€β”€ new_train_df.csv: The newly created partial training set.
β”œβ”€β”€ train.csv: Comes with the initial dataset & contain information about the bounding boxes. 
β”œβ”€β”€ train_df.csv: Expanded version of the initial `train.csv` file. 
β”œβ”€β”€ train.record: TFRecord file of the partial training set. 
β”œβ”€β”€ valid_df.csv: The newly created validation set.
└── valid.record: TFRecord file of the validation set.
└── Wheat_Head_Detection_YoloV4.ipynb : The notebook for YoloV4 Setup and Prediction

Note

The files that you don't see here in the directory were not intentionally provided because of their sizes.

Results

Following are the results I got from TensorBoard while my model was training (following are images from the validation set I prepared):

Steps to reproduce the results

  • Follow the instructions from Data_Prep.ipynb notebook.

  • Once the new training and validation splits are generated run generate_tfrecord.py script for generating the TFRecords.

  • Download the pre-trained checkpoints of Faster RCNN with Inception Network as base by running:

    wget http://download.tensorflow.org/models/object_detection/faster_rcnn_resnet101_coco_2018_01_28.tar.gz
    
  • Follow instructions from this piece on how to package an object detection application in TensorFlow Object Detection API and submit a training job to AI Platform. It also shows how to monitor performance with TensorBoard and export the trained model checkpoints as a frozen inference graph.

  • Run the Ipynb Notebook if you want to get the same results using YoloV4.

Acknowledgement

  • Sayak Paul for Faster-RCNN Setup

wheat-head-detection's People

Stargazers

 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.