100% found this document useful (4 votes)
197 views

Download full Computer Vision Using Deep Learning Neural Network Architectures with Python and Keras 1st Edition Vaibhav Verdhan ebook all chapters

Network

Uploaded by

lorcadunayvy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
197 views

Download full Computer Vision Using Deep Learning Neural Network Architectures with Python and Keras 1st Edition Vaibhav Verdhan ebook all chapters

Network

Uploaded by

lorcadunayvy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Download the Full Version of textbook for Fast Typing at textbookfull.

com

Computer Vision Using Deep Learning Neural Network


Architectures with Python and Keras 1st Edition
Vaibhav Verdhan

https://textbookfull.com/product/computer-vision-using-deep-
learning-neural-network-architectures-with-python-and-
keras-1st-edition-vaibhav-verdhan/

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Supervised Learning with Python: Concepts and Practical


Implementation Using Python Vaibhav Verdhan

https://textbookfull.com/product/supervised-learning-with-python-
concepts-and-practical-implementation-using-python-vaibhav-verdhan/

textboxfull.com

Deep Learning Projects Using TensorFlow 2: Neural Network


Development with Python and Keras 1st Edition Vinita
Silaparasetty
https://textbookfull.com/product/deep-learning-projects-using-
tensorflow-2-neural-network-development-with-python-and-keras-1st-
edition-vinita-silaparasetty/
textboxfull.com

Supervised Learning with Python Concepts and Practical


Implementation Using Python 1st Edition Vaibhav Verdhan

https://textbookfull.com/product/supervised-learning-with-python-
concepts-and-practical-implementation-using-python-1st-edition-
vaibhav-verdhan/
textboxfull.com

Deep Learning with Python Develop Deep Learning Models on


Theano and TensorFLow Using Keras Jason Brownlee

https://textbookfull.com/product/deep-learning-with-python-develop-
deep-learning-models-on-theano-and-tensorflow-using-keras-jason-
brownlee/
textboxfull.com
Beginning Anomaly Detection Using Python-Based Deep
Learning: With Keras and PyTorch Sridhar Alla

https://textbookfull.com/product/beginning-anomaly-detection-using-
python-based-deep-learning-with-keras-and-pytorch-sridhar-alla/

textboxfull.com

Learn Keras for Deep Neural Networks: A Fast-Track


Approach to Modern Deep Learning with Python 1st Edition
Jojo John Moolayil
https://textbookfull.com/product/learn-keras-for-deep-neural-networks-
a-fast-track-approach-to-modern-deep-learning-with-python-1st-edition-
jojo-john-moolayil/
textboxfull.com

Number Systems for Deep Neural Network Architectures 1st


Edition Alsuhli

https://textbookfull.com/product/number-systems-for-deep-neural-
network-architectures-1st-edition-alsuhli/

textboxfull.com

Deep Learning with Applications Using Python Chatbots and


Face, Object, and Speech Recognition With TensorFlow and
Keras Springerlink (Online Service)
https://textbookfull.com/product/deep-learning-with-applications-
using-python-chatbots-and-face-object-and-speech-recognition-with-
tensorflow-and-keras-springerlink-online-service/
textboxfull.com

Reinforcement Learning: With Open AI, TensorFlow and Keras


Using Python 1st Edition Abhishek Nandy

https://textbookfull.com/product/reinforcement-learning-with-open-ai-
tensorflow-and-keras-using-python-1st-edition-abhishek-nandy/

textboxfull.com
Computer
Vision Using
Deep Learning
Neural Network Architectures with
Python and Keras

Vaibhav Verdhan
Computer Vision
Using Deep Learning
Neural Network Architectures
with Python and Keras

Vaibhav Verdhan
Computer Vision Using Deep Learning: Neural Network Architectures
with Python and Keras
Vaibhav Verdhan
Limerick, Ireland

ISBN-13 (pbk): 978-1-4842-6615-1 ISBN-13 (electronic): 978-1-4842-6616-8


https://doi.org/10.1007/978-1-4842-6616-8

Copyright © 2021 by Vaibhav Verdhan


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole
or part of the material is concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical
way, and transmission or information storage and retrieval, electronic adaptation, computer
software, or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a
trademark symbol with every occurrence of a trademarked name, logo, or image we use the
names, logos, and images only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms,
even if they are not identified as such, is not to be taken as an expression of opinion as to
whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the
date of publication, neither the authors nor the editors nor the publisher can accept any
legal responsibility for any errors or omissions that may be made. The publisher makes no
warranty, express or implied, with respect to the material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Aaron Black
Development Editor: James Markham
Coordinating Editor: Jessica Vakili
Distributed to the book trade worldwide by Springer Science+Business Media New York,
1 NY Plazar, New York, NY 10014. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail
[email protected], or visit www.springeronline.com. Apress Media, LLC is a
California LLC and the sole member (owner) is Springer Science + Business Media Finance
Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail [email protected]; for
reprint, paperback, or audio rights, please e-mail [email protected].
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook
versions and licenses are also available for most titles. For more information, reference our
Print and eBook Bulk Sales web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is
available to readers on GitHub via the book’s product page, located at www.apress.com/
978-1-4842-6615-1. For more detailed information, please visit http://www.apress.com/
source-code.
Printed on acid-free paper
To Yashi, Pakhi and Rudra
Table of Contents
About the Author���������������������������������������������������������������������������������xi

About the Technical Reviewer�����������������������������������������������������������xiii


Acknowledgments������������������������������������������������������������������������������xv
Introduction��������������������������������������������������������������������������������������xvii
Foreword�������������������������������������������������������������������������������������������xix

Chapter 1: Introduction to Computer Vision and Deep Learning����������1


1.1 Technical requirements�����������������������������������������������������������������������������������2
1.2 Image Processing using OpenCV��������������������������������������������������������������������3
1.2.1 Color detection using OpenCV����������������������������������������������������������������4
1.3 Shape detection using OpenCV�����������������������������������������������������������������������6
1.3.1 Face detection using OpenCV�����������������������������������������������������������������9
1.4 Fundamentals of Deep Learning�������������������������������������������������������������������12
1.4.1 The motivation behind Neural Network������������������������������������������������14
1.4.2 Layers in a Neural Network������������������������������������������������������������������15
1.4.3 Neuron��������������������������������������������������������������������������������������������������16
1.4.4 Hyperparameters����������������������������������������������������������������������������������17
1.4.5 Connections and weight of ANN�����������������������������������������������������������18
1.4.6 Bias term����������������������������������������������������������������������������������������������18
1.4.7 Activation functions������������������������������������������������������������������������������19
1.4.8 Learning rate����������������������������������������������������������������������������������������25
1.4.9 Backpropagation����������������������������������������������������������������������������������26
1.4.10 Overfitting�������������������������������������������������������������������������������������������28

