Convolutional Neural Networks (CNNs) are responsible for the major breakthroughs in image recognition made in the past few years. In this chapter we will cover:

  • Implementing a Simpler CNN
  • Implementing an Advanced CNN
  • Retraining Existing CNN models
  • Applying Stylenet/Neural-Style
  • Implementing DeepDream

 

The CIFAR-10 and CIFAR-100 are labeled subsets of the 80 million (八千万) tiny images dataset. They were collected by Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton.

Click here: https://www.cs.toronto.edu/~kriz/cifar.html

Visual dictionary

Click on top of the map to visualize the images in that region of the visual dictionary.

We present a visualization of all the nouns in the English language arranged by semantic meaning. 根据语义可视化名词

Each of the tiles in the mosaic is an arithmetic average of images relating to one of 53,464 nouns. 与五万多个名词之一相关的一个由一大堆图像算数平均后的像素点

The images for each word were obtained using Google's Image Search and other engines. A total of 7,527,697 images were used, each tile being the average of 140 images.

大概就是如此,如下:

[Tensorflow] Cookbook -  Object Classification based on CIFAR-10

 

The CIFAR-10 dataset

The CIFAR-10 dataset consists of 60000 32x32 colour images in 10 classes, with 6000 images per class.

There are 50000 training images and 10000 test images

Here are the classes in the dataset, as well as 10 random images from each:

airplane [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10
automobile [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10
bird [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10
cat [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10
deer [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10
dog [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10
frog [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10
horse [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10
ship [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10
truck [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10 [Tensorflow] Cookbook -  Object Classification based on CIFAR-10


The classes are completely mutually exclusive. There is no overlap between automobiles and trucks. "Automobile" includes sedans, SUVs, things of that sort. "Truck" includes only big trucks. Neither includes pickup trucks.

This recipe is an adapted version of the official TensorFlow CIFAR-10 tutorial, which is
available under the See also section at the end of this chapter. We have condensed the
tutorial into one script and will go through it line-by-line and explain all the code that is
necessary. We also revert some constants and parameters to the original cited paper values,
which we will point out in the following appropriated steps.

 

前言:使用我的四核i7小笔记本训练了一次数据,CPU满负荷,生怕机器就此挂了。

Starting Training
Generation 50: Loss = 1.99133
Generation 100: Loss = 1.82077
Generation 150: Loss = 2.08245
Generation 200: Loss = 1.60232
Generation 250: Loss = 1.73661
Generation 300: Loss = 1.71986
Generation 350: Loss = 1.45252
Generation 400: Loss = 1.51505
Generation 450: Loss = 1.50190
Generation 500: Loss = 1.43989
 --- Test Accuracy = 49.22%.
Generation 550: Loss = 1.34899
Generation 600: Loss = 1.28325
Generation 650: Loss = 1.45376
Generation 700: Loss = 1.22179
Generation 750: Loss = 1.40790
Generation 800: Loss = 1.23635
Generation 850: Loss = 1.36577
Generation 900: Loss = 1.29193
Generation 950: Loss = 1.16195
Generation 1000: Loss = 1.30807
 --- Test Accuracy = 53.91%.
Generation 1050: Loss = 1.53120
Generation 1100: Loss = 1.19605
Generation 1150: Loss = 1.07220
Generation 1200: Loss = 1.03782
Generation 1250: Loss = 1.22976
Generation 1300: Loss = 0.96371
Generation 1350: Loss = 1.06199
Generation 1400: Loss = 1.04158
Generation 1450: Loss = 1.09863
Generation 1500: Loss = 1.00462
 --- Test Accuracy = 61.72%.
Generation 1550: Loss = 0.93589
Generation 1600: Loss = 0.94716
Generation 1650: Loss = 0.97767
Generation 1700: Loss = 0.89214
Generation 1750: Loss = 0.93194
Generation 1800: Loss = 0.78864
Generation 1850: Loss = 0.79083
Generation 1900: Loss = 1.16496
Generation 1950: Loss = 0.95690
Generation 2000: Loss = 0.71276
 --- Test Accuracy = 64.84%.
Generation 2050: Loss = 0.90579
Generation 2100: Loss = 0.82735
Generation 2150: Loss = 0.89798
Generation 2200: Loss = 0.90343
Generation 2250: Loss = 0.83713
Generation 2300: Loss = 0.85635
Generation 2350: Loss = 0.83437
Generation 2400: Loss = 0.83430
Generation 2450: Loss = 0.87104
Generation 2500: Loss = 0.84299
 --- Test Accuracy = 74.22%.
Generation 2550: Loss = 0.79991
Generation 2600: Loss = 0.80746
Generation 2650: Loss = 0.82027
Generation 2700: Loss = 0.84372
Generation 2750: Loss = 0.81977
Generation 2800: Loss = 0.77057
Generation 2850: Loss = 0.75629
Generation 2900: Loss = 0.82681
Generation 2950: Loss = 0.88289
Generation 3000: Loss = 0.94536
 --- Test Accuracy = 71.09%.
Generation 3050: Loss = 0.76870
Generation 3100: Loss = 0.80715
Generation 3150: Loss = 0.80056
Generation 3200: Loss = 0.78387
Generation 3250: Loss = 0.59328
Generation 3300: Loss = 0.84897
Generation 3350: Loss = 0.67461
Generation 3400: Loss = 0.64628
Generation 3450: Loss = 0.64160
Generation 3500: Loss = 0.63691
 --- Test Accuracy = 70.31%.
Generation 3550: Loss = 0.63177
Generation 3600: Loss = 0.74349
Generation 3650: Loss = 0.64307
Generation 3700: Loss = 0.61021
Generation 3750: Loss = 0.64688
Generation 3800: Loss = 0.63159
Generation 3850: Loss = 0.78472
Generation 3900: Loss = 0.75076
Generation 3950: Loss = 0.53717
Generation 4000: Loss = 0.46514
 --- Test Accuracy = 65.62%.
Generation 4050: Loss = 0.68460
Generation 4100: Loss = 0.58425
Generation 4150: Loss = 0.47215
Generation 4200: Loss = 0.58976
Generation 4250: Loss = 0.64681
Generation 4300: Loss = 0.77239
Generation 4350: Loss = 0.58956
Generation 4400: Loss = 0.70569
Generation 4450: Loss = 0.66185
Generation 4500: Loss = 0.46662
 --- Test Accuracy = 76.56%.
Generation 4550: Loss = 0.49475
Generation 4600: Loss = 0.54739
Generation 4650: Loss = 0.52838
Generation 4700: Loss = 0.81228
Generation 4750: Loss = 0.49100
Generation 4800: Loss = 0.51341
Generation 4850: Loss = 0.47875
Generation 4900: Loss = 0.37848
Generation 4950: Loss = 0.52750
Generation 5000: Loss = 0.53570
 --- Test Accuracy = 63.28%.
Generation 5050: Loss = 0.63138
Generation 5100: Loss = 0.49153
Generation 5150: Loss = 0.54037
Generation 5200: Loss = 0.72630
Generation 5250: Loss = 0.44166
Generation 5300: Loss = 0.51812
Generation 5350: Loss = 0.51912
Generation 5400: Loss = 0.54622
Generation 5450: Loss = 0.41648
Generation 5500: Loss = 0.57976
 --- Test Accuracy = 71.88%.
Generation 5550: Loss = 0.55666
Generation 5600: Loss = 0.44564
Generation 5650: Loss = 0.46812
... 未完,但担心机器挂了
部分日志

相关文章: