🔍 卷积神经网络:找图案的放大镜小队🔍 CNN: a Squad of Magnifying Glasses
上一片里,多层感知机给每个输入都接了线。可一整张照片有几百万像素,挨个连,线多到数不清。今天的放大镜小队有办法。Last leaf, the multilayer perceptron wired every input to every neuron. But a photo holds millions of pixels — wiring them all would take more lines than anyone can count. Today's squad of magnifying glasses has a trick.
第 1 步:小窗口,扫遍整张图Step 1: One small window, sweeping the whole picture
办法就是别看全图,只盯一小块。The trick: never look at all of it — stare at one small patch.
小机器人举着 3×3 的放大镜窗,从左上角一格一格滑。窗口停在哪,就只检查那一小块。看到一条边,就记下“这里可能有边缘”。这个滑动的小窗,工程里叫卷积核(filter)。同一扇窗滑遍全图,连角落都不放过。The little robot holds a 3×3 magnifier window and slides it cell by cell from the top-left. Wherever it stops, it checks just that patch. When it spots an edge, it notes "edge here". This sliding window is called a filter. One window sweeps the whole picture — not even corners escape.
光知道哪里有边缘,又能拼出什么?So it knows where the edges are — what can that ever add up to?
第 2 步:从边缘到零件,再到猫Step 2: From edges to parts to a cat
第一层的窗口只认短线:斜线、横线、弧线。第二层把短线拼起来。两条弧线凑成眼睛,三角加弧线凑成耳朵。更高的层继续拼:眼睛+耳朵+胡须=猫脸。谁都没独自认出猫,是小发现一层层叠出来的。Layer one's windows spot only short strokes: slants, bars, arcs. Layer two snaps strokes together: two arcs become an eye, a triangle plus an arc becomes an ear. Higher layers keep combining: eyes + ears + whiskers = a cat face. No single window recognizes the cat — small findings stack up, layer by layer.
这支小队在工程上怎么排队?How does this squad line up in engineering?
第 3 步:卷积层+池化层,交替站岗Step 3: Conv layers and pool layers, taking shifts
卷积层(Convolution)=滑动检查。一队小窗口扫全图,记下发现的图案。池化层(Pooling)=浓缩要点。把一小片里最强的信号留下,图变小,重点不丢。扫图→浓缩→再扫图→再浓缩。最后全连接层(Fully Connected)把要点汇总投票,喊出答案:“猫”。A conv layer (convolution) slides and checks: a squad of windows sweeps the image, recording patterns it finds. A pool layer (pooling) concentrates: keep the strongest signal in each patch — the map shrinks, the point survives. Sweep → shrink → sweep → shrink. Finally a fully connected layer tallies the clues and shouts the answer: "cat".
🎮 你来扫图(30 秒)🎮 Your turn: sweep the picture (30 seconds)
讲完了。拖起 3×3 小窗口,把叶子边缘的 3 个特征点全扫出来;也可以点“自动扫图”看一遍示范。Theory done. Drag the 3×3 window and sweep out all 3 feature points on the leaf's edges — or hit "Auto sweep" and watch it done for you.
一句话记住它:CNN = 一扇小窗口滑遍全图:卷积层扫图案、池化层浓缩要点、全连接层投票出答案。Remember it in one line: CNN = one small window sweeping the whole picture: conv layers detect patterns, pool layers concentrate, a fully connected layer votes out the answer.
卷积(Convolution):小窗口滑动检查,一个窗口扫全图,参数少、位置无关Convolution: one small window slides and checks everywhere — few parameters, position doesn't matter层层拼装:边缘→零件→整体;层越深,看得越完整Layer by layer: edges → parts → whole; the deeper it goes, the more complete the picture池化浓缩、全连接汇总投票——图片再大也算得动Pooling concentrates, fully connected layers vote — that's how huge images become computable
内容参考 OpenStax 等公开教材,多来源核对 · AI 生成、人工审核 · 发现错误欢迎指正,帮这片叶子长得更好。Based on OpenStax and other open textbooks, cross-checked across sources · AI-generated, human-reviewed · Spotted a mistake? Tell us — help this leaf grow.