プリンキピア

第7章畳み込みニューラルネットワーク

7.6. Convolutional Neural Networks (LeNet)7.6 畳み込みニューラルネットワーク(LeNet)

We now have all the ingredients required to assemble a fully-functional CNN. In our earlier encounter with image data, we applied a linear model with softmax regression (Section 4.4) and an MLP (Section 5.2) to pictures of clothing in the Fashion-MNIST dataset. To make such data amenable we first flattened each image from a 28×28 matrix into a fixed-length 784-dimensional vector, and thereafter processed them in fully connected layers. Now that we have a handle on convolutional layers, we can retain the spatial structure in our images. As an additional benefit of replacing fully connected layers with convolutional layers, we will enjoy more parsimonious models that require far fewer parameters.
英語のヒント
これで、十分に機能するCNNを組み立てるのに必要な材料がすべてそろった。以前に画像データを扱ったときには、Fashion-MNISTデータセットの衣類の写真に、ソフトマックス回帰による線形モデル(4.4節)とMLP(5.2節)を当てはめた。そうしたデータを扱いやすくするため、まず各画像を28×28の行列から長さが固定された784次元のベクトルに平らにし、その後、全結合層で処理した。畳み込み層を使いこなせるようになったので、画像の空間的な構造を保てる。全結合層を畳み込み層で置き換えることの追加の利点として、はるかに少ないパラメータで済む、もっと倹約的なモデルが得られる。
In this section, we will introduce LeNet, among the first published CNNs to capture wide attention for its performance on computer vision tasks. The model was introduced by (and named for) Yann LeCun, then a researcher at AT&T Bell Labs, for the purpose of recognizing handwritten digits in images (LeCun et al., 1998). This work represented the culmination of a decade of research developing the technology; LeCun’s team published the first study to successfully train CNNs via backpropagation (LeCun et al., 1989).
英語のヒント
この節では、コンピュータビジョンの課題での性能によって広く注目を集めた、最初に公表されたCNNの一つであるLeNetを紹介する。このモデルは、画像の中の手書き数字を認識するために、当時AT&Tベル研究所の研究者だったYann LeCunが導入した(そしてその名にちなむ)ものである(LeCun et al., 1998)。この研究は、この技術を開発した10年にわたる研究の集大成だった。LeCunのチームは、逆伝播によってCNNをうまく訓練した最初の研究を発表していた(LeCun et al., 1989)。
At the time LeNet achieved outstanding results matching the performance of support vector machines, then a dominant approach in supervised learning, achieving an error rate of less than 1% per digit. LeNet was eventually adapted to recognize digits for processing deposits in ATM machines. To this day, some ATMs still run the code that Yann LeCun and his colleague Leon Bottou wrote in the 1990s!
英語のヒント
当時、LeNetは、教師あり学習で支配的な手法だったサポートベクターマシンの性能に並ぶ傑出した結果を出し、1数字あたり1%未満の誤り率を達成した。LeNetは最終的に、ATMで預金を処理するための数字の認識に応用された。今日でも、Yann LeCunと同僚のLeon Bottouが1990年代に書いたコードを、まだ動かしているATMがある!
import torch
from torch import nn
from d2l import torch as d2l