Git Product home page Git Product logo

deeplearning_begineer's Introduction

DeepLearing_beginner

2021Q1

A basic introduction to learning CNN through applications of VGG models.

#######################################################################################

program: vgg16_intro.py

This program demonstrates how to train a Convolutional Neural Network CNN or ConvNet
Firstly, we should download some photos as the dateset to train a VGG16 (a famous CNN model) We download and create a flower datasets with 5 classes of totaling 3,670 images.
Secondly, we use the dataset to train a VGG16 model. Thirdly, after having trained the VGG16 model, we predict an arbitrary flowers image.
The program will output the class name of the predicted image.

input dataset for training: Download the "flower_photos.tgz" from below website, and put into "date_dir"
https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz
data_dir = "E:/datasets/flower_photos/"

input image for prediction: "673.jpg" or another images

output: print "roses" on the command prompt.

#######################################################################################


program: vgg16_SaveModel.py".

This program continues from the program, "vgg16_SaveModel.py". This program demonstrates how to load a CNN model and to predict a single image.

output(1): Save a model model.save("vgg16_t2.h5")

output(2): Save history of training save histroy into 'history_vgg16_t2.csv'


#######################################################################################

program: vgg16_LoadModel.py".

This program continues from the program, "vgg16_SaveModel.py". This program demonstrates how to load a CNN model and to predict a single image.

input(1): vgg16_t2.h5

input(2): image for prediction: "673.jpg" or another images

output: imshow the input image, and prediction and accuracy in %

#######################################################################################


program: plot_learningCurve.py".

This program continues from the program, "vgg16_SaveModel.py". This program demonstrates how to plot the training curves aftering training.

input: history_vgg16_t2.csv

Output: two charts


#######################################################################################

program: vgg_Models.py".

This program continues from the program, "vgg16_intro.py" and "vgg16_SaveModel.py".
This program demonstrates the architecture of vgg16 and vgg19
There are two main methods to construct a CNN model.
Method A: model = Sequential()
Method B: model = Model(inputs=input, outputs=output)

I prefer Method A for simple CNN. I will use Method B for more complicated CNN.
We also apply early stopping in training.
We can then use "vgg16_LoadModel.py" to load the saved model and predict a single image.

#######################################################################################


program vgg_TransferLearning.py".

This program continues from the program, "vgg16_intro.py" and "vgg16_SaveModel.py".
This program demonstrates data augmentations, transfer learning and exponentialDecay learning rate.
We use both vgg16 and vgg19.

We also apply early stopping in training.
We can then use "vgg16_LoadModel.py" to load the saved model and predict a single image.


deeplearning_begineer's People

Contributors

helmetwong 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.