Code Monkey home page Code Monkey logo

plant-pathology-2021-fgvc8's Introduction

Plant-Pathology-2021-FGVC8

Identify the category of foliar diseases in apple trees

Details of the Project

Plant Pathology competition is a annual competition conducted by FGVC8 to detect foilar diseases in Apple Plants.

Check out the competition here

  • Host : Kaggle
  • Dataset : 23,000 high-quality RGB images of apple foliar diseases
  • Evaluation Metric : Mean F1-score
  • Framework used : TensorFlow
  • Accelerators : GPU, TPU

Important information about labels

This is a multi-label task i.e., an image can have more than one label.

  • Number of classes : 6 (scab, healthy, frog eye leaf spot, rust, complex, powdery mildew)
  • Number of unique labels : 12 (above 6 + scab, frog eye leaf spot, scab frog eye leaf spot complex, frog eye leaf spot, complex, rust frog eye leaf spot, rust complex, powdery mildew, complex)

Approach to the Competition

I approached the task in 3 ways

  • Considering number of unique labels as 12 (assuming no other combination of diseases) and proceded as Multi Class classification
  • Considering number of unique labels as 6 (Multi label classification).
  • Considering number of unique labels as 5 (if no label in 5 gave good probability then it is healthy).
  • Last approach gave best resluts.

Other Details

  • Dataset Preparation

    • TPU as Accelerator
      • As the dataset is present in GCP, we can't access the images directly, We first need to decode the image using image = tf.image.decode_jpeg(tf.io.read_file(filepath), channels=3)
      • After loading the images, random augmentations are applied using tf.image.random. class.
      • Finally to prepare the datset for training, loaded images are converted to Tensorflow tf.data.Dataset format and adding cache, prefetch for faster loading of data.
      • More details are in TPU notebook.
    • GPU as Accelerator
      • ImageDataGenerator is used to apply several augmentations to images.
      • Images are loaded as datset using flow_from_dataframe function.
      • More details in GPU notebook.
  • Training

    • In both cases (TPU,GPU) pretrained models present in tf.keras.applications are used.
    • Loss : Binary Cross Entropy.
    • Metrics tracked throughput training are F1-score , Accuracy.
    • Callbacks used
      • ModelCheckpoint - to store the best model.
      • ReduceRONPlateau - to change learning rate if there is no improvement observed.
      • EarlyStopping - to stop training i case of no improvement.
    • TPU as Accelerator
      • As we can't use any tensorflow dataset loaders, kfold split of sklearn is used to split the data into training and validation.
    • GPU as Accelerator
      • using split option in ImageDataGenerator datset is splitted into training and validation.
  • Submission

plant-pathology-2021-fgvc8's People

Contributors

shanmukh05 avatar

Stargazers

 avatar

Watchers

 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.