もくじIndex

イメージでわかる たたみこみ

Visual Convolution for Beginners

Visual Convolution for Beginners

シリーズ: イメージでわかる

画像の上を小さな窓でなぞりながら特徴を見つける、畳み込みのしくみを虫眼鏡のたとえで説明するページです。

A magnifying-glass style explanation of convolution — how small filters scan an image to detect patterns.

1. たたみこみってなに?

1. What Is Convolution?

画像の上を「小さな窓(フィルタ)」でなぞりながら、特徴を見つける方法です。

A method for scanning an image with a "small window (filter)" to find features.

写真を見て「ここに線がある」「ここに角がある」と見分けるのは、人間の目なら自然にできます。でもコンピュータには最初からその力がありません。

Humans can naturally spot lines and edges in a photo. But computers don't have that ability built in.

そこで、小さな「虫眼鏡」のような窓を画像の上で1マスずつずらしながら、「この部分に特徴はあるか?」を数値で調べていきます。これが畳み込み(convolution)です。

So we slide a small "magnifying glass" across the image, one square at a time, numerically checking "Is there a feature here?" That's convolution.

🔍 たとえ話: 🔍 Analogy: 大きな地図の上を虫眼鏡で端から端までなぞって、「ここに山のマークがある!」「ここに川がある!」と1つずつチェックしていくのとそっくりです。 It's like moving a magnifying glass across a large map from corner to corner, checking one spot at a time: "Here's a mountain symbol!" "Here's a river!"

2. 見てみよう — フィルタが動く様子

2. Let's See It — A Filter in Action

0
0
1
0
0
0
1
1
0
0
0
0
1
1
0
0
1
0
0
1
0
0
0
1
0
画像(5×5)
Image (5×5)
×
1
0
-1
1
0
-1
1
0
-1
フィルタ(3×3)
Filter (3×3)
1
0
-1
-1
0
1
0
-1
1
出力(特徴マップ)
Output (Feature Map)

黄色のハイライト部分が「虫眼鏡が当たっている場所」。フィルタの数値と画像の数値をかけて足すと、1つの出力値になる。虫眼鏡を1マスずらすごとに、出力が1つ増えていく。

The yellow-highlighted area is "where the magnifying glass is." Multiply the filter values by the image values, add them up, and you get one output value. Slide one square over, and you get the next output.

3. フィルタって何をしているの?

3. What Does a Filter Do?

フィルタの数値パターンが、「どんな特徴を探すか」を決めています。

The pattern of numbers in the filter determines what kind of feature it looks for.

• 「タテ線」を見つけるフィルタ
• 「ヨコ線」を見つけるフィルタ
• 「角」を見つけるフィルタ
学習によって、AI は自分で「どんなフィルタが必要か」を見つけ出します。

• A filter that finds vertical lines
• A filter that finds horizontal lines
• A filter that finds corners
Through training, the AI figures out what filters it needs on its own.

💡 MIOpen との接点: 💡 Connection to MIOpen: MIOpen は、この「フィルタをずらす計算」をどうやったらいちばん速くできるかを考える専門ライブラリです。やり方(solver)を何十種類も持っていて、GPU の能力に応じて最適なものを選びます。 MIOpen is a library dedicated to figuring out the fastest way to perform this "slide-the-filter" computation. It has dozens of methods (solvers) and picks the best one based on GPU capabilities.

4. ROCm では畳み込みをどう見る?

4. How Does ROCm Look at Convolution?

ROCm では、畳み込みは「MIOpen に、どの解き方が速いか相談する仕事」として現れます。

In ROCm, convolution appears as "a job where MIOpen decides which solving method is fastest."

同じ「3×3 フィルタをずらす」計算でも、画像サイズ、データ型、メモリの並べ方、GPU 世代によって速い方法が変わります。だから MIOpen は「畳み込みかどうか」だけでなく、「どんな畳み込みか」を細かく見て solver を選びます。

Even for the same "slide a 3×3 filter" idea, the fastest method changes with image size, data type, memory layout, and GPU generation. So MIOpen looks not just at whether it is convolution, but at what kind of convolution it is, in detail.

この研究で gfx900 を調べる意味もここにあります。式の意味は同じでも、ROCm が使える solver の種類が変わると、速さや対応状況が変わるからです。

This is also why gfx900 matters in the research. The mathematical meaning may stay the same, but if the set of usable solvers changes, the speed and support picture also changes.

ROCm 目線では、畳み込みは 1 つの式というより、「画像サイズ・フィルタサイズ・精度・GPU 世代で分岐する仕事」です。 From a ROCm point of view, convolution is not just one formula. It is a job that branches depending on image size, filter size, precision, and GPU generation.