Giter Site home page Giter Site logo

acdick / dsc-04-44-04-image-classifcation-lab-nyc-ds-career-031119 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from learn-co-students/dsc-04-44-04-image-classifcation-lab-nyc-ds-career-031119

0.0 1.0 0.0 117.55 MB

License: Other

Jupyter Notebook 100.00%

dsc-04-44-04-image-classifcation-lab-nyc-ds-career-031119's Introduction

Image Classification - Lab

Introduction

Now that you have a working knowledge of CNNs and have practiced implementing associated techniques in Keras, its time to put all of those skills together. In this lab, you'll work to complete a Kaggle competition on classifying dog breeds.

https://www.kaggle.com/c/dog-breed-identification

Objectives

You will be able to:

  • Independently design and build a CNN for image classifcation tasks
  • Compare and apply multiple techniques for tuning a model including data augmentation and adapting pretrained models

Download and Load the Data

Start by downloading the data locally and loading it into a Pandas DataFrame. Be forewarened that this dataset is fairly large and it is advisable to close other memory intensive applications.

The data can be found here:

https://www.kaggle.com/c/dog-breed-identification/data

We recommend downloading the data into this directory on your local computer. From there, be sure to uncompress the folder and subfolders.

#No code persay, but download and decompress the data.

Preprocessing

Now that you've downloaded the data, its time to prepare it for some model building! You'll notice that the current structure provided is not the same as our lovely preprocessed folders that we've been providing you. Instead, you have one large training folder with images and a csv file with labels associated with each of these file types.

Use this to create a directory substructure for a train-validation-test split as we have done previously. Also recall from our previous work that you'll also want to use one-hot encoding as we are now presented with a multi-class problem as opposed to simple binary classification.

#Your code here; open the labels.csv file stored in the zip file

We wish to create our standard directory structure:

  • train
    • category1
    • category2
    • category3 ...
  • val
    • category1
    • category2
    • category3 ...
  • test
    • category1
    • category2
    • category3 ...
#Your code here; transform the image files and then load them into Keras as tensors 
#(be sure to perform a train-val-test split)

Optional: Build a Baseline CNN

This is an optional step. Adapting a pretrained model will produce better results, but it may be interesting to create a CNN from scratch as a baseline. If you wish to, do so here.

#Create a baseline CNN model

Loading a Pretrained CNN

Feature Engineering with the Pretrained Model

Now that you've loaded a pretrained model, it's time to adapt that convolutional base and add some fully connected layers on top in order to build a classifier from these feature maps.

#Your code here; add fully connected layers on top of the convolutional base

Visualize History

Now fit the model and visualize the training and validation accuracy/loss functions over successive epochs.

#Your code here; visualize the training / validation history associated with fitting the model.
#Save model

Final Model Evaluation

#Your code here

Summary

Congratulations! In this lab, you brought all of your prior deep learning skills together from preprocessing including one-hot encoding, to adapting a pretrained model. There are always ongoing advancements in CNN architectures and best practices, but you have a solid foundation and understanding at this point.

dsc-04-44-04-image-classifcation-lab-nyc-ds-career-031119's People

Contributors

loredirick avatar mathymitchell 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.