v
Table of Contents

1.4.11 Gradient descent��������������������������������������������������������������������������������29


1.4.12 Loss functions������������������������������������������������������������������������������������31
1.5 How Deep Learning works?��������������������������������������������������������������������������32
1.5.1 Popular Deep Learning libraries�����������������������������������������������������������36
1.6 Summary������������������������������������������������������������������������������������������������������38
1.6.1 Further readings�����������������������������������������������������������������������������������39

Chapter 2: Nuts and Bolts of Deep Learning for Computer Vision������41


2.1 Technical requirements���������������������������������������������������������������������������������42
2.2 Deep Learning using TensorFlow and Keras�������������������������������������������������42
2.3 What is a tensor?������������������������������������������������������������������������������������������43
2.3.1 What is a Convolutional Neural Network?��������������������������������������������45
2.3.2 What is convolution?����������������������������������������������������������������������������46
2.3.3 What is a Pooling Layer?����������������������������������������������������������������������51
2.3.4 What is a Fully Connected Layer?���������������������������������������������������������52
2.4 Developing a DL solution using CNN�������������������������������������������������������������53
2.5 Summary������������������������������������������������������������������������������������������������������64
2.5.1 Further readings�����������������������������������������������������������������������������������66

Chapter 3: Image Classification Using LeNet��������������������������������������67


3.1 Technical requirements���������������������������������������������������������������������������������68
3.2 Deep Learning architectures�������������������������������������������������������������������������68
3.3 LeNet architecture����������������������������������������������������������������������������������������69
3.4 LeNet-1 architecture�������������������������������������������������������������������������������������70
3.5 LeNet-4 architecture�������������������������������������������������������������������������������������71
3.6 LeNet-5 architecture�������������������������������������������������������������������������������������72
3.7 Boosted LeNet-4 architecture�����������������������������������������������������������������������75
3.8 Creating image classification models using LeNet���������������������������������������76
3.9 MNIST classification using LeNet�����������������������������������������������������������������77

vi
Table of Contents

3.10 German traffic sign identification using LeNet�������������������������������������������84


3.11 Summary��������������������������������������������������������������������������������������������������100
3.11.1 Further readings�������������������������������������������������������������������������������101

Chapter 4: VGGNet and AlexNet Networks����������������������������������������103


4.1 Technical requirements�������������������������������������������������������������������������������104
4.2 AlexNet and VGG Neural Networks��������������������������������������������������������������104
4.3 What is AlexNet Neural Network?���������������������������������������������������������������105
4.4What is VGG Neural Network?���������������������������������������������������������������������107
4.5 VGG16 architecture�������������������������������������������������������������������������������������107
4.6 Difference between VGG16 and VGG19�������������������������������������������������������110
4.7 Developing solutions using AlexNet and VGG����������������������������������������������111
4.8 Working on CIFAR-10 using AlexNet�����������������������������������������������������������113
4.9 Working on CIFAR-10 using VGG�����������������������������������������������������������������128
4.10 Comparing AlexNet and VGG���������������������������������������������������������������������136
4.11 Working with CIFAR-100���������������������������������������������������������������������������137
4.12 Summary��������������������������������������������������������������������������������������������������138
4.12.1 Further readings�������������������������������������������������������������������������������139

Chapter 5: Object Detection Using Deep Learning����������������������������141


5.1 Technical requirements�������������������������������������������������������������������������������142
5.2 Object Detection������������������������������������������������������������������������������������������142
5.2.1 Object classification vs. object localization vs. object detection�������143
5.2.2 Use cases of Object Detection������������������������������������������������������������144
5.3 Object Detection methods���������������������������������������������������������������������������146
5.4 Deep Learning frameworks for Object Detection����������������������������������������147
5.4.1 Sliding window approach for Object Detection����������������������������������148
5.5 Bounding box approach������������������������������������������������������������������������������150

vii
Table of Contents

5.6 Intersection over Union (IoU)�����������������������������������������������������������������������152


5.7 Non-max suppression���������������������������������������������������������������������������������154
5.8 Anchor boxes����������������������������������������������������������������������������������������������155
5.9 Deep Learning architectures�����������������������������������������������������������������������157
5.9.1 Region-based CNN (R-CNN)����������������������������������������������������������������157
5.10 Fast R-CNN�����������������������������������������������������������������������������������������������160
5.11 Faster R-CNN��������������������������������������������������������������������������������������������162
5.12 You Only Look Once (YOLO)�����������������������������������������������������������������������165
5.12.1 Salient features of YOLO�������������������������������������������������������������������166
5.12.2 Loss function in YOLO�����������������������������������������������������������������������167
5.12.3 YOLO architecture�����������������������������������������������������������������������������169
5.13 Single Shot MultiBox Detector (SSD)��������������������������������������������������������172
5.14 Transfer Learning��������������������������������������������������������������������������������������177
5.15 Python implementation�����������������������������������������������������������������������������179
5.16 Summary��������������������������������������������������������������������������������������������������182
5.16.1 Further readings�������������������������������������������������������������������������������184

Chapter 6: Face Recognition and Gesture Recognition���������������������187


6.1 Technical toolkit������������������������������������������������������������������������������������������188
6.2 Face recognition�����������������������������������������������������������������������������������������188
6.2.1 Applications of face recognition���������������������������������������������������������190
6.2.2 Process of face recognition����������������������������������������������������������������192
6.2.3 DeepFace solution by Facebook���������������������������������������������������������194
6.2.4 FaceNet for face recognition��������������������������������������������������������������199
6.2.5 Python implementation using FaceNet�����������������������������������������������206
6.2.6 Python solution for gesture recognition���������������������������������������������208
6.3 Summary����������������������������������������������������������������������������������������������������217
6.3.1 Further readings���������������������������������������������������������������������������������219

viii
Table of Contents

Chapter 7: Video Analytics Using Deep Learning������������������������������221


