Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Image Classification: Step-by-step Classifying Images with Python and Techniques of Computer Vision and Machine Learning
Image Classification: Step-by-step Classifying Images with Python and Techniques of Computer Vision and Machine Learning
Image Classification: Step-by-step Classifying Images with Python and Techniques of Computer Vision and Machine Learning
Ebook135 pages55 minutes

Image Classification: Step-by-step Classifying Images with Python and Techniques of Computer Vision and Machine Learning

Rating: 0 out of 5 stars

()

Read preview

About this ebook

* Research Fields: Computer Vision and Machine Learning.
* Book Topic: Image classification from an image database.
* Classification Algorithms: (1) Tiny Images Representation + Classifiers; (2) HOG (Histogram of Oriented Gradients) Features Representation + Classifiers; (3) Bag of SIFT (Scale Invariant Feature Transform) Features Representation + Classifiers; (4) Training a CNN (Convolutional Neural Network) from scratch; (5) Fine Tuning a Pre-Trained Deep Network (AlexNet); (6) Pre-Trained Deep Network (AlexNet) Features Representation + Classifiers.
* Classifiers: k-Nearest Neighbors (KNN) and Support Vector Machines (SVM).
* Programming Language: Step-by-step implementation with Python in Jupyter Notebook.
* Processing Units to Execute the Codes: CPU and GPU (on Google Colaboratory).
* Major Steps: For algorithms with classifiers, first processing the images to get the images representations, then training the classifiers with training data, and last testing the classifiers with testing data to get the prediction accuracies; for algorithms with networks, first building a network, then training the network with training data, and last testing the network with testing data to get the prediction accuracies.
* Main Results: For the testing data, the prediction accuracies vary between about 30% and 90%, while the time consumptions varied from several seconds to more than one hour. Considering both of the criteria, the Pre-Trained AlexNet Features Representation plus a Classifier was concluded as the best algorithm.
* Detailed Description:
This book implemented six different algorithms to classify images with the prediction accuracy of the testing data as the primary criterion (the higher the better) and the time consumption as the secondary one (the shorter the better). The accuracies varied between about 30% and 90%, while the time consumptions varied from several seconds to more than one hour. Considering both of the criteria, the Pre-Trained AlexNet Features Representation plus a Classifier, such as the k-Nearest Neighbors (KNN) and the Support Vector Machines (SVM), was concluded as the best algorithm.
The six algorithms are: Tiny Images Representation + Classifiers; HOG (Histogram of Oriented Gradients) Features Representation + Classifiers; Bag of SIFT (Scale Invariant Feature Transform) Features Representation + Classifiers; Training a CNN (Convolutional Neural Network) from scratch; Fine Tuning a Pre-Trained Deep Network (AlexNet); and Pre-Trained Deep Network (AlexNet) Features Representation + Classifiers.
The codes were written with Python in Jupyter Notebook, and they could be executed on both CPUs and GPUs.

LanguageEnglish
Release dateJun 4, 2019
ISBN9780463266229
Image Classification: Step-by-step Classifying Images with Python and Techniques of Computer Vision and Machine Learning
Author

Mark Magic

Dr. Magic is a Senior Software Engineer living in Long Island, New York. He loves reading and writing. He is very interested in Computer Vision and Machine Learning. He has concentrated on image processing for more than five years.

Related to Image Classification

Related ebooks

Intelligence (AI) & Semantics For You

View More

Related articles

Reviews for Image Classification

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Image Classification - Mark Magic

    Image Classification

    Step-by-step Classifying Images with Python and Techniques of Computer Vision and Machine Learning

    By Dr. Mark Magic

    Long Island, NY, United States

    The author and the editor have taken care in the preparation of this book and taken great efforts to ensure that the information and instructions contained in this book are accurate, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions.

    No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. Use of the contents contained in this book is at your own risk.

    If any code samples or techniques contained or described in this book is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.

    Image Classification: Step-by-step Classifying Images with Python and Techniques of Computer Vision and Machine Learning

    Copyright 2019 Dr. Mark Magic All rights reserved.

    Published by M.J. Magic Publishing. This publication is protected by copyright, and permission must be obtained from the author prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. To obtain permission to use material from this work, please submit a written request to Dr. Mark Magic: mark.john.magic@gmail.com.

    This ebook is licensed for your personal enjoyment only. This ebook may not be re-sold or given away to other people. If you would like to share this book with another person, please purchase an additional copy for each recipient. If you’re reading this book and did not purchase it, or it was not purchased for your use only, then please return to your favorite ebook retailer and purchase your own copy. Thank you for respecting the hard work of this author.

    Please remember to leave a review for this book at your favorite retailer.

    This book is available in print at most online retailers.

    First edition: June 2019

    Table of Contents

    Chapter 1: Introduction

    Chapter 2: Tiny Images Representation and Classifiers

    Chapter 3: HOG Features Representation and Classifiers

    Chapter 4: Bag of SIFT Features Representation and Classifiers

    Chapter 5: Training a Convolutional Neural Network from Scratch

    Chapter 6: Fine Tuning a Pre-Trained Deep Network (AlexNet)

    Chapter 7: Pre-Trained Deep Network (AlexNet) Features Representation and Classifiers

    Chapter 8: GPU Compatible and Google Colaboratory

    Chapter 9: Conclusions

    References

    Postscript

    About Dr. Mark Magic

    Connect with Dr. Mark Magic

    Other books by Dr. Mark Magic

    Chapter 1: Introduction

    Image classification is a hot topic and one of the core problems in the fields of Computer Vision and Machine Learning. It refers to the task of assigning a label from a fixed set of categories to an input image. Many other seemingly distinct tasks in the fields, such as object detection and segmentation, can be reduced to image classification.

    Depending on the interaction between the analyst and the computer during classification, there are two types of image classification: supervised and unsupervised.

    For supervised classification, example images with their correct labels are provided as the training dataset. A learning algorithm analyzes the training dataset and then produces an inferred function, which can be used for classifying new images.

    For unsupervised classification, the training data are not labeled, that is to say, without the analyst’s intervention. An algorithm learns from the data, identifies commonalities in the data, and reacts based on the presence or absence of such commonalities in each new piece of data.

    In this book, all the algorithms are supervised.

    Python will be used in this book to realize the classification algorithms. Python [¹] is an interpreted, high-level, general-purpose programming language. Python was created by Guido van Rossum and first released in 1991. It has a design philosophy of emphasizing code readability, notably using significant whitespace. It features a dynamic type system and automatic memory management. It supports multiple programming paradigms, including object-oriented, imperative, functional and procedural. It has a large and comprehensive standard library.

    The Anaconda Distributions of Python can be downloaded from https://www.anaconda.com/download. Both the 2.7 and 3.7 versions need to be used in this book.

    For Windows 64-bit Operating Systems, after downloading Anaconda2-2018.12-Windows-x86_64.exe and Anaconda3-2018.12-Windows-x86_64.exe, first install them with default settings; then open Anaconda Prompt to install several libraries that will be used later. For Python 2.7 version, we need to install opencv-contrib-python using pip install opencv-contrib-python==3.3.0.9. For Python 3.7 version, we need to install opencv-python using pip install opencv-python==3.4.3.18, install PyTorch using "pip install https://download.pytorch.org/whl/cpu/torch-1.0.0-cp37-cp37m-win_amd64.whl", and install torchvision using

    Enjoying the preview?
    Page 1 of 1