プリンキピア

第8章現代の畳み込みニューラルネットワーク

8.1. Deep Convolutional Neural Networks (AlexNet)8.1 深い畳み込みニューラルネットワーク(AlexNet)

Although CNNs were well known in the computer vision and machine learning communities following the introduction of LeNet (LeCun et al., 1995), they did not immediately dominate the field. Although LeNet achieved good results on early small datasets, the performance and feasibility of training CNNs on larger, more realistic datasets had yet to be established. In fact, for much of the intervening time between the early 1990s and the watershed results of 2012 (Krizhevsky et al., 2012), neural networks were often surpassed by other machine learning methods, such as kernel methods (Schölkopf and Smola, 2002), ensemble methods (Freund and Schapire, 1996), and structured estimation (Taskar et al., 2004).
英語のヒント
CNNは、LeNet(LeCun et al., 1995)が紹介された後、コンピュータビジョンと機械学習のコミュニティでよく知られるようになったが、すぐにこの分野を支配したわけではなかった。LeNetは初期の小さなデータセットでよい結果を出したが、もっと大きく現実的なデータセットでCNNを訓練したときの性能と実現可能性は、まだ確立されていなかった。実際、1990年代初めから2012年の分水嶺となる結果(Krizhevsky et al., 2012)までのあいだのほとんどの期間、ニューラルネットワークは、カーネル法(Schölkopf and Smola, 2002)、アンサンブル法(Freund and Schapire, 1996)、構造化推定(Taskar et al., 2004)のような、ほかの機械学習の手法にしばしば負けていた。
For computer vision, this comparison is perhaps not entirely accurate. That is, although the inputs to convolutional networks consist of raw or lightly-processed (e.g., by centering) pixel values, practitioners would never feed raw pixels into traditional models. Instead, typical computer vision pipelines consisted of manually engineering feature extraction pipelines, such as SIFT (Lowe, 2004), SURF (Bay et al., 2006), and bags of visual words (Sivic and Zisserman, 2003). Rather than learning the features, the features were crafted. Most of the progress came from having more clever ideas for feature extraction on the one hand and deep insight into geometry (Hartley and Zisserman, 2000) on the other. The learning algorithm was often considered an afterthought.
英語のヒント
コンピュータビジョンについては、この比較はおそらく完全には正確でない。つまり、畳み込みネットワークへの入力は、生の、あるいは(たとえば中心化によって)軽く処理された画素値からなるが、実践者が伝統的なモデルに生の画素を入れることは決してなかった。その代わり、典型的なコンピュータビジョンのパイプラインは、SIFT(Lowe, 2004)、SURF(Bay et al., 2006)、視覚的単語のバッグ(Sivic and Zisserman, 2003)のような、特徴抽出のパイプラインを手作業で作り込むことからなっていた。特徴量は学習されるのではなく、手作りされていた。進歩のほとんどは、一方では特徴抽出のためのもっと賢い着想を得ることから、他方では幾何学への深い洞察(Hartley and Zisserman, 2000)からもたらされた。学習アルゴリズムは、しばしば付け足しとみなされていた。
Although some neural network accelerators were available in the 1990s, they were not yet sufficiently powerful to make deep multichannel, multilayer CNNs with a large number of parameters. For instance, NVIDIA’s GeForce 256 from 1999 was able to process at most 480 million floating-point operations, such as additions and multiplications, per second (MFLOPS), without any meaningful programming framework for operations beyond games. Today’s accelerators are able to perform in excess of 1000 TFLOPs per device. Moreover, datasets were still relatively small: OCR on 60,000 low-resolution 28×28 pixel images was considered a highly challenging task. Added to these obstacles, key tricks for training neural networks including parameter initialization heuristics (Glorot and Bengio, 2010), clever variants of stochastic gradient descent (Kingma and Ba, 2014), non-squashing activation functions (Nair and Hinton, 2010), and effective regularization techniques (Srivastava et al., 2014) were still missing.
英語のヒント
1990年代にもニューラルネットワークの加速器はいくつかあったが、パラメータの数が多い、深い多チャネル・多層のCNNを作れるほど強力ではまだなかった。たとえば、1999年のNVIDIAのGeForce 256は、足し算や掛け算のような浮動小数点演算を1秒あたり最大で4億8000万回(MFLOPS)処理できたが、ゲーム以外の演算のための意味のあるプログラミングのフレームワークはなかった。今日の加速器は、デバイス1台あたり1000 TFLOPsを超える演算を行える。さらに、データセットはまだ比較的小さかった。低解像度の28×28画素の画像6万枚でのOCRが、とても難しい課題とみなされていた。こうした障害に加えて、ニューラルネットワークを訓練するための鍵となる技、たとえばパラメータの初期化の経験則(Glorot and Bengio, 2010)、確率的勾配降下法の巧みな変種(Kingma and Ba, 2014)、押しつぶさない活性化関数(Nair and Hinton, 2010)、効果的な正則化の手法(Srivastava et al., 2014)は、まだなかった。
Thus, rather than training end-to-end (pixel to classification) systems, classical pipelines looked more like this:
英語のヒント
そのため、(画素から分類までの)エンドツーエンドのシステムを訓練するのではなく、古典的なパイプラインはむしろ次のようなものだった。
  1. Obtain an interesting dataset. In the early days, these datasets required expensive sensors. For instance, the Apple QuickTake 100 of 1994 sported a whopping 0.3 megapixel (VGA) resolution, capable of storing up to 8 images, all for the price of $1000.
    英語のヒント
    おもしろいデータセットを手に入れる。初期には、こうしたデータセットには高価なセンサーが必要だった。たとえば、1994年のApple QuickTake 100は、なんと0.3メガピクセル(VGA)の解像度を誇り、最大8枚の画像を保存でき、それでいて価格は1000ドルだった。
  2. Preprocess the dataset with hand-crafted features based on some knowledge of optics, geometry, other analytic tools, and occasionally on the serendipitous discoveries by lucky graduate students.
    英語のヒント
    光学、幾何学、そのほかの解析的な道具についての何らかの知識や、ときには幸運な大学院生の思いがけない発見にもとづいて、手作りの特徴量でデータセットを前処理する。
  3. Feed the data through a standard set of feature extractors such as the SIFT (scale-invariant feature transform) (Lowe, 2004), the SURF (speeded up robust features) (Bay et al., 2006), or any number of other hand-tuned pipelines. OpenCV still provides SIFT extractors to this day!
    英語のヒント
    SIFT(スケール不変特徴変換)(Lowe, 2004)、SURF(高速化したロバストな特徴量)(Bay et al., 2006)、あるいはほかのいくつもの手で調整したパイプラインのような、標準的な特徴抽出器の一式にデータを通す。OpenCVは今日でもまだSIFTの抽出器を提供している!
  4. Dump the resulting representations into your favorite classifier, likely a linear model or kernel method, to train a classifier.
    英語のヒント
    得られた表現を、お気に入りの分類器、おそらくは線形モデルかカーネル法に放り込んで、分類器を訓練する。