7.1 Technical toolkit������������������������������������������������������������������������������������������222
7.2 Video processing�����������������������������������������������������������������������������������������222
7.3 Use cases of video analytics�����������������������������������������������������������������������223
7.4 Vanishing gradient and exploding gradient problem����������������������������������225
7.5 ResNet architecture������������������������������������������������������������������������������������230
7.5.1 ResNet and skip connection���������������������������������������������������������������230
7.5.2 Inception network�������������������������������������������������������������������������������234
7.5.3 GoogLeNet architecture����������������������������������������������������������������������237
7.5.4 Improvements in Inception v2������������������������������������������������������������239
7.6 Video analytics��������������������������������������������������������������������������������������������243
7.7 Python solution using ResNet and Inception v3������������������������������������������244
7.8 Summary����������������������������������������������������������������������������������������������������254
7.8.1 Further readings���������������������������������������������������������������������������������255

Chapter 8: End-to-End Model Development��������������������������������������257


8.1 Technical requirements�������������������������������������������������������������������������������258
8.2 Deep Learning project requirements����������������������������������������������������������258
8.3 Deep Learning project process�������������������������������������������������������������������262
8.4 Business problem definition�����������������������������������������������������������������������263
8.4.1 Face detection for surveillance����������������������������������������������������������265
8.4.2 Source data or data discovery phase�������������������������������������������������268
8.5 Data ingestion or data management�����������������������������������������������������������270
8.6 Data preparation and augmentation�����������������������������������������������������������272
8.6.1 Image augmentation��������������������������������������������������������������������������274
8.7 Deep Learning modeling process���������������������������������������������������������������279
8.7.1 Transfer learning��������������������������������������������������������������������������������282
8.7.2 Common mistakes/challenges and boosting performance����������������284

ix
Table of Contents

8.8 Model deployment and maintenance����������������������������������������������������������289


8.9 Summary����������������������������������������������������������������������������������������������������294
8.9.1 Further readings���������������������������������������������������������������������������������296

References����������������������������������������������������������������������������������������297
Major activation functions and layers used in CNN������������������������������������������297
Google Colab�����������������������������������������������������������������������������������������������������298

Index�������������������������������������������������������������������������������������������������303

x
About the Author
Vaibhav Verdhan is a seasoned data science
professional with rich experience spanning
across geographies and domains. He is
a hands-on technical expert and has led
multiple engagements in machine learning
and artificial intelligence. He is a leading
industry expert, is a regular speaker at
conferences and meetups, and mentors
students and professionals. Currently, he
resides in Ireland and is working as a Principal
Data Scientist.

xi
About the Technical Reviewer
Vishwesh Ravi Shrimali graduated from BITS Pilani in 2018, where he
studied mechanical engineering. Since then, he has worked with Big
Vision LLC on Deep Learning and computer vision and was involved in
creating official OpenCV AI courses. Currently, he is working at Mercedes-­
Benz Research and Development India Pvt. Ltd. He has a keen interest
in programming and AI and has applied that interest in mechanical
engineering projects. He has also written multiple blogs on OpenCV and
Deep Learning on Learn OpenCV, a leading blog on computer vision. He
has also coauthored Machine learning for OpenCV 4 (second edition) by
Packt. When he is not writing blogs or working on projects, he likes to go
on long walks or play his acoustic guitar.

xiii
Acknowledgments
I would like to express my thanks to the following people. It is the results of
their hard work and passion that are advancing this field:
Ross Girshick
Jeff Donahue
Trevor Darrell
Jitendra Malik
Shaoqing Ren
Kaiming He
Jian Sun
Christian Szegedy
Wei Liu
Yangqing Jia
Pierre Sermanet
Scott Reed
Dragomir Anguelov
Dumitru Erhan
Vincent Vanhoucke
Andrew Rabinovich
Sergey Ioffe
Jonathon Shlens
Xiangyu Zhang
Omkar M. Parkhi
Andrea Vedaldi
Andrew Zisserman
Yaniv Taigman
Ming Yang

xv
Acknowledgments

Marc’Aurelio Ranzato
Lior Wolf
Yann LeCun
Leon Bottou
Yoshua Bengio
Patrick Haffner
Sefik Ilkin Serengil

xvi
Introduction
Innovation distinguishes between a leader and a follower.
—Steve Jobs

How good is your driving? Will you drive better than an autonomous
driving system? Or do you think an algorithm will perform better than a
specialist in classifying medical images? It can be a tricky question. But
artificial intelligence has outperformed doctors in detecting lung cancer
and breast cancer by analyzing images! Ouch!
Nature has been very kind to grant us powers of sight, taste, smell,
touch, and hearing. Out of these senses, the power of sight allows us to
appreciate the beauty of the world, enjoy the colors, recognize the faces
of our family and loved ones, and above all relish this beautiful world and
life. With time, humans amplified the power of the brain and made path-­
breaking inventions and discoveries. The wheel or airplane, printing press
or clock, light bulb or personal computers – innovations have changed the
way we live, work, travel, decide, and progress. These innovations make life
simpler, easier, and far enjoyable and safe.
Data science and Deep Learning are allowing us to further enhance
the innovative buckets. Using Deep Learning, we are able to replicate
the power of vision given by nature. The computers are being trained to
perform the same tasks done by a human being. It can be detection of
colors or shape or size, classifying between a cat or a dog or a horse, or
driving on a road – the use cases are many. The solutions are applicable
for all the sectors like retail, manufacturing, BFSI, agriculture, security,
transport, pharmaceuticals, and so on.
This book is an attempt to explain the concepts of Deep Learning
and Neural Network for computer vision problems. We are examining
xvii
Introduction

convolutional Neural Networks in detail, and their various components


and attributes. We are exploring various Neural Network architectures
like LeNet, AlexNet, VGG, R-CNN, Fast R-CNN, Faster R-CNN, SSD, YOLO,
ResNet, Inception, DeepFace, and FaceNet in detail. We are also developing
pragmatic solutions to tackle use cases of binary image classification,
multiclass image classification, object detection, face recognition, and
video analytics. We will use Python and Keras for the solutions. All the
codes and datasets are checked into the GitHub repo for quick access.
In the final chapter, we are studying all the steps in a Deep Learning
project – right from defining the business problem to deployment. We
are also dealing with major errors and issues faced while developing the
solutions. Throughout the book, we are providing tips and tricks for training
better algorithms, reducing the training time, monitoring the results, and
improving the solution. We are also sharing prominent research papers and
datasets which you should use to gain further knowledge.
The book is suitable for researchers and students who want to explore
and implement computer vision solutions using Deep Learning. It is
highly useful and hence recommended for professionals who intend to
explore cutting-edge technology, grasp the advanced concepts, develop
a thorough understanding of Deep Learning architectures, and get the
best practices and solutions to common computer vision challenges. It
is directed toward the business leaders who wish to implement Deep
Learning solutions in their business and gain confidence while they
communicate with their teams and clientele. Above all, for a curious
person trying to explore how Deep Learning algorithms work for solving
computer vision problems and would like to try Python.
I would like to thank Apress, Aaron, Jessica, and Vishwesh for believing
in me and giving me the chance to work on this subject. And a special
word of thanks to my family – Yashi, Pakhi, and Rudra – for the excellent
support without which it would be impossible to complete this work.
Vaibhav Verdhan, November 2020, Limerick

