Coder Social home page Coder Social logo

m0rp43us / aerial-cactus-identification Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andreduong-zz/aerial-cactus-identification

0.0 0.0 0.0 14.49 MB

Cactus Identification: A Walkthrough from CNN to Transfer Learning with Pre-Trained Model VGG16.

Python 0.65% Jupyter Notebook 99.35%

aerial-cactus-identification's Introduction

Cactus Identification: A Walkthrough from CNN to Transfer Learning with Pre-Trained Model VGG16

header

This project was my introduction to the world of Computer Vision using Deep Learning. In this write-up, I will do a walkthrough of the whole classifier making process, including:

  • Data preprocessing

  • Build a Convolutional Neural Network

  • Evaluate the model

  • Make tweaks to improve performance: data augmentation, progressive resizing

  • Apply transfer learning with a pre-trained model (VGG16)

  • Test the model by making prediction on first 10 images from the test set

  • Experiment with interactive testing using OpenCV

Full codes can be found here. NBViewer Link.

Data Description

This dataset contains a large number of 32 x 32 thumbnail images containing aerial photos of a columnar cactus (Neobuxbaumia tetetzo). The file name of an image corresponds to its id.

I will attempt to create a classifier capable of predicting whether an images contains a cactus.

Data Overview

train

hascactus_chart

test

Visualize Images

Let's take a look at a few sample images from the train set:

pic1

pic2

Data Preprocessing

In this section, we create data generators for both train and test dataset. We rescale pixel values from [0, 255] to [0, 1], then perform data augmentation to all images. Full Python script for the data preprocessing process can be found here.

Model Building

Baseline Convolutional Neural Network Architecture

cnn

Model Evaluation: Loss/Accuracy Graphs

cnn-loss

cnn-acc

Transfer Learning with Pre-Trained Model VGG16

In this section, we load the pre-trained model, freeze all layers except the top FC layers, then we add the top layers accordingly. Let's take a look at the model architecture after applying transfer learning:

vgg

Model Evaluation: Loss/Accuracy Graphs

vgg-loss

vgg-acc

Test Our Model

In this section, we write a Python script to test our model by making prediction on the first 10 images of the test set. Full Python script can be found here.

test-10

Conclusion

In this project, I did a walkthrough of the whole classifier making process, including data preprocessing, building a Convolutional Neural Network, evaluating the model, making tweaks to improve performance: data augmentation, progressive resizing, applying transfer learning with a pre-trained model (VGG16), testing the model by making prediction on first 10 images from the test set, and experimenting with interactive testing using OpenCV.

Computer Vision is a wildly developing field. Since the conclusion of this project, I have been focusing heavily on researching recent advances in convolutional neural network architectures, and hopefully I can apply what I've learned in more interesting projects like this in the future.

aerial-cactus-identification's People

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.