Action Recognition: Step-by-step Recognizing Actions with Python and Recurrent Neural Network
By Mark Magic
()
About this ebook
* Research fields: Computer Vision and Machine Learning.
* Book Topic: Action recognition from videos.
* Recognition Tool: Recurrent Neural Network (RNN) with LSTM (Long-Short Term Memory) layer and fully connected layer.
* Programming Language: Step-by-step implementation with Python in Jupyter Notebook.
* Major Steps: Building a network, training the network, testing the network, comparing the network with an SVM (Support Vector Machines) classifier.
* Processing Units to Execute the Codes: CPU and GPU (on Google Colaboratory).
* Image Feature Extraction Tool: Pretrained VGG16 network.
* Dataset: UCF101 (the first 15 actions, 2010 videos).
* Main Results: For the testing data, the highest prediction accuracy from the RNN is 86.97%, which is a little higher than that from the SVM classifier (86.09%).
* Detailed Description:
Recurrent Neural Network (RNN) is a great tool to do video action recognition. This book built an RNN with an LSTM (Long-Short Term Memory) layer and a fully connected layer to do video action recognition.
The RNN was trained and evaluated with VGG16 Features that were saved in .mat files; the features were extracted from images with a modified pretrained VGG16 network; the images were converted from videos in the UCF101 dataset, which has 101 different actions including 13,320 videos; please notice that only the first 15 actions in this dataset were used to do the recognition.
The codes were implemented step-by-step with Python in Jupyter Notebook, and they could be executed on both CPUs and GPUs; free GPUs on Google Colaboratory were used as hardware accelerator to do most of the calculations.
For the purpose of getting a higher testing accuracy, the architecture of the network was regulated, and parameters of the network and its optimizer were fine-tuned.
For comparison purpose only, an SVM (Support Vector Machines) classifier was trained and tested.
For the first 15 actions in the UCF101 dataset, the highest prediction accuracy of the testing data from the RNN is 86.97%, which is a little higher than that from the SVM classifier (86.09%).
In conclusion, the performances of the RNN and the SVM classifier are approximately the same for the task in this book, which is a little embarrassed. However, RNN does have its own advantages in many other cases in the fields of Computer Vision and Machine Learning, and the implementation in this book can be an introduction to this topic in order to throw out a minnow to catch a whale.
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 Action Recognition
Related ebooks
Introduction to Deep Learning and Neural Networks with Python™: A Practical Guide Rating: 0 out of 5 stars0 ratingsLearning OpenCV 3 Computer Vision with Python - Second Edition Rating: 0 out of 5 stars0 ratingsMachine Learning in Production: Master the art of delivering robust Machine Learning solutions with MLOps (English Edition) Rating: 0 out of 5 stars0 ratingsHybrid Computational Intelligence: Challenges and Applications Rating: 0 out of 5 stars0 ratingsNatural Language Processing with Java and LingPipe Cookbook Rating: 0 out of 5 stars0 ratingsFeature Extraction and Image Processing for Computer Vision Rating: 4 out of 5 stars4/5Convolutional neural network Second Edition Rating: 0 out of 5 stars0 ratingsIntroduction to Algorithms for Data Mining and Machine Learning Rating: 0 out of 5 stars0 ratingsPattern Recognition and Machine Learning Rating: 0 out of 5 stars0 ratingsReal-time business intelligence A Complete Guide Rating: 0 out of 5 stars0 ratingsDeep Reinforcement Learning A Complete Guide - 2020 Edition Rating: 0 out of 5 stars0 ratingsA Greater Foundation for Machine Learning Engineering: The Hallmarks of the Great Beyond in Pytorch, R, Tensorflow, and Python Rating: 0 out of 5 stars0 ratingsNeural Data Science: A Primer with MATLAB® and Python™ Rating: 5 out of 5 stars5/5Machine Learning Cookbook with Python: Create ML and Data Analytics Projects Using Some Amazing Open Datasets (English Edition) Rating: 0 out of 5 stars0 ratingsDeep Learning with C#, .Net and Kelp.Net: The Ultimate Kelp.Net Deep Learning Guide Rating: 0 out of 5 stars0 ratingsComputer Vision for Microscopy Image Analysis Rating: 0 out of 5 stars0 ratingsTensorFlow A Complete Guide - 2019 Edition Rating: 0 out of 5 stars0 ratingsPython Machine Learning Projects: Learn how to build Machine Learning projects from scratch (English Edition) Rating: 0 out of 5 stars0 ratingsScala for Machine Learning Rating: 0 out of 5 stars0 ratingsComputational Learning Approaches to Data Analytics in Biomedical Applications Rating: 5 out of 5 stars5/5Practical Machine Learning for Data Analysis Using Python Rating: 0 out of 5 stars0 ratingsDeep Belief Nets in C++ and CUDA C: Volume 1: Restricted Boltzmann Machines and Supervised Feedforward Networks Rating: 0 out of 5 stars0 ratingsArtificial Neural Networks and Statistical Pattern Recognition: Old and New Connections Rating: 0 out of 5 stars0 ratingsGenerating a New Reality: From Autoencoders and Adversarial Networks to Deepfakes Rating: 0 out of 5 stars0 ratingsMultimodal Scene Understanding: Algorithms, Applications and Deep Learning Rating: 0 out of 5 stars0 ratingsDeep Learning and Parallel Computing Environment for Bioengineering Systems Rating: 0 out of 5 stars0 ratingsMultidimensional Signal, Image, and Video Processing and Coding Rating: 0 out of 5 stars0 ratingsHyperparameter Optimization in Machine Learning: Make Your Machine Learning and Deep Learning Models More Efficient Rating: 0 out of 5 stars0 ratings
Teaching Methods & Materials For You
Dumbing Us Down - 25th Anniversary Edition: The Hidden Curriculum of Compulsory Schooling Rating: 4 out of 5 stars4/5Lies My Teacher Told Me: Everything Your American History Textbook Got Wrong Rating: 4 out of 5 stars4/5Closing of the American Mind Rating: 4 out of 5 stars4/5Speed Reading: Learn to Read a 200+ Page Book in 1 Hour: Mind Hack, #1 Rating: 5 out of 5 stars5/5Becoming Cliterate: Why Orgasm Equality Matters--And How to Get It Rating: 4 out of 5 stars4/5The Lost Tools of Learning Rating: 5 out of 5 stars5/5Grit: The Power of Passion and Perseverance Rating: 4 out of 5 stars4/5Jack Reacher Reading Order: The Complete Lee Child’s Reading List Of Jack Reacher Series Rating: 4 out of 5 stars4/5The 5 Love Languages of Children: The Secret to Loving Children Effectively Rating: 4 out of 5 stars4/5Principles: Life and Work Rating: 4 out of 5 stars4/5Weapons of Mass Instruction: A Schoolteacher's Journey Through the Dark World of Compulsory Schooling Rating: 4 out of 5 stars4/5Fluent in 3 Months: How Anyone at Any Age Can Learn to Speak Any Language from Anywhere in the World Rating: 3 out of 5 stars3/5The Three Bears Rating: 5 out of 5 stars5/5How to Take Smart Notes. One Simple Technique to Boost Writing, Learning and Thinking Rating: 4 out of 5 stars4/5Personal Finance for Beginners - A Simple Guide to Take Control of Your Financial Situation Rating: 5 out of 5 stars5/5Inside American Education Rating: 4 out of 5 stars4/5The Chicago Guide to Grammar, Usage, and Punctuation Rating: 5 out of 5 stars5/5Financial Feminist: Overcome the Patriarchy's Bullsh*t to Master Your Money and Build a Life You Love Rating: 5 out of 5 stars5/5A study guide for Frank Herbert's "Dune" Rating: 3 out of 5 stars3/5Speed Reading: How to Read a Book a Day - Simple Tricks to Explode Your Reading Speed and Comprehension Rating: 4 out of 5 stars4/5A Failure of Nerve: Leadership in the Age of the Quick Fix (10th Anniversary, Revised Edition) Rating: 4 out of 5 stars4/5How To Be Hilarious and Quick-Witted in Everyday Conversation Rating: 5 out of 5 stars5/5Raising Human Beings: Creating a Collaborative Partnership with Your Child Rating: 4 out of 5 stars4/5The Call of the Wild and Free: Reclaiming the Wonder in Your Child's Education, A New Way to Homeschool Rating: 4 out of 5 stars4/5
Reviews for Action Recognition
0 ratings0 reviews
Book preview
Action Recognition - Mark Magic
Action Recognition
Step-by-step Recognizing Actions with Python and Recurrent Neural Network
By Dr. Mark Magic
Long Island, NY, USA
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.
Action Recognition: Step-by-step Recognizing Actions with Python and Recurrent Neural Network
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: July 2019
Table of Contents
Chapter 1: Introduction
Chapter 2: Feature Extraction and Dataset Loading
Chapter 3: Modelling with Long-Short Term Memory (LSTM) Network
Chapter 4: Model Evaluation
Chapter 5: Model Improvements
Chapter 6: Conclusions
Appendix
A.1. All codes in extract_UCF101_images.py
A.2. All codes in extract_vgg16_feat.py
A.3. All codes in Action_Recognition.ipynb
References
Postscript
About Dr. Mark Magic
Connect with Dr. Mark Magic
Other books by Dr. Mark Magic
Chapter 1: Introduction
Recurrent Neural Network (RNN) [¹] is a great tool to do video action recognition, especially the LSTM (Long-Short Term Memory) algorithm [²]. This book is about this topic. The codes are implemented step by step with Python in Jupyter Notebook [³] and they can be run on both CPUs and GPUs. The dataset is the UCF101 [⁴,⁵] that was developed by Soomro et al. from the University of Central Florida. The dataset has 101 different actions/classes.
The major steps of the implementation are: first, convert the video to images; second, extract features of each image with the pretrained VGG16 network [⁶,⁷,⁸]; next, separate the features into training data and testing data with their corresponding labels; then, define an RNN with LSTM and train the RNN with the training data; and last, evaluate the RNN with the testing data. For comparison purpose only, a Support Vector Machines (SVM) [⁹,¹⁰,¹¹] classifier is also trained and tested using the same dataset.
Python [¹²] is one of the best programing languages to realize tasks in the fields of Computer Vision and Machine Learning. This is the reason that we choose Python to implement the action recognition task in this book. Python is an interpreted, high-level, general-purpose programming language. It has a design philosophy of emphasizing code readability, notably using significant whitespace. It features an 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. We will use Python 3.7 version in this book. After downloading Anaconda3-2018.12-Windows-x86_64.exe for Windows 64-bit Operating Systems, first install it with default settings; then open Anaconda Prompt
to