xviii
Foreword
Computer Vision, not too long ago the exclusive purview of science fiction,
is quickly becoming commonplace across industries, if not in society at
large. The progress in the field to emulate human vision, that most prized
of human senses, is nothing but astonishing. It was only 1957 when Russell
Kirsch scanned the world’s first photograph, a black and white image of
his boy1. By the late 1980s, the work of Sirovich and Kirby2 helped establish
face recognition as a viable technology for biometric applications.
Facebook made the technology ubiquitous, notwithstanding privacy
concerns and legal challenges action3, when in 2010, it incorporated face
recognition in its social media platform.
The capabilities of Deep Learning vision systems to interpret and
extract information from images permeates all aspects of society. Only the
most skeptical among us doubt a not too distant future with self-driving
cars outnumbering those driven by their human counterparts or computer-­
aided diagnosis (CADx) of medical images becoming an ordinary
service supplied by medical providers. Computer vision applications

1
 he Associated Press “Computer scientist, pixel inventor Russell Kirsch dead
T
at 91”, The Associated Press, AP News, August 13, 2020, https://apnews.com/
article/technology-oregon-science-portland-us-news-db92e0b593f5156da9
70c0a1e9f90944. Accessed 9 December 2020.
2
Low-Dimensional Procedure for the Characterization of Human Faces, L. Sirovich
and M Kirby, March 1987, Journal of the Optical Society of America. A, Optics and
image science 4(3):519-24
3
Natasha Singer and Mike Isaac “Facebook to Pay $550 Million to Settle Facial
Recognition Suit” The New York Times, Jan 29, 2020 , https://www.nytimes.
com/2020/01/29/technology/facebook-privacy-lawsuit-earnings.html.
Accessed 9 December 2020.

xix
Foreword

already control access to our mobile devices and can outperform human
inspectors in the tedious but critical task of inspecting for defects in all
types of manufacturing processes. That is how I met Vaibhav, or V, as he is
known to his friends and colleagues. Collaborating on methods to improve
existing computer vision systems to ensure defect-free products critical for
human vision. Not lost is an appreciation of the circular history. We teach
computers how to see; they help manufacture products vital to improve
and care for human vision.
In this book, V takes a practical and convenient approach to the
subject. The abundant use of case studies is facilitated by ready-to-use
Python code and links to datasets and other tools. The practitioner’s
learning experience is enhanced by access to the resources needed to work
in a step-by-step fashion through each case study. The book organizes the
subject into three parts. In chapters 1 through 4, V describes the nature
of Neural Networks and demystifies how they learn. Along the way, he
points out different architectures and their historical significance. The
practitioner gets to experience, with all required resources in hand, the
elegant simplicity of LeNet, the improved efficiency of AlexNet, and
the popular VGG Net. In chapters 5 through 7, the practitioner applies
simple yet powerful computer vision applications such as training
systems to detect objects and recognize human faces. When progressing
into performing video analytics, we encounter the nagging problem of
vanishing and exploding gradients and how to overcome it using skip
connections in the ResNet architecture. Finally, in chapter 8, we review
the complete model development process, starting with a correctly
defined business problem and systematically advancing until the model is
deployed and maintain in a production environment.

xx
Foreword

We are now just starting to see the dramatic increase in complexity


and impact of tasks performed by computer systems that match and often
exceed what until recently, would be considered exclusively human vision
capabilities. Those aspiring to make this technology their ally, grow more
adept at incorporating vision systems into their practice, and become a
more skillful practitioner will greatly gain from the tools, techniques, and
methods presented in this book.
David O. Ramos
Jacksonville, FL
16 December 2020

xxi
CHAPTER 1

Introduction to
Computer Vision and
Deep Learning
Vision is the best gift to mankind by God.

Right from our birth, vision allows us to develop a conscious mind. Colors,
shapes, objects, and faces are all building blocks for our world. This gift of
nature is quite central to our senses.
Computer vision is one of the capabilities which allows the machines
to replicate this power. And using Deep Learning, we are enhancing our
command and making advancements in this field.
This book will examine the concepts of computer vision in the light
of Deep Learning. We will study the basic building blocks of Neural
Networks, develop pragmatic use cases by taking a case study–based
approach, and compare and contrast the performance of various solutions.
We will discuss the best practices, share the tips and insights followed
in the industry, make you aware of the common pitfalls, and develop a
thought process to design Neural Networks.

© Vaibhav Verdhan 2021 1


V. Verdhan, Computer Vision Using Deep Learning,
https://doi.org/10.1007/978-1-4842-6616-8_1
Chapter 1 Introduction to Computer Vision and Deep Learning

Throughout the book, we introduce a concept, explore it in detail, and


then develop a use case in Python around it. Since a chapter first builds the
foundations of Deep Learning and then its pragmatic usage, the complete
knowledge enables you to design a solution and then develop Neural
Networks for better decision making.
Some knowledge of Python and object-oriented programming
concepts is expected for a good understanding. A basic to intermediate
understanding of data science is advisable though not a necessary
requirement.
In this introductory chapter, we will develop the concepts of Image
Processing using OpenCV and Deep Learning. OpenCV is a great library
and is widely used in robotics, face recognition, gesture recognition, AR,
and so on. Deep Learning, in addition, offers a higher level of complexity
and flexibility to develop Image Processing use cases. We will cover the
following topics in this chapter:

(1) Image Processing using OpenCV

(2) Fundamentals of Deep Learning

(3) How Deep Learning works

(4) Popular Deep Learning libraries

1.1 Technical requirements


We are developing all the solutions in Python throughout the book; hence,
installation of the latest version of Python is required.
All the code, datasets, and respective results are checked into a code
repository at https://github.com/Apress/computer-vision-using-
deep-learning/tree/main/Chapter1. You are advised to run all the code
with us and replicate the results. This will strengthen your grasp on the
concepts.

2
Chapter 1 Introduction to Computer Vision and Deep Learning

1.2 Image Processing using OpenCV


