Convolution & CNNsKonvolusi & CNN
A convolutional network sees an image by sliding tiny filters across it, each one lighting up where it finds the pattern it likes — an edge, a corner, a blob. Here you build filters by hand, watch convolution turn into simple multiplication in frequency space, and then let a network discover its own filters from scratch. You only need the idea of a weighted sum.
Jaringan konvolusi melihat sebuah citra dengan menggeser filter kecil ke seluruh permukaannya, masing-masing menyala di tempat ia menemukan pola yang disukainya — tepi, sudut, gumpalan. Di sini kamu membangun filter dengan tangan, menyaksikan konvolusi berubah jadi perkalian sederhana di ruang frekuensi, lalu membiarkan jaringan menemukan filternya sendiri dari nol. Kamu hanya butuh ide penjumlahan berbobot.
Deep learning · pairs withDeep learning · cocok dengan Fourier (a filter is a frequency selector) and the(filter adalah pemilih frekuensi) dan playground neural-net-from-scratchneural-net-dari-nol playground.itu.
Take a 3×3 grid of weights. Slide it over the image; at every position, multiply the nine weights by the nine pixels underneath and add them up. That single number is the feature map value there. Different weights detect different things — a blur, an edge, a corner — all from the same slide-multiply-add.
Ambil grid bobot 3×3. Geser ke seluruh citra; di tiap posisi, kalikan sembilan bobot dengan sembilan piksel di bawahnya lalu jumlahkan. Angka tunggal itulah nilai feature map di sana. Bobot berbeda mendeteksi hal berbeda — blur, tepi, sudut — semua dari geser-kali-jumlah yang sama.
Or draw on the left image with your mouse.
Atau gambar pada citra kiri dengan mouse-mu.
Edit any weight — the feature map updates live. Presets just fill these nine numbers.
Sunting bobot mana pun — feature map diperbarui langsung. Praatur hanya mengisi sembilan angka ini.
Hover a cell in the feature map: the matching 3×3 patch lights up on the input, and the box above shows the exact nine-term weighted sum that produced it. That is all a convolution layer does — this, millions of times.
Arahkan mouse ke sebuah sel di feature map: patch 3×3 yang cocok menyala di masukan, dan kotak di atas menampilkan penjumlahan berbobot sembilan-suku yang menghasilkannya. Itulah seluruh yang dilakukan lapisan konvolusi — ini, jutaan kali.
Convolution feels like a lot of sliding and adding. But move to frequency space (a 2D Fourier transform) and it collapses to a single rule: multiply the image's spectrum by the filter's spectrum. A blur is a filter that keeps only low frequencies; an edge filter keeps only high ones. Same lesson as the Fourier page, now in 2D.
Konvolusi terasa seperti banyak geser dan tambah. Tapi pindah ke ruang frekuensi (transformasi Fourier 2D) dan ia mengerut jadi satu aturan: kalikan spektrum citra dengan spektrum filter. Blur adalah filter yang hanya menyimpan frekuensi rendah; filter tepi hanya menyimpan yang tinggi. Pelajaran yang sama seperti halaman Fourier, kini dalam 2D.
Or draw on the input image.
Atau gambar pada citra masukan.
The spectra below are the 2D Fourier transforms: centre = low frequency, edges = high frequency, brighter = more energy.
Spektrum di bawah adalah transformasi Fourier 2D: pusat = frekuensi rendah, tepi = frekuensi tinggi, makin terang = makin banyak energi.
A blur's response is bright in the middle (keeps low frequencies, kills the fine detail); an edge filter's is bright at the rim (keeps the fast changes, drops the flat regions). This is exactly the Fourier page in two dimensions — see the Fourier bridge → for the 1D story.
Respons blur terang di tengah (menyimpan frekuensi rendah, membunuh detail halus); respons filter tepi terang di pinggir (menyimpan perubahan cepat, membuang wilayah rata). Ini persis halaman Fourier dalam dua dimensi — lihat jembatan Fourier → untuk kisah 1D-nya.
So far you chose the filters. A convolutional network learns them. Here a tiny CNN is shown random images of a single stroke — sometimes vertical, sometimes horizontal — and must say which. It starts with random filters and, purely from being right or wrong, sculpts them into edge detectors. Watch the filters below turn from noise into structure.
Sejauh ini kamu yang memilih filter. Jaringan konvolusi mempelajarinya. Di sini sebuah CNN kecil diperlihatkan citra acak berisi satu goresan — kadang vertikal, kadang horizontal — dan harus menebak yang mana. Ia mulai dengan filter acak dan, murni dari benar-atau-salah, memahatnya jadi detektor tepi. Lihat filter di bawah berubah dari derau jadi struktur.
Each image has one bright stroke plus noise. Class: is it vertical or horizontal? The net: 4 learnable 3×3 filters → ReLU → average-pool → a 2-way decision.
Tiap citra punya satu goresan terang plus derau. Kelas: vertikal atau horizontal? Jaringannya: 4 filter 3×3 yang dapat dilatih → ReLU → average-pool → keputusan 2-arah.
Every step draws a fresh batch of random strokes, predicts, and nudges the filters by gradient descent — exactly the loop from the neural-net playground, now over images.
Tiap langkah menggambar satu batch goresan acak baru, memprediksi, dan menyenggol filter dengan gradient descent — persis loop dari playground neural-net, kini atas citra.
Warm = positive weight, cool = negative. A good vertical-edge filter ends up with one bright column beside one dark column — the same Sobel shape you built by hand in tab 1, but discovered, not designed.
Hangat = bobot positif, sejuk = negatif. Filter tepi-vertikal yang baik berakhir dengan satu kolom terang di samping satu kolom gelap — bentuk Sobel yang sama yang kamu bangun sendiri di tab 1, tapi ditemukan, bukan dirancang.
This is the whole idea of deep learning for vision: don't hand-engineer features, learn them. Stack more of these layers and the filters in later layers combine edges into corners, corners into textures, textures into object parts — a hierarchy nobody wrote down. Real CNNs (for photos, medical scans, self-driving) are this exact mechanism, just wider, deeper, and trained on millions of images.
Inilah keseluruhan ide deep learning untuk penglihatan: jangan rekayasa fitur dengan tangan, pelajari. Tumpuk lebih banyak lapisan ini dan filter di lapisan berikutnya menggabungkan tepi jadi sudut, sudut jadi tekstur, tekstur jadi bagian objek — hierarki yang tak ditulis siapa pun. CNN sungguhan (untuk foto, pindai medis, mobil swakemudi) adalah mekanisme persis ini, hanya lebih lebar, lebih dalam, dan dilatih pada jutaan citra.
The catch: that power needs data and compute, and the learned filters are only as unbiased as the training set. This toy learns two clean classes in seconds; ImageNet-scale vision took years of GPUs.
Tangkapannya: kekuatan itu butuh data dan komputasi, dan filter terpelajar hanya senetral set pelatihannya. Mainan ini mempelajari dua kelas bersih dalam hitungan detik; penglihatan skala-ImageNet butuh bertahun-tahun GPU.
| In spaceDi ruang | In frequencyDi frekuensi | In a CNNDi CNN | |
|---|---|---|---|
| What a filter isApa itu filter | A 3×3 grid of weights you slide and dot-productGrid bobot 3×3 yang digeser dan di-dot-product | A mask that scales each frequencyTopeng yang menskala tiap frekuensi | Nine numbers the network learns by gradient descentSembilan angka yang dipelajari jaringan lewat gradient descent |
| Blur | Average of neighboursRata-rata tetangga | Keep low frequencies (low-pass)Simpan frekuensi rendah (low-pass) | Rarely learned — it throws away detailJarang dipelajari — ia membuang detail |
| EdgeTepi | Neighbour minus neighbourTetangga dikurangi tetangga | Keep high frequencies (high-pass)Simpan frekuensi tinggi (high-pass) | The first thing early layers learnHal pertama yang dipelajari lapisan awal |
| CostOngkos | One dot product per output pixelSatu dot product per piksel keluaran | One multiply per frequency (via FFT)Satu perkalian per frekuensi (lewat FFT) | Filters shared across the whole image — few weights, huge reachFilter dibagi ke seluruh citra — sedikit bobot, jangkauan besar |
The same operation, seen three ways. The Fourier view explains why filters do what they do; the CNN view explains where the filters come from.
Operasi yang sama, dilihat dari tiga sisi. Sudut Fourier menjelaskan kenapa filter melakukan yang dilakukannya; sudut CNN menjelaskan dari mana filter itu berasal.
← Fourier. A filter is a frequency selector; convolution in space is multiplication in frequency. The Fourier bridge is the 1D version of tab 2.
← Fourier. Filter adalah pemilih frekuensi; konvolusi di ruang adalah perkalian di frekuensi. Jembatan Fourier adalah versi 1D dari tab 2.
← Neural net from scratch. Tab 3 is the same gradient-descent training loop as the MLP playground, but the weights are shared filters slid over an image instead of a dense layer.
← Neural net dari nol. Tab 3 adalah loop pelatihan gradient-descent yang sama seperti playground MLP, tapi bobotnya adalah filter bersama yang digeser di atas citra alih-alih lapisan dense.
→ What comes next. Pooling, stacking layers into a deep hierarchy, and — the modern successor for many tasks — attention, where a token learns which other tokens to look at instead of using a fixed local window.
→ Apa selanjutnya. Pooling, menumpuk lapisan jadi hierarki dalam, dan — penerus modern untuk banyak tugas — attention, di mana sebuah token mempelajari token lain mana yang harus dilihat alih-alih memakai jendela lokal tetap.