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
Scala for Machine Learning Rating: 0 out of 5 stars0 ratingsAuthentication Authorization Third Edition Rating: 0 out of 5 stars0 ratingsProfit From Your Forecasting Software: A Best Practice Guide for Sales Forecasters Rating: 0 out of 5 stars0 ratingsDigital Payment A Complete Guide - 2019 Edition Rating: 0 out of 5 stars0 ratingsBlockchain and IoT Complete Self-Assessment Guide Rating: 0 out of 5 stars0 ratingsMulti-agent system Second Edition Rating: 0 out of 5 stars0 ratingsLearning BeagleBone Python Programming Rating: 0 out of 5 stars0 ratingsReal-time Analytics with Storm and Cassandra Rating: 0 out of 5 stars0 ratingsElectronic Payment Services A Complete Guide - 2020 Edition Rating: 0 out of 5 stars0 ratingsSecure Chains: Cybersecurity and Blockchain-powered Automation Rating: 0 out of 5 stars0 ratingsObject-oriented analysis and design A Complete Guide - 2019 Edition Rating: 0 out of 5 stars0 ratingsAutomotive software A Complete Guide - 2019 Edition Rating: 0 out of 5 stars0 ratingsVideo Streaming Second Edition Rating: 0 out of 5 stars0 ratingsApplied Machine Learning Solutions with Python: SOLUTIONS FOR PYTHON, #1 Rating: 0 out of 5 stars0 ratingsNeural Networks with Python Rating: 0 out of 5 stars0 ratingsDeep Reinforcement Learning with Python: With PyTorch, TensorFlow and OpenAI Gym Rating: 0 out of 5 stars0 ratingsRed Hat Ansible A Complete Guide - 2020 Edition Rating: 0 out of 5 stars0 ratingsBare-Metal Embedded C Programming: Develop high-performance embedded systems with C for Arm microcontrollers Rating: 0 out of 5 stars0 ratingsMastering OpenCV with Python Rating: 0 out of 5 stars0 ratingsHands-On Deep Learning for Finance: Implement deep learning techniques and algorithms to create powerful trading strategies Rating: 0 out of 5 stars0 ratingsSmart Contract Oracle Third 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 ratingsBlockchain A Complete Guide - 2020 Edition Rating: 0 out of 5 stars0 ratingsSubscription Billing Standard Requirements Rating: 0 out of 5 stars0 ratingsManufacturing bill of materials Complete Self-Assessment Guide Rating: 0 out of 5 stars0 ratingsF# for Quantitative Finance Rating: 0 out of 5 stars0 ratingsPayment Application Best Practices A Complete Guide - 2020 Edition Rating: 0 out of 5 stars0 ratingsGenerating a New Reality: From Autoencoders and Adversarial Networks to Deepfakes Rating: 0 out of 5 stars0 ratingsSD-WAN Products Second Edition Rating: 0 out of 5 stars0 ratings
Teaching Methods & Materials For You
Fluent 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/5Lies My Teacher Told Me: Everything Your American History Textbook Got Wrong Rating: 4 out of 5 stars4/5Dumbing Us Down - 25th Anniversary Edition: The Hidden Curriculum of Compulsory Schooling Rating: 4 out of 5 stars4/5The Dance of Anger: A Woman's Guide to Changing the Patterns of Intimate Relationships Rating: 4 out of 5 stars4/5Never Split the Difference: Negotiating As If Your Life Depended On It Rating: 4 out of 5 stars4/5Writing to Learn: How to Write - and Think - Clearly About Any Subject at All 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/5The 5 Love Languages of Children: The Secret to Loving Children Effectively Rating: 4 out of 5 stars4/5Verbal Judo, Second Edition: The Gentle Art of Persuasion Rating: 4 out of 5 stars4/5Financial Feminist: Overcome the Patriarchy's Bullsh*t to Master Your Money and Build a Life You Love 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/5The Anxious Generation - Workbook Rating: 0 out of 5 stars0 ratingsGrit: The Power of Passion and Perseverance Rating: 4 out of 5 stars4/5On Writing Well, 30th Anniversary Edition: An Informal Guide to Writing Nonfiction Rating: 4 out of 5 stars4/5How to Take Smart Notes. One Simple Technique to Boost Writing, Learning and Thinking Rating: 4 out of 5 stars4/5Principles: Life and Work 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/5Closing of the American Mind Rating: 4 out of 5 stars4/5The Success Principles(TM) - 10th Anniversary Edition: How to Get from Where You Are to Where You Want to Be Rating: 4 out of 5 stars4/5Inside American Education 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/5Becoming Cliterate: Why Orgasm Equality Matters--And How to Get It Rating: 4 out of 5 stars4/5A Study Guide for Octavia Butler's "Parable of the Sower" Rating: 0 out of 5 stars0 ratingsBattle for the American Mind: Uprooting a Century of Miseducation Rating: 4 out of 5 stars4/5How to Think Like a Lawyer--and Why: A Common-Sense Guide to Everyday Dilemmas 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: [email protected].
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