An image is also like any other data point. On our computers and mobile
phones, it appears as an object or icon in .jpeg, .bmp, and .png formats.
Hence, it becomes difficult for humans to visualize it in a row-column
structure, like we visualize any other database. Hence, it is often referred to
as unstructured data.
For our computers and algorithms to analyze an image and work on it,
we have to represent an image in the form of integers. Hence, we work on
an image pixel by pixel. Mathematically, one of the ways to represent each
pixel is the RGB (Red, Green, Blue) value. We use this information to do
the Image Processing.

Info The easiest way to get RGB for any color is to open it in Paint
in Windows operating system. Hover over any color and get the
respective RGB value. In Mac OS, you can use Digital Colour Meter.

Deep Learning allows us to develop use cases which are much more
complex to be resolved using traditional Image Processing techniques. For
example, detecting a face can be done using OpenCV too, but to be able to
recognize one will require Deep Learning.
During the process of developing computer vision solutions using
Deep Learning, we prepare our image dataset first. During preparation, we
might have to perform grayscaling of the images, detect contours, crop the
images, and then feed them to the Neural Network.
OpenCV is the most famous library for such tasks. As a first step, let’s
develop some building blocks of these Image Processing methods. We will
create three solutions using OpenCV.

Note Go to www.opencv.org and follow the instructions over


there to get OpenCV installed on your system.

3
Chapter 1 Introduction to Computer Vision and Deep Learning

The images used for the solutions are the commonly available
ones. You are advised to examine the code and follow the step-by-step
implementation done. We will detect shape, colors, and a face in an image.
Let’s dive into the exciting world of images!

1.2.1 Color detection using OpenCV


When we think of an image, it is made up of shapes, sizes, and colors.
Having the capability to detect shape, size, or color in an image can
automate a lot of processes and save huge efforts. In the very first example,
we are going to develop a “color detection system.”
Color detection is having a wide range of utility across domains and
industries like manufacturing, automotive, electricity, utilities, and so
on. Color detection can be used to look for abruptions, failures, and
disruptions to normal behavior. We can train sensors to take a particular
decision based on the color and raise an alarm if required.
An image is represented using pixels, and each pixel is made up of RGB
values ranging from 0 to 255. We will be using this property to identify the
blue color in the image (Figure 1-1). You can change the respective values
for the blue color and detect any color of choice.
Follow these steps:
1. Open the Python Jupyter Notebook.

2. First load the necessary libraries, numpy and OpenCV.

import numpy as np
import cv2

3. Load the image file.

image = cv2.imread('Color.png')

4
Chapter 1 Introduction to Computer Vision and Deep Learning

Figure 1-1. Raw image to be used for color detection. The image
shown has four different colors, and the OpenCV solution will detect
them individually

4. Now let us convert our raw image to HSV (Hue Saturation


Value) format. It enables us to separate from saturation and
pseudo-illumination. cv2.cvtColor allows us to do that.

hsv_convert = cv2.cvtColor(image, cv2.COLOR_BGR2HSV)

5. Define the upper and lower ranges of the color here. We


are detecting the blue color. From the numpy library, we
have given the respective range for the blue color.

lower_range = np.array([110,50,50])
upper_range = np.array([130,255,255])

6. Now, let’s detect the blue color and separate it from


the rest of the image.

mask_toput = cv2.inRange(hsv_convert, lower_range,


upper_range)
cv2.imshow('image', image)
cv2.imshow('mask', mask_toput)
while(True):
k = cv2.waitKey(5)& 0xFF if k== 27: break

5
Chapter 1 Introduction to Computer Vision and Deep Learning

The output of this code will be as shown in Figure 1-2.

Figure 1-2. Output of the colour detection system. We want to detect


blue colour which is detected and separated from rest of the image

As visible, the blue color is highlighted in white, while the rest of the
image is in black. By changing the ranges in step 5, you can detect different
colors of your choice.
With color done, it is time to detect a shape in an image; let’s do it!

1.3 Shape detection using OpenCV


Like we detected the blue color in the last section, we will detect triangle,
square, rectangle, and circle in an image. Shape detection allows you to
separate portions in the image and check for patterns. Color and shape
detections make a solution very concrete. The usability lies in safety
monitoring, manufacturing lines, automobile centers, and so on.
For Shape detection, we get the contours of each shape, check the
number of elements, and then classify accordingly. For example, if this
number is three, it is a triangle. In this solution, you will also observe how
to grayscale an image and detect contours.

6
Chapter 1 Introduction to Computer Vision and Deep Learning

Follow these steps to detect shapes:

1. Import the libraries first.

import numpy as np
import cv2

2. Load the raw image now shown in Figure 1-3.

shape_image = cv2.imread('shape.png')

Figure 1-3. Raw input image for detecting the three shapes of circle,
triangle, and rectangle

3. Convert the image to grayscale next. Grayscaling is


done for simplicity since RGB is three-dimensional
while grayscale is two-dimensional, and converting
to grayscale simplifies the solution. It also makes the
code efficient.

gray_image = cv2.cvtColor(shape_image, cv2.COLOR_BGR2GRAY)


ret,thresh = cv2.threshold(gray_image,127,255,1)

4. Find the contours in the image.

contours,h = cv2.findContours(thresh,1,2)

7
Chapter 1 Introduction to Computer Vision and Deep Learning

5. Try to approximate each of the contours using


approxPolyDP. This method returns the number of
elements in the contours detected. Then we decide the
shape based on the number of elements in the contours.
If the value is three, it is a triangle; if it’s four, it is a
square; and so on.

for cnt in contours:


    approx =
    
cv2.approxPolyDP(cnt,0.01*cv2.arcLength(cnt,True),True)
print (len(approx))
if len(approx)==3:
    print ("triangle")
    cv2.drawContours(shape_image,[cnt],0,(0,255,0),-1)
elif len(approx)==4:
    print ("square")
    cv2.drawContours(shape_image,[cnt],0,(0,0,255),-1)
elif len(approx) > 15:
    print ("circle")
    cv2.drawContours(shape_image,[cnt],0,(0,255,255),-1)
cv2.imshow('shape_image',shape_image)   cv2.waitKey(0)
cv2.destroyAllWindows()

6. The output of the preceding code is shown in Figure 1-4.

Figure 1-4. The output of the color detection system. A circle is shown
in yellow, square is shown in red, and triangle is shown in green

8
Chapter 1 Introduction to Computer Vision and Deep Learning

You can now detect shapes in any image. We have detected a circle,
a triangle, and a square. A good challenge will be to detect a pentagon or
hexagon; are you game?
Let’s do something more fun now!

1.3.1 Face detection using OpenCV


Face detection is not a new capability. Whenever we look at a picture, we
can recognize a face quite easily. Our mobile phone camera draws square
boxes around a face. Or on social media, a square box is created around a
face. It is called face detection.
Face detection refers to locating human faces in digital images. Face
detection is different from face recognition. In the former, we are only
detecting a face in an image, whereas in the latter we are putting a name to
the face too, that is, who is the person in the photo.
Most of the modern cameras and mobiles have a built-in capability
to detect faces. A similar solution can be developed using OpenCV. It is
simpler to understand and implement and is built using the Haar-cascade
algorithm. We will highlight faces and eyes in a photograph while using
this algorithm in Python.
Haar-cascade classifier is used to detect faces and other facial
attributes like eyes in an image. It is a Machine Learning solution wherein
training is done on a lot of images which have a face and which do not have
a face in them. The classifier learns the respective features. Then we use the
same classifier to detect faces for us. We need not do any training here as the
classifier is already trained and ready to be used. Saves time and effort, too!

Info Object detection using Haar-based cascade classifiers was


proposed by Paul Viola and Michael Jones in their paper “Rapid
Object Detection using a Boosted Cascade of Simple Features” in
2001. You are advised to go through this path-breaking paper.

9
Chapter 1 Introduction to Computer Vision and Deep Learning

Follow these steps to detect a face:

1. Import the libraries first.

import numpy as np
import cv2

2. Load the classifier xml file. The .xml file is designed


by OpenCV and is created by training cascade of
negative faces superimposed on positive images and
hence can detect the facial features.

face_cascade = cv2.CascadeClassifier(
'haarcascade_frontalface_default.xml')
eye_cascade = cv2.CascadeClassifier(
'haarcascade_eye.xml')

3. Next, load the image (Figure 1-5).

img = cv2.imread('Vaibhav.jpg')

Figure 1-5. Raw input image of a face which is used for the face
detection using the Haar-cascade solution

4. Convert the image to grayscale.

gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

10
Random documents with unrelated
content Scribd suggests to you:
The Project Gutenberg eBook of The Yale Literary
Magazine (Vol. LXXXVIII, No. 9, June 1923)
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

Title: The Yale Literary Magazine (Vol. LXXXVIII, No. 9, June


1923)

Author: Various

Release date: July 13, 2022 [eBook #68518]

Language: English

Original publication: United States: Herrick & Noyes

Credits: hekula03 and the Online Distributed Proofreading Team


at https://www.pgdp.net (This book was produced from
images made available by the HathiTrust Digital
Library.)

*** START OF THE PROJECT GUTENBERG EBOOK THE YALE


LITERARY MAGAZINE (VOL. LXXXVIII, NO. 9, JUNE 1923) ***
Vol. LXXXVIII No. 9

The
Yale Literary Magazine
Conducted by the
Students of Yale University.

“Dum mens grata manet, nomen laudesque Yalenses


Cantabunt Soboles, unanimique Patres.”

June, 1923.
New Haven: Published by the Editors.
Printed at the Van Dyck Press, 121-123 Olive St., New Haven.

Price: Thirty-five Cents.


Entered as second-class matter at the New Haven Post Office.

ESTABLISHED 1818

MADISON AVENUE COR. FORTY-FOURTH STREET NEW


YORK
Telephone Murray Hill 8800

Flannels for Town and Country


Summer Furnishings
Straw and Panama Hats
Russia, Calf and Buckskin Shoes
Travelling Kits

Send for “Comparisons”


BOSTON
Tremont cor. Boylston
NEWPORT
220 Bellevue Avenue

THE YALE CO-OP.


A purchasing agent for the students and Faculty, and distributor
of Standard Merchandise on a Co-operative basis.
Thirty-eight years of service to over 30,000 members.
Larger stocks carried, and mail order business increasing every
year.
THE YALE LITERARY
MAGAZINE

Contents
JUNE, 1923

Leader David Gillis Carter 283


Valediction Herbert W. Hartman, Jr. 285
The Wind on the Sea W. T. Bissell 286
Association Morris Tyler 291
Three Fables Walter Edwards Houghton, Jr. 292
Sonnet Frank D. Ashburn 300
Song Before Dawn Walter Edwards Houghton, Jr. 301
To —— Arthur Milliken 302
Stanza D. G. Carter 303
Sonnet Frank D. Ashburn 304
Lady of Kind Hands J. Crosby Brown, Jr. 305
Book Reviews 307
Editor’s Table 310
The Yale Literary Magazine

Vol. LXXXVIII JUNE, 1923 No. 9

EDITORS

WALTER EDWARDS HOUGHTON, JR.


LAIRD SHIELDS GOLDSBOROUGH DAVID GILLIS CARTER
MORRIS TYLER NORMAN REGINALD JAFFRAY

BUSINESS MANAGERS

GEORGE W. P. HEFFELFINGER WALTER CRAFTS