If you spoke to machine learning researchers, they would reply that machine learning was both important and beautiful. Elegant theories proved the properties of various classifiers (Boucheron et al., 2005) and convex optimization (Boyd and Vandenberghe, 2004) had become the mainstay for obtaining them. The field of machine learning was thriving, rigorous, and eminently useful. However, if you spoke to a computer vision researcher, you would hear a very different story. The dirty truth of image recognition, they would tell you, is that features, geometry (Hartley and Zisserman, 2000, Hartley and Kahl, 2009), and engineering, rather than novel learning algorithms, drove progress. Computer vision researchers justifiably believed that a slightly bigger or cleaner dataset or a slightly improved feature-extraction pipeline mattered far more to the final accuracy than any learning algorithm.
英語のヒント
機械学習の研究者に話を聞けば、機械学習は重要でもあり美しくもあると答えただろう。洗練された理論がさまざまな分類器の性質を証明し(Boucheron et al., 2005)、凸最適化(Boyd and Vandenberghe, 2004)がそれらを求める柱になっていた。機械学習の分野は栄えており、厳密で、きわめて役に立っていた。しかし、コンピュータビジョンの研究者に話を聞けば、まったく違う話を耳にしただろう。彼らに言わせれば、画像認識の汚い真実は、進歩を推し進めたのは新しい学習アルゴリズムではなく、特徴量、幾何学(Hartley and Zisserman, 2000、Hartley and Kahl, 2009)、そして工学だということである。コンピュータビジョンの研究者は、少しだけ大きい、あるいはきれいなデータセットや、少しだけ改良した特徴抽出のパイプラインのほうが、どんな学習アルゴリズムよりも最終的な正解率にはるかに大きく効くと信じていたが、それにはもっともな理由があった。
import torch
from torch import nn
from d2l import torch as d2l