基本信息
源码名称:Deep Learning for Computer Vision with Python ImageNet Bundle.pdf
源码大小:25.82M
文件格式:.pdf
开发语言:Python
更新时间:2020-10-30
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
Deep Learning for Computer Vision with Python ImageNet Bundle 书籍
Contents 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3 Training Networks Using Multiple GPUs . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.1 How Many GPUs Do I Need? 17 3.2 Performance Gains Using Multiple GPUs 18 3.3 Summary 19 4 What Is ImageNet? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 4.1 The ImageNet Dataset 21 4.1.1 ILSVRC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 4.2 Obtaining ImageNet 23 4.2.1 Requesting Access to the ILSVRC Challenge . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.2.2 Downloading Images Programmatically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.2.3 Using External Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.2.4 ImageNet Development Kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.2.5 ImageNet Copyright Concerns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.3 Summary 27 5 Preparing the ImageNet Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 5.1 Understanding the ImageNet File Structure 29 5.1.1 ImageNet “test” Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 5.1.2 ImageNet “train” Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 5.1.3 ImageNet “val” Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 5.1.4 ImageNet “ImageSets” Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 5.1.5 ImageNet “DevKit” Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 5.2 Building the ImageNet Dataset 37 5.2.1 Your First ImageNet Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 5.2.2 Our ImageNet Helper Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 5.2.3 Creating List and Mean Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 5.2.4 Building the Compact Record Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 5.3 Summary 52 6 Training AlexNet on ImageNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 6.1 Implementing AlexNet 54 6.2 Training AlexNet 58 6.2.1 What About Training Plots? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 6.2.2 Implementing the Training Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 6.3 Evaluating AlexNet 65 6.4 AlexNet Experiments 67 6.4.1 AlexNet: Experiment #1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 6.4.2 AlexNet: Experiment #2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 6.4.3 AlexNet: Experiment #3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 6.5 Summary 74 7 Training VGGNet on ImageNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 7.1 Implementing VGGNet 76 7.2 Training VGGNet 81 7.3 Evaluating VGGNet 85 7.4 VGGNet Experiments 86 7.5 Summary 88 8 Training GoogLeNet on ImageNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 8.1 Understanding GoogLeNet 89 8.1.1 The Inception Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 8.1.2 GoogLeNet Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 8.1.3 Implementing GoogLeNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 8.1.4 Training GoogLeNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 8.2 Evaluating GoogLeNet 99 8.3 GoogLeNet Experiments 99 8.3.1 GoogLeNet: Experiment #1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 8.3.2 GoogLeNet: Experiment #2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 8.3.3 GoogLeNet: Experiment #3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 8.4 Summary 103 9 Training ResNet on ImageNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 9.1 Understanding ResNet 105 9.2 Implementing ResNet 106 9.3 Training ResNet 112 9.4 Evaluating ResNet 116 9.5 ResNet Experiments 116 9.5.1 ResNet: Experiment #1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 9.5.2 ResNet: Experiment #2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 9.5.3 ResNet: Experiment #3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 9.6 Summary 120 10 Training SqueezeNet on ImageNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 10.1 Understanding SqueezeNet 121 10.1.1 The Fire Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 10.1.2 SqueezeNet Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 10.1.3 Implementing SqueezeNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 10.2 Training SqueezeNet 128 10.3 Evaluating SqueezeNet 132 10.4 SqueezeNet Experiments 132 10.4.1 SqueezeNet: Experiment #1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 10.4.2 SqueezeNet: Experiment #2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 10.4.3 SqueezeNet: Experiment #3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 10.4.4 SqueezeNet: Experiment #4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 10.5 Summary 139 11 Case Study: Emotion Recognition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 11.1 The Kaggle Facial Expression Recognition Challenge 141 11.1.1 The FER13 Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 11.1.2 Building the FER13 Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 11.2 Implementing a VGG-like Network 147 11.3 Training Our Facial Expression Recognizer 150 11.3.1 EmotionVGGNet: Experiment #1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 11.3.2 EmotionVGGNet: Experiment #2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 11.3.3 EmotionVGGNet: Experiment #3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 11.3.4 EmotionVGGNet: Experiment #4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 11.4 Evaluating our Facial Expression Recognizer 157 11.5 Emotion Detection in Real-time 159 11.6 Summary 163 12 Case Study: Correcting Image Orientation . . . . . . . . . . . . . . . . . . . . 165 12.1 The Indoor CVPR Dataset 165 12.1.1 Building the Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 12.2 Extracting Features 170 12.3 Training an Orientation Correction Classifier 173 12.4 Correcting Orientation 175 12.5 Summary 177 13 Case Study: Vehicle Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 13.1 The Stanford Cars Dataset 179 13.1.1 Building the Stanford Cars Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 13.2 Fine-tuning VGG on the Stanford Cars Dataset 187 13.2.1 VGG Fine-tuning: Experiment #1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 13.2.2 VGG Fine-tuning: Experiment #2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 13.2.3 VGG Fine-tuning: Experiment #3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 13.3 Evaluating our Vehicle Classifier 195 13.4 Visualizing Vehicle Classification Results 197 13.5 Summary 201 14 Case Study: Age and Gender Prediction . . . . . . . . . . . . . . . . . . . . . . 203 14.1 The Ethics of Gender Identification in Machine Learning 203 14.2 The Adience Dataset 204 14.2.1 Building the Adience Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 14.3 Implementing Our Network Architecture 219 14.4 Measuring “One-off” Accuracy 221 14.5 Training Our Age and Gender Predictor 224 14.6 Evaluating Age and Gender Prediction 227 14.7 Age and Gender Prediction Results 230 14.7.1 Age Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 14.7.2 Gender Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 14.8 Visualizing Results 233 14.8.1 Visualizing Results from Inside Adience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 14.8.2 Understanding Face Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 14.8.3 Applying Age and Gender Prediction to Your Own Images . . . . . . . . . . . . . . 240 14.9 Summary 244 15 Faster R-CNNs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 15.1 Object Detection and Deep Learning 247 15.1.1 Measuring Object Detector Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 15.2 The (Faster) R-CNN Architecture 250 15.2.1 A Brief History of R-CNN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 15.2.2 The Base Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 15.2.3 Anchors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 15.2.4 Region Proposal Network (RPN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 15.2.5 Region of Interest (ROI) Pooling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 15.2.6 Region-based Convolutional Neural Network . . . . . . . . . . . . . . . . . . . . . . . . . 259 15.2.7 The Complete Training Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 15.3 Summary 260 16 Training a Faster R-CNN From Scratch . . . . . . . . . . . . . . . . . . . . . . . . . 261 16.1 The LISA Traffic Signs Dataset 261 16.2 Installing the TensorFlow Object Detection API 262 16.3 Training Your Faster R-CNN 263 16.3.1 Project Directory Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 16.3.2 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 16.3.3 A TensorFlow Annotation Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 16.3.4 Building the LISA TensorFlow Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 16.3.5 A Critical Pre-Training Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274 16.3.6 Configuring the Faster R-CNN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 16.3.7 Training the Faster R-CNN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 16.3.8 Suggestions When Working with the TFOD API . . . . . . . . . . . . . . . . . . . . . . . . 282 16.3.9 Exporting the Frozen Model Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 16.3.10 Faster R-CNN on Images and Videos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 16.4 Summary 290 17 Single Shot Detectors (SSDs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 17.1 Understanding Single Shot Detectors (SSDs) 293 17.1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 17.1.2 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 17.1.3 MultiBox, Priors, and Fixed Priors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 17.1.4 Training Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 17.2 Summary 297 18 Training a SSD From Scratch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 18.1 The Vehicle Dataset 299 18.2 Training Your SSD 300 18.2.1 Directory Structure and Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 18.2.2 Building the Vehicle Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 18.2.3 Training the SSD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 18.2.4 SSD Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 18.2.5 Potential Problems and Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 18.3 Summary 312 19 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 19.1 Where to Now? 314