Leader
Probably one in every ten men brought up in a cultured environment
has written, at some youthful period or other, sentimental verse.
Such product is in any prep.-school paper; a few brilliant or hard
working youngsters win prizes each year for the best “poems” of
their classes. But too many of these prodigies, because they are one
in ten, are convinced that they are endowed with the powers of a
poet. They cannot realize that riming is to be outgrown at
adolescence, just as other games are. Since some grown men
continue to write poetry, and no one continues to rollerskate, they put
off rollerskating as a childish thing, but they keep puttering away
over platitudes “To ——” and to Spring. They have not yet come fully
into their manhood.
Personally, I should prefer them to become professional
rollerskaters, for then they could do no harm. Instead, they join the
group of “younger litterati” of college, and play the artist as an extra-
curriculum means to distinction, bringing down an undeserved
indictment upon whatever men there happen to be with music in their
hearts, and with something to say. The university which most desires
to honor its true artists finds itself rewarding a kindergarten
Greenwich Village for sentimentality that will be forgotten before the
quickness of time has killed it. “Litterati” thus has become to others a
name of derision, and “he heels the Lizzie Club” is a taunt.
Especially, a magazine founded for the sincere promotion of literary
expression is in danger before these men with the trick of verse and
a desire for prominence.
It has become, therefore, the duty of the Lit. to defend itself, and
to stand guard for the rest of the College, against this tendency to
dilettantism, even while it welcomes to its pages the writer who is
eager to learn and practice expression. Such a task is difficult, I
acknowledge, because it involves a judgment between boys by boys,
but it is not impossible. We have had enough poets at Yale in the
past few years to be able to distinguish them generally from the
poetasters, and if a fake slips by now and then, time betrays him and
the laurels he has won. Many attain a kind of prominence that is
strangely akin to that of a rollerskater who has taken a spill.
Yet it might be well for those interested in Yale literature to look
suspiciously at the number of undergraduates who are Lit. heelers
only when it is profitable, who drop out—never to write again—when
the competition is crowded, or who begin to write when it is seen that
there is to be a vacancy on the Board. They are unquestionably with
us, accomplishing nothing more than to disgust and alienate those
who really desire to write. Unquestionably, such an element is
exceedingly bad for Yale, if Yale intends to be any kind of a force in
literature. If the Lit. Board and kindred honors are to mean more
than a badge placed somewhere on a college boy’s anatomy, we
must show the pretender that he is out of place.
Of course, this must not lead to the discouragement of anyone
with the slightest itching of the pen. It is the man who writes badly,
yet for the sheer and indescribable love of writing, who should resent
most the prostitution of our literary organizations, for to the
“passionate few” creating is serious, joyous business. The
“passionate few” must direct public sentiment against those who
would play it as a game in the childish politics of the University. We
must not permit a false intelligentsia to become associated with Yale.
We cannot allow clever youngsters, fired with the aspiration of a
charm for their watch-chains, to hack out verses in the feverish night
before a makeup. However few, and however dry, the pages of the
Lit. may be, we want them to contain the result of sincere emotion;
we want the author to have given the best of his ability toward
making his contribution acceptable by any editor. This is the only
way a literary magazine can be written.
DAVID GILLIS CARTER.
Valediction

Here where our hearts respond to lovers’ cries


With ready swiftness, where our laughters leap
From our lips, shall we not resolutely keep
This boyhood, looking on stars with boyish eyes?
Rapture, we know, grows old and subtly dies
Within us,—this much we know, and wisely creep
Away from age lest we disturb his sleep
Where Youth intolerably weeping lies.

Is this our portion? Shall we not go far


Beyond this presence, bearing our flags unfurled
Exultantly beyond some alien hill
Of dreams?—rise up, and up, and up, until
This place we knew must seem a sorry world
And the old earth a too familiar star?

HERBERT W. HARTMAN, JR.


The Wind On the Sea
A fresh wind from the ocean made the waves sparkle when Daniel
took his cruise. He was on a solitary tour of New York Harbor in a
hired motorboat, his tribute to the general pleasantness of a spring
day out of doors, balmy, yet with sufficient air. A motorboat was not,
he reflected, as attractive to a lover of the sea as a sailboat, but it
enabled him to poke around the arms of the port more satisfactorily.
Today he set off down the harbor with the breeze in his face.
At first he passed close to the docks of the enormous ships, some
of which were so long their shapely stems reached far out into the
stream. Nothing was so exciting as seeing their masts and the tops
of their huge funnels over the top of a dock. It reminded him of a
glimpse he had had of the tall, delicate spars of sailing vessels over
the roofs of a seacoast town. The realization of being on the
immediate threshold of the romantic sea is irresistible in its rich
suggestions, linking the most prosaic person for a moment with
strange places, hitherto only imagined, and possibilities of
adventure, startling even at a distance from the point of view of
ordinary life. Daniel thought about this and other theories of his
concerning the sea as his boat sauntered past the imposing liners
which so engrossed his attention. Their sharp, carefully flaring bows
and the suggestion of velocity in their slanting rigging attracted him.
One was just docking as he went by. It was huge, and seemed a city
with a host of tugs like parasites slowly pushing it around. He could
never get over the size of them. It seemed like magic,—this, building
a community that floated so snugly on the water, the four red funnels
above adding the emblem of something powerful in its compactness.
Yet in spite of their size, the steamers seemed at a distance slim and
graceful, essentially ships and obviously made to deal with the
exacting ocean. Daniel saw liners with more penetrating eyes than
the ordinary casual observer, he was sure.
It was not long before he was off down the harbor away from the
docks. Here the waves danced to the breeze among the little boats
which carried on the teeming local traffic of the port, rushing back
and forth like water-bugs on a pond. The vessels that were anchored
strained at the ends of taut hawsers with the wind and tide both
coming up the bay. Over near the farther shore against the sun, a
great ship was moving down, a massive black shadow sliding
imperiously out to sea. He steered the launch near the anchored
vessels, under their high sterns. Reading their names was a
fascinating diversion for an imaginative person like himself, he
thought. Here was the “George B. White” of Jersey City, near it the
“Orphan” of Bombay; here a sloppy tramp from Beirut, there an
empty freighter of Cape Town; Japanese and Chinese and Javanese
vessels were there whose names he could not read, and a little ship
from the Piraeus, laden with smells from Athens—dirt from her
gutters and hovels, and dust from the Acropolis.
Well, well, what a highway the sea was, after all. It was
fascinating, the harbor, fascinating! These great ships always sailing
out on voyages that somehow still seemed perilous, and others,
looking—to the imagination, at least—weatherbeaten, coming in
from foreign lands.
He turned and headed out past the narrows to the slow dips of the
ground swell, powerful, but almost at peace for the moment, which
his little boat climbed and descended like smooth, gentle hills. The
sun still sparkled, and here the water slapped more vigorously
against the sides of the boat, throwing flecks of spray out and
whirling back some of them to sting his face. He was getting
gradually drunk, he concluded. Certainly the spaciousness of
everything around him was going to his head. But it was, he later
decided, really the smell of the air that did it. No sweet gasoline-sick
atmosphere of streets out here, nor the faint odor of millions of his
fellow-men to which he was accustomed in the buildings he
frequented. The breeze was fresh and tasted strong of salt. It had a
palpable vigor of its own. Not artificially intoxicating like a stimulant,
but with a gusty sting. It whipped his mind and brought it up eager
and sharp, like a trembling racehorse.
That air—that makes men on steamers feel so ridiculously fit
without exercise, enabling them to eat and eat—tea, jam, pastry,
steaks, cheeses, and then sit and read all day in one steamer chair
and be ravenous again! If only he could sail on a ship, he thought. To
feel so strong and finely balanced—not, as usual, subject to his little
moods of depression which so often went hand in hand with
indigestion, he had discovered—to feel so well tuned! He had a
vision of himself as he would stand on a ship—as he had, on the
only trip he had ever taken—in the very peak of the bow, looking
over and watching the tall prow sweep down on and devour the
unsuspecting patches of the sea. He remembered how the breeze
was steady in his face and how he used almost to taste it! His hair
was worried by the wind and he relished its swift buffets on his face
as he stood against it, drinking it in as a hot man drinks a running
stream. What nameless joy he felt, he now remembered; and how he
used so to overflow with something buoyant inside him that he would
ecstatically smile. Well tuned! And singing, like an old lyre at the
touch!
Well, if he could get to feeling like that he would give anything, he
said to himself in his conventional way—and suddenly he grew
disgusted. Give anything! Lord, he wouldn’t give up a month of his
most valuable time. Love the sea! He had been repeating to himself
all during his little outing that he loved the sea. He was one of those
few who really loved the sea. He felt that he understood it better than
a good many people. As though he knew anything about it, who had
never gone to sea and never would. His experience of it standing on
the street-like decks of a liner and watching it; thinking about it, he
flattered himself, with rather a light touch, as it were, but still from a
poetic point of view.
The light touch! Everything nowadays was written and spoken and
even thought of with a light touch. A light touch in connection with
the sea! The old sailing vessels—swift clippers around the horn; that
was the ocean! No drawing-room stuff about that. When the brutal
masters carried all the press of sail they could in those tremendous
storms, till the topmasts went and the gear came flying down like a
thunderbolt and had to be chopped away to save the ship. Trim
ships where you worked beneath the lash, and insubordination was
best viewed from the yardarm. Ships used to go down and never be
heard from—often in those days. But the men that lived were really
children of the sea who knew its great aspects; and they knew their
ships, every inch of them, from their thin spars that “shone like
silver”, as the chantey says, to the bright copper on their keels.
The great longing, the parching thirst of a hothouse intellect for
hardship swept over him like a wave of the sea itself. Hardship
assumed an intrinsic value for him at once, as it had one winter in
the South when he missed savagely the bleak Januaries of his
Northern home; as it had when he read of the Homeric heroes who
so relished battle, and the brawn children of Thor, and Sir Lancelot
with his great shoulders in iron, oppressed and conquering. It
seemed as though hardships were the only road to reality, somehow.
Hardships of the sea,—the grim knowledge of experience; that would
have given him something solid in his mind! But none of that on the
ocean now. Where there had been towers of canvas (as he
visualized it) now there were freighters. Clippers and freight ships!
The sea rather intriguing whimsical people like himself—when once
she held men until it was her will to fling them away! Whimsy! What
was this compared to a strong man’s desire? What was this careful
self-consciousness of his feelings to his grand impulses?—the
humorous affairs of life to the grim ones?—dilettantism to the
austere compulsion of a passion?
While Daniel was working himself up in this manner, he was
steering straight out to sea, and, in doing so, overhauling a tramp
steamer that was starting on a voyage. He was coming abreast of
what he later called his fate. Upon impulse, he dared the wash of the
boat when he came opposite and ran in close along her side,
slowing down so as to keep pace for a while. She was old and
scarred, with a dip in her middle like an overworked horse’s back
which seemed to give her a jaunty air. Paint had not been wasted on
her ramshackle sides, nor any white on her cabin above, nor red on
her rusty funnel. Filthy clothes, drying in the sun, hung from
clotheslines; a thick rope dragged over the side near the stern and it
splashed irregularly in the water. She was dilapidated. But some of
her crew were singing for some reason or other as they finished
stowing cargo, and the sight of the little boat facing outward and the
sight of the great, blank, capricious sea ahead waiting for her was
distinctly thrilling, particularly as a fog was coming up, making even
the horizon mysterious in its invisibility.
What would it be like, Daniel wondered all of a sudden, if he were
to hail this boat and jump aboard? Often he had considered doing
some quite possible thing like this, such as getting off a Western
train as it stopped at a little, unknown town and—simply staying
there, or chucking his work some morning and going on the stage.
But there he was again with those light fancies of his. People like
himself seemed to have their individualities in glass cases, to be
looked at like shell-flowers. What was he, anyway, that he actually
could not do what he wanted to? Why should he be so bound, and
he was bound, he knew, as if with iron bars. Tied down. Slaves,
slaves, slaves. People thought of doing this and that—they still had
impulses at least, thank God—and were powerless to do them.
There seemed no manhood left. People didn’t seem to be in control
of themselves any more. Freedom!—he wondered at the word. Oh,
for a touch of it—just a taste—just a whiff! Creatures in the grasp of
something huge and stolid! Damn those infernal practical
considerations! What was the world, a gigantic taskroom—an ogre-
like mill to be turned? By heaven, he must have a will! God knew he
must stand there free! He even looked around wildly to assure
himself that he was there alone and free.
Then he stood up. There was the rope hanging over the side. He
sprang for it, clutched it, and swung there.
There was no shield between him and a rasping sense of
mortification as he dragged himself spluttering and coughing into his
motorboat once more forty seconds later. He had so neatly proved
what he had railed at in this unusual seizure of the disease of spring,
and so humorously. Had staid old common sense ever had to deal
so brazenly with an impulse as to make a man jump into the sea?
Damp physically, and with a real bitterness in his heart at such a
plain statement of affairs, the world seemed very dark. Depression
swooped down upon his mind like the swift black shadow of a
vulture, and as he made his way home for three hours it seemed to
be actually feeding on his nerves. It was that dark, stone-wall type of
depression which is unarguable and seems final—as though trusted
old hope had a limit which was suddenly glimpsed around a bend in
the road. It left no room for hypothesis; things were seen clearly to
be foundationless that had been rocks to the imagination.
He resolved at any rate to bury this experience in his heart as a
tragic sort of trophy which should represent in its bitter essence all
the disgust with life that assails people during a lifetime. He had
nearly played a trick upon mortality, he reflected. A fine gesture had
been made, and he had snatched lustily for the unvouchsafed. It was
an affecting experience and one to be reverenced. But of course
what really happened was that he made a very good story out of it
and one which afforded intense amusement to his friends, though he
was prone to shed a mental tear as he told it now and then.
W. T. BISSELL.
Association

He sat across from me, one hand on chin,


The other, carrion-clawed, twitched side to side,
And I could see how brittle was his skin
Like crust of bread too long in oven dried.
We had been talking as two strangers will
At times. But just then something I had said
Had seemed to shake him like a fever-chill
The way he shook, the way his face went red.

As I sat wondering why he let me see


This grief or shame which smote him to the core,
He slowly fluttered, took the wine from me,
Poured twice and drank; then filled his glass once more,
Smiled wistfully, and, raising up his head,
Told me that it was nothing I had said.

MORRIS TYLER.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like