Majid Al-RaimiPooling and what CNN filters learnالتجميع (Pooling) وما تتعلمه مرشحات CNN

COE 592Lecture 02المحاضرة 02Part 04الجزء 04

Pooling and what CNN filters learnالتجميع (Pooling) وما تتعلمه مرشحات CNN

Parameter-free downsampling with max and average pooling, the feature hierarchy a CNN learns, and two interactive demos.تقليل الأبعاد بدون معاملات عبر التجميع الأقصى (max) والمتوسط (average)، والتسلسل الهرمي للسمات الذي تتعلمه شبكة CNN، وعرضان تفاعليان.

Conceptsالمفاهيم
4
Slidesالشرائح
21-26
Readingمدة القراءة
24 min24 دقيقة
Understoodما فهمته
0/4 conceptsمفاهيم

Why this part mattersلماذا يهمّ هذا الجزء

Pooling is the cheapest layer you will ever deploy: zero parameters, four times fewer activations, and it is therefore the first tool for fitting a CNN into microcontroller SRAM. The feature hierarchy that follows it explains why pruning, quantization and transfer learning treat early and late layers differently.

The two skills this part drills are pure counting: the output shape of a pooling layer and the parameter count of a convolution layer. That same counting is the first step of every embedded model budget, because parameters set flash and activation shapes set SRAM. The two browser demos at the end give you the numbers layer by layer so you can check yourself.

الـ pooling هو أرخص طبقة ستنشرها على الإطلاق: صفر معاملات، وعدد activations أقل بأربع مرات، ولذلك فهو الأداة الأولى لإدخال شبكة CNN في ذاكرة SRAM الخاصة بالمتحكم الدقيق. والتسلسل الهرمي للخصائص الذي يأتي بعده يشرح لماذا تتعامل تقنيات pruning وquantization وtransfer learning مع الطبقات الأولى والأخيرة بطرق مختلفة.

المهارتان اللتان يدرّبك عليهما هذا الجزء عدٌّ خالص: شكل مخرج طبقة pooling، وعدد معاملات طبقة convolution. وهذا العدّ نفسه هو الخطوة الأولى في كل ميزانية لنموذج مدمج، لأن المعاملات تحدد ذاكرة flash وأشكال الـ activations تحدد ذاكرة SRAM. والعرضان التفاعليان في المتصفح في نهاية الجزء يعطيانك الأرقام طبقةً طبقة لتتحقق من نفسك.

By the end you canفي نهاية هذا الجزء ستستطيع

  1. Compute the output shape of any pooling layer from W1, H1, C, F and S, and state why its parameter count is zero.احسب شكل مخرج أي طبقة pooling انطلاقًا من W1 وH1 وC وF وS، واذكر لماذا يساوي عدد معاملاتها صفرًا.
  2. Evaluate max and average pooling by hand on a small slice and explain the small translation invariance max pooling brings.طبّق max pooling وaverage pooling يدويًا على شريحة صغيرة، واشرح الثبات التقريبي أمام الإزاحات الصغيرة (translation invariance) الذي يضيفه max pooling.
  3. Describe the edges, parts, objects feature hierarchy and tie it to receptive-field growth through CONV-RELU-POOL blocks.صِف تسلسل الخصائص الهرمي: حواف ثم أجزاء ثم أجسام كاملة، واربطه بنمو الحقل الاستقبالي (receptive field) عبر كتل CONV-RELU-POOL.
  4. Count the parameters of a conv layer from its filter shape, including biases, as in the ConvNetJS first layer.احسب عدد معاملات طبقة conv من شكل الـ filter مع إضافة الـ biases، كما في الطبقة الأولى من ConvNetJS.
  5. Chain shapes through a real small network (CNN Explainer) and separate the layers that cost parameters from those that cost only activations.تتبّع الأشكال عبر شبكة صغيرة حقيقية (CNN Explainer)، وافصل بين الطبقات التي تكلّف معاملات والطبقات التي لا تكلّف إلا activations.

A VGG-style block hands the next layer a volume of 224 x 224 x 64, which is 3,211,264 activations. A 2 x 2 pool with stride 2 returns 112 x 112 x 64, which is 802,816. Nothing was learned, nothing was mixed across channels, and every one of the 64 maps was simply shrunk on its own. That is the whole job of a Pooling layer.

تسلّم كتلة على نمط VGG الطبقة التالية حجمًا قدره 224 x 224 x 64، أي 3,211,264 قيمة activation. وطبقة pool بنافذة 2 x 2 وخطوة 2 تُرجع 112 x 112 x 64، أي 802,816. لم يُتعلَّم شيء، ولم يُمزج شيء عبر القنوات، وكل خريطة من الخرائط الـ 64 صُغّرت ببساطة وحدها. هذه هي وظيفة pooling layer كاملة.

The rule behind the example: a pooling layer applies a fixed summary over a small window of each activation map, one map at a time. Two summaries are common. Max pooling keeps the largest value in the window, and Average pooling keeps the mean. Because the summary is computed inside one Channel and never across channels, the depth of the volume is preserved while the spatial size falls. Pooling is therefore the second Downsampling tool of this lecture, next to Stride, and its output is a smaller Feature map per channel.

القاعدة وراء المثال: طبقة الـ pooling تطبّق تلخيصًا ثابتًا على نافذة صغيرة من كل خريطة activation، خريطةً واحدة في كل مرة. وهناك تلخيصان شائعان: max pooling يحتفظ بأكبر قيمة في النافذة، وaverage pooling يحتفظ بالمتوسط. ولأن التلخيص يُحسب داخل channel واحدة ولا يُحسب أبدًا عبر القنوات، يبقى عمق الحجم محفوظًا بينما يصغر حجمه المكاني. لذلك فالـ pooling هو الأداة الثانية للـ downsampling في هذه المحاضرة إلى جانب stride، ومخرجه feature map أصغر لكل قناة.

A 2x2 window sweeps one map of the 224x224x64 volume; the pooled volume is a quarter of the area with the same 64-deep edgeنافذة 2x2 تمسح خريطة واحدة من الحجم 224x224x64؛ والحجم بعد الـ pooling مساحته ربع المساحة الأصلية مع العمق نفسه 64

Slide 21 pinned as shapesالشريحة 21 مثبّتة على شكل أبعاد

Inputالمدخل
224 x 224 x 64224 x 224 x 64
Spatial extent F, stride Sالامتداد المكاني F، والخطوة S
2, 22, 2
Outputالمخرج
112 x 112 x 64112 x 112 x 64
Channelsالقنوات
Unchanged, 64 in and 64 outدون تغيير، 64 تدخل و64 تخرج
Activationsالـ activations
3,211,264 to 802,816 (75% discarded)من 3,211,264 إلى 802,816 (يُستبعد 75%)
Learned parametersالمعاملات المتعلَّمة
00

Why max pooling is the default, and why that is a heuristicلماذا يُعدّ max pooling الخيار الافتراضي، ولماذا هذه قاعدة تجريبية

Pooling of any kind brings an approximate translation invariance, and max pooling shows it most sharply, which is why slide 21 attaches "Introduces spatial invariance" to max pooling. Goodfellow, Bengio and Courville describe pooling in all its forms as making the representation "approximately invariant to small translations of the input": if the input shifts by a pixel, the values of most pooled outputs do not change, because the maximum is still inside its window. Their example is face detection, where the network need not know the location of the eyes with pixel-perfect accuracy, only that there is an eye on each side. They also point out that pooling regions spaced k pixels apart give the next layer roughly k times fewer inputs to process, which is the memory saving your microcontroller will feel.

أي نوع من الـ pooling يضيف ثباتًا تقريبيًا أمام الإزاحة (translation invariance)، وmax pooling يُظهره بأوضح صورة، ولهذا تربط الشريحة 21 عبارة «Introduces spatial invariance» بالـ max pooling. يصف Goodfellow وBengio وCourville الـ pooling بجميع أشكاله بأنه يجعل التمثيل «approximately invariant to small translations of the input»، أي ثابتًا تقريبًا أمام الإزاحات الصغيرة للمدخل: إذا انزاح المدخل بكسلًا واحدًا، فإن قيم معظم مخرجات الـ pooling لا تتغير، لأن القيمة العظمى ما زالت داخل نافذتها. ومثالهم هو كشف الوجوه، حيث لا تحتاج الشبكة إلى معرفة موضع العينين بدقة البكسل، بل يكفيها أن تعرف أن هناك عينًا في كل جانب. ويشيرون أيضًا إلى أن مناطق pooling تفصل بينها k بكسلات تعطي الطبقة التالية مدخلات أقل بنحو k مرة لتعالجها، وهذا هو التوفير في الذاكرة الذي سيشعر به المتحكم الدقيق لديك.

Max poolingMax poolingAverage poolingAverage pooling
What it returnsما يُرجعهThe largest value in the windowأكبر قيمة في النافذةThe mean of all values in the windowمتوسط كل القيم في النافذة
What it is sensitive toما يتأثر بهOne strong activation anywhere in the windowactivation واحدة قوية في أي مكان داخل النافذةEvery value equally, so a strong spike is dilutedكل قيمة بالتساوي، فتُخفَّف القمة القوية
Effect of a one-cell shiftأثر إزاحة بمقدار خلية واحدةUsually none, if the maximum stays inside the windowعادةً لا أثر، إذا بقيت القيمة العظمى داخل النافذةSmall change, the average moves slightlyتغيّر صغير، إذ يتحرك المتوسط قليلًا
Gradient in the backward passالـ gradient في الـ backward passRouted to the argmax cell onlyيُوجَّه إلى خلية الـ argmax فقطSpread equally, 1/F² to every cellيُوزَّع بالتساوي، 1/F² لكل خلية
Typical place in a networkموضعه المعتاد في الشبكةInside the trunk after a conv blockداخل الجذع (trunk) بعد كتلة convGlobal average pooling as the classifier headglobal average pooling كرأس للتصنيف
Max pooling against average poolingmax pooling مقابل average pooling

Slide 21 goes further and says max pooling "performs a lot better" because it discards noisy activations. Treat that as the slide's heuristic, not a law. Boureau, Ponce and LeCun analysed the two in 2010 and found that which one wins depends on how sparse the features are and how large the pool is; they note that earlier comparisons had been "purely empirical". CS231n states more cautiously that max pooling "has been shown to work better in practice". And the field has partly moved on: Springenberg et al. showed in 2014 that max pooling "can simply be replaced by a convolutional layer with increased stride without loss in accuracy", and Lin, Chen and Yan's Network in Network replaced the fully connected head with global average pooling, which they found "less prone to overfitting". ResNet and MobileNet families follow that pattern: strided convolutions inside, a single global average pool at the end.

تذهب الشريحة 21 أبعد من ذلك وتقول إن max pooling «performs a lot better»، أي أفضل بكثير، لأنه يتخلص من الـ activations المشوَّشة. تعامل مع هذا على أنه قاعدة تجريبية من الشريحة، لا قانون. فقد حلّل Boureau وPonce وLeCun النوعين عام 2010 ووجدوا أن الفائز يعتمد على مدى تناثر (sparsity) الخصائص وعلى حجم الـ pool؛ ولاحظوا أن المقارنات السابقة كانت «purely empirical»، أي تجريبية بحتة. ويقول CS231n بحذر أكبر إن max pooling «has been shown to work better in practice»، أي ثبت أنه يعمل أفضل عمليًا. وقد تجاوز المجال ذلك جزئيًا: أظهر Springenberg et al. عام 2014 أن max pooling «can simply be replaced by a convolutional layer with increased stride without loss in accuracy»، أي يمكن ببساطة استبداله بطبقة convolution بخطوة أكبر دون خسارة في الدقة، واستبدلت ورقة Network in Network لـ Lin وChen وYan الرأس المتصل بالكامل (fully connected head) بـ global average pooling، ووجدوه «less prone to overfitting»، أي أقل عرضة للـ overfitting. وعائلتا ResNet وMobileNet تتبعان هذا النمط: strided convolutions في الداخل، وglobal average pool واحد في النهاية.

Recall

A 224x224x64 volume passes through max pooling with F = 2 and S = 2. What are the output shape and the number of learned parameters?يمرّ حجم 224x224x64 عبر max pooling مع F = 2 وS = 2. ما شكل المخرج، وما عدد المعاملات المتعلَّمة؟

112 x 112 x 64, from (224 - 2)/2 + 1 = 112 in each spatial dimension with the depth unchanged. Parameters: 0, because max is a fixed function with nothing to fit.
112 x 112 x 64، من (224 - 2)/2 + 1 = 112 في كل بُعد مكاني مع بقاء العمق دون تغيير. المعاملات: 0، لأن الـ max دالة ثابتة ليس فيها ما يُضبط.

Quick checkاختبار سريع

A 56x56x128 volume passes through max pooling with a 2x2 window and stride 2. What does it output?يمرّ حجم 56x56x128 عبر max pooling بنافذة 2x2 وخطوة 2. ما مخرجه؟

Take the single depth slice from slide 22, a 4 x 4 grid, and pool it with a 2 x 2 window and Stride 2. The window lands in four places and never overlaps itself, so the four coloured quadrants of the slide are the four windows. Each quadrant becomes one output cell.

خذ شريحة العمق الواحدة من الشريحة 22، وهي شبكة 4 x 4، وطبّق عليها pooling بنافذة 2 x 2 وstride قيمتها 2. تقع النافذة في أربعة مواضع ولا تتداخل مع نفسها أبدًا، لذا فالأرباع الأربعة الملوّنة في الشريحة هي النوافذ الأربع. وكل ربع يصبح خلية واحدة في المخرج.

WindowالنافذةValuesالقيمMaxMaxMeanMean
Top left (pink on the slide)أعلى اليسار (الوردي في الشريحة){1, 1, 5, 6}{1, 1, 5, 6}6613 / 4 = 3.2513 / 4 = 3.25
Top right (green)أعلى اليمين (الأخضر){2, 4, 7, 8}{2, 4, 7, 8}8821 / 4 = 5.2521 / 4 = 5.25
Bottom left (yellow)أسفل اليسار (الأصفر){3, 2, 1, 2}{3, 2, 1, 2}338 / 4 = 28 / 4 = 2
Bottom right (blue)أسفل اليمين (الأزرق){1, 0, 3, 4}{1, 0, 3, 4}448 / 4 = 28 / 4 = 2
Slide 22 window by windowالشريحة 22 نافذةً نافذة

Read the two results as grids. Max pooling gives [[6, 8], [3, 4]] and Average pooling gives [[3.25, 5.25], [2, 2]]. Notice what each one threw away. Max kept only the argmax cell of each window (the 6, the 8, the 3, the 4) and forgot the other three values entirely. Mean kept a trace of all four but flattened the 8 down to 5.25.

اقرأ النتيجتين كشبكتين. يعطي max pooling النتيجة [[6, 8], [3, 4]]، ويعطي average pooling النتيجة [[3.25, 5.25], [2, 2]]. لاحظ ما تخلّص منه كل واحد منهما. الـ max احتفظ فقط بخلية الـ argmax في كل نافذة (الـ 6 والـ 8 والـ 3 والـ 4) ونسي القيم الثلاث الأخرى تمامًا. أما الـ mean فاحتفظ بأثر من القيم الأربع كلها لكنه خفّض الـ 8 إلى 5.25.

Each window's largest cell lights and sends its value to the max grid; a second sweep writes the meansتضيء أكبر خلية في كل نافذة وترسل قيمتها إلى شبكة الـ max؛ ثم يكتب مسح ثانٍ المتوسطات

The general ruleالقاعدة العامة

Let the input be W1 x H1 x C. A Pooling layer needs exactly two hyperparameters, the spatial extent F of the window and the stride S, and it produces W2 x H2 x C.

ليكن المدخل W1 x H1 x C. تحتاج pooling layer إلى معاملين فائقين (hyperparameters) فقط: الامتداد المكاني للنافذة F، والخطوة S، وتُنتج W2 x H2 x C.

W2=W1−FS+1,H2=H1−FS+1,C2=C1W_2 = \frac{W_1 - F}{S} + 1, \qquad H_2 = \frac{H_1 - F}{S} + 1, \qquad C_2 = C_1
Same shape rule as a convolution with no padding, applied to every channelقاعدة الأبعاد نفسها كالتفاف بلا حشو، مطبقةً على كل قناة
parameters=0\text{parameters} = 0
Max and mean are fixed functions; there is nothing to fitالحد الأقصى والمتوسط دالتان ثابتتان؛ لا يوجد ما يُدرَّب

The shape formula is the convolution formula from part 03 with p = 0 and the kernel size renamed to F. PyTorch writes the same rule in its general form, H_out = floor((H_in + 2p - d(F - 1) - 1)/S + 1), with the stride defaulting to the kernel size, so MaxPool2d(2) means F = 2, S = 2 (PyTorch docs). The floor matters when the division is not exact, and the second worked example shows why.

صيغة الشكل هي نفسها صيغة الـ convolution من الجزء 03 مع p = 0 وتغيير اسم حجم الـ kernel إلى F. ويكتب PyTorch القاعدة نفسها بصيغتها العامة H_out = floor((H_in + 2p - d(F - 1) - 1)/S + 1)، والخطوة فيه تساوي حجم الـ kernel افتراضيًا، لذا فإن MaxPool2d(2) تعني F = 2, S = 2 (توثيق PyTorch). ويهمّ الـ floor عندما لا تكون القسمة صحيحة، والمثال المحلول الثاني يوضح السبب.

The zero comes from what pooling does in the backward pass. CS231n notes that a pooling layer "introduces zero parameters since it computes a fixed function of the input". Implementations keep the index of the maximum, the "switch", so the gradient is routed to exactly one cell per window in max pooling; in average pooling it is spread as 1/F² to each cell. Either way the layer has no Weight and no Bias, so it adds nothing to the Parameter count.

يأتي الصفر مما يفعله الـ pooling في الـ backward pass. يذكر CS231n أن طبقة الـ pooling «introduces zero parameters since it computes a fixed function of the input»، أي لا تضيف أي معاملات لأنها تحسب دالة ثابتة من المدخل. وتحتفظ التطبيقات بموضع القيمة العظمى، ويُسمّى «switch»، فيُوجَّه الـ gradient إلى خلية واحدة بالضبط في كل نافذة في max pooling؛ أما في average pooling فيُوزَّع بمقدار 1/F² على كل خلية. وفي الحالتين لا تملك الطبقة أي weight ولا أي bias، فلا تضيف شيئًا إلى عدد الـ parameters.

Worked exampleمثال محلول

224 to 112, the slide 21 numbersمن 224 إلى 112، أرقام الشريحة 21

  1. Substitute into the width formulaعوّض في صيغة العرض

    W2 = (224 - 2)/2 + 1 = 111 + 1 = 112. The height is identical.
    W2 = (224 - 2)/2 + 1 = 111 + 1 = 112. والارتفاع مطابق.
  2. Carry the depth acrossانقل العمق كما هو

    C2 = C1 = 64, because the window only ever looks inside one channel.
    C2 = C1 = 64، لأن النافذة لا تنظر أبدًا إلا داخل قناة واحدة.
  3. Count the activationsاحسب الـ activations

    Before: 224 x 224 x 64 = 3,211,264. After: 112 x 112 x 64 = 802,816. Exactly one quarter survives; CS231n phrases it as "discards exactly 75% of the activations in an input volume".
    قبل: 224 x 224 x 64 = 3,211,264. بعد: 112 x 112 x 64 = 802,816. يبقى الربع بالضبط؛ ويصوغها CS231n بعبارة «discards exactly 75% of the activations in an input volume»، أي يتخلص من 75% بالضبط من الـ activations في حجم المدخل.
  4. Resultالنتيجة

    Output 112 x 112 x 64, 0 parameters, 75% of runtime memory for that tensor gone.
    المخرج 112 x 112 x 64، و0 معاملات، وزوال 75% من ذاكرة وقت التشغيل الخاصة بذلك الـ tensor.

Worked exampleمثال محلول

Why F = 3, S = 2 needs careلماذا تحتاج F = 3, S = 2 إلى انتباه

  1. Overlapping pool on 224pool متداخل على 224

    (224 - 3)/2 + 1 = 111.5. Not an integer: the last window would hang off the edge. PyTorch floors to 111 by default and rounds up to 112 only with ceil_mode=True.
    (224 - 3)/2 + 1 = 111.5. ليس عددًا صحيحًا: النافذة الأخيرة ستتدلّى خارج الحافة. يقرّب PyTorch للأسفل إلى 111 افتراضيًا، ولا يقرّب للأعلى إلى 112 إلا مع ceil_mode=True.
  2. The AlexNet case that does divideحالة AlexNet التي تنقسم فعلًا

    AlexNet pools 55 x 55 maps with F = 3, S = 2: (55 - 3)/2 + 1 = 27, a clean integer, which is why that configuration is famous.
    يطبّق AlexNet الـ pooling على خرائط 55 x 55 مع F = 3, S = 2: (55 - 3)/2 + 1 = 27، وهو عدد صحيح تمامًا، ولهذا اشتهر هذا الإعداد.
  3. Rule of thumbقاعدة عملية

    Check that (W1 - F) divides by S. If it does not, state the floor explicitly.
    تحقّق من أن (W1 - F) يقبل القسمة على S. وإذا لم يكن كذلك، فاذكر التقريب للأسفل (floor) صراحةً.

Changing F and S on the same 4 x 4 slice shows how strongly the two hyperparameters shape the result. The values below are max pooling; the simulator lets you check the means.

تغيير F وS على شريحة 4 x 4 نفسها يُظهر مدى قوة تأثير هذين المعاملين الفائقين في النتيجة. القيم أدناه هي لـ max pooling؛ والمحاكي يتيح لك التحقق من المتوسطات.

F, SF, SW2W2OutputالمخرجValuesالقيمWhat happenedماذا حدث
F = 2, S = 2F = 2, S = 2(4 - 2)/2 + 1 = 2(4 - 2)/2 + 1 = 22 x 22 x 2[[6, 8], [3, 4]][[6, 8], [3, 4]]Windows tile the input, 75% of activations droppedالنوافذ تغطي المدخل دون تداخل، ويُستبعد 75% من الـ activations
F = 2, S = 1F = 2, S = 1(4 - 2)/1 + 1 = 3(4 - 2)/1 + 1 = 33 x 33 x 3[[6, 7, 8], [6, 7, 8], [3, 3, 4]][[6, 7, 8], [6, 7, 8], [3, 3, 4]]Windows overlap, the row 6, 7, 8 appears twiceالنوافذ متداخلة، فيظهر الصف 6، 7، 8 مرتين
F = 3, S = 1F = 3, S = 1(4 - 3)/1 + 1 = 2(4 - 3)/1 + 1 = 22 x 22 x 2[[7, 8], [7, 8]][[7, 8], [7, 8]]Nine cells per window, the small values vanishتسع خلايا في كل نافذة، فتختفي القيم الصغيرة
F = 3, S = 2F = 3, S = 2(4 - 3)/2 + 1 = 1.5(4 - 3)/2 + 1 = 1.51 x 1 (floored)1 x 1 (مقرّب للأسفل)[[7]][[7]]Not an integer, PyTorch floors and drops the last row and columnليس عددًا صحيحًا، فيقرّب PyTorch للأسفل ويُسقط الصف والعمود الأخيرين
Four configurations on the slide 22 slice, max poolingأربعة إعدادات على شريحة العمق من الشريحة 22، مع max pooling
SimulatorمحاكيSlide 22, every window at onceالشريحة 22، كل النوافذ دفعة واحدة
W2 = (4 - 2) / 2 + 1 = 2
Input 4×4×1
4 windows of 2×2
Output 2×2×1
This windowهذه النافذة
hover an output cellمرّر المؤشر فوق خلية إخراج
Input W1 × H1 × C
4 × 4 × 1
Output W2 × H2 × C
2 × 2 × 1
Learned parametersالمعاملات المتعلَّمة
0
Activations in, outالتنشيطات داخلًا وخارجًا
16 to 4 (75% discarded)من 16 إلى 4 (يُهمَل 75%)
Every input cell is editable, negative and decimal values included. Each window keeps one colour in the input and in the output; hovering an output cell brightens the winning cell for max pooling and the whole window for average pooling.كل خلية إدخال قابلة للتعديل، بما في ذلك القيم السالبة والعشرية. تحتفظ كل نافذة بلون واحد في الإدخال وفي الإخراج، وتمرير المؤشر فوق خلية إخراج يُبرز الخلية الفائزة في max pooling والنافذة كلها في average pooling.

Recall

Compute max and mean pooling with F = 2, S = 2 on [[1,1,2,4],[5,6,7,8],[3,2,1,0],[1,2,3,4]].احسب max pooling وmean pooling مع F = 2 وS = 2 على [[1,1,2,4],[5,6,7,8],[3,2,1,0],[1,2,3,4]].

Max: [[6, 8], [3, 4]]. Mean: [[3.25, 5.25], [2, 2]]. The output is 2 x 2 because (4 - 2)/2 + 1 = 2.
الـ max: [[6, 8], [3, 4]]. الـ mean: [[3.25, 5.25], [2, 2]]. المخرج 2 x 2 لأن (4 - 2)/2 + 1 = 2.

Quick checkاختبار سريع

Why does a pooling layer add nothing to a network's parameter count?لماذا لا تضيف طبقة الـ pooling شيئًا إلى عدد معاملات الشبكة؟

The grid on slide 23 comes from Lee, Grosse, Ranganath and Ng (ICML 2009), who learned a first layer of edge detectors from natural images once, then trained the second and third layers of a convolutional deep belief network separately on unlabeled Caltech-101 images of faces, cars, elephants and chairs, and visualized what each layer responds to. Their own summary: the first, second and third layers "learn edge detectors, object parts, and objects respectively". Look at the bottom row of the slide. It is the same across all four columns because that first layer was learned once from natural images: small oriented edges like Gabor patches. The middle row diverges into eyes and noses, wheels and bumpers, tusks and ears, chair legs and backs. The top row shows entire faces, cars, elephants and chairs.

الشبكة في الشريحة 23 مأخوذة من Lee وGrosse وRanganath وNg (ICML 2009)، الذين تعلّموا طبقة أولى من كاشفات الحواف من صور طبيعية مرة واحدة، ثم درّبوا الطبقتين الثانية والثالثة من convolutional deep belief network بشكل منفصل على صور غير معنونة من Caltech-101 للوجوه والسيارات والفيلة والكراسي، وعرضوا بصريًا ما تستجيب له كل طبقة. وملخّصهم هم: الطبقات الأولى والثانية والثالثة «learn edge detectors, object parts, and objects respectively»، أي تتعلم كاشفات الحواف، ثم أجزاء الأجسام، ثم الأجسام، على الترتيب. انظر إلى الصف السفلي في الشريحة. إنه متطابق في الأعمدة الأربعة لأن تلك الطبقة الأولى جرى تعلّمها مرة واحدة من صور طبيعية: حواف صغيرة موجّهة تشبه رقع Gabor. ثم يتفرّع الصف الأوسط إلى عيون وأنوف، وعجلات ومصدّات، وأنياب وآذان، وأرجل كراسٍ وظهورها. ويُظهر الصف العلوي وجوهًا وسيارات وفيلة وكراسي كاملة.

Three tiers light up bottom to top: edges, then parts, then whole objects, joined by upward arrowsتضيء ثلاث طبقات من الأسفل إلى الأعلى: حواف، ثم أجزاء، ثم أجسام كاملة، تربطها أسهم صاعدة

This ladder is the Feature hierarchy, and it is not designed by hand. Every Convolution layer runs the same operation with a small Kernel (filter). What changes with depth is the Receptive field: a first-layer unit sees only its k x k patch of pixels, so the most it can detect is an edge. A second-layer unit sees a k x k patch of first-layer responses, which covers a larger region of the image (L(k - 1) + 1 pixels after L stride-1 layers, faster with stride or pooling), so it can combine edges into a curve or an eye. Deep units cover most of the image and can match a whole face. Zeiler and Fergus confirmed in 2013 that the same ladder appears inside a supervised ImageNet CNN, using a deconvolutional visualization of intermediate layers.

هذا السلّم هو feature hierarchy، ولا يُصمَّم يدويًا. كل convolution layer تنفّذ العملية نفسها بـ kernel صغير. ما يتغير مع العمق هو receptive field: وحدة في الطبقة الأولى لا ترى إلا رقعتها k x k من البكسلات، فأقصى ما يمكنها كشفه حافة. ووحدة في الطبقة الثانية ترى رقعة k x k من استجابات الطبقة الأولى، وهذه تغطي منطقة أكبر من الصورة (L(k - 1) + 1 بكسلًا بعد L طبقات بخطوة 1، وأسرع مع الـ stride أو الـ pooling)، فتستطيع جمع الحواف في منحنى أو عين. أما الوحدات العميقة فتغطي معظم الصورة ويمكنها مطابقة وجه كامل. وقد أكّد Zeiler وFergus عام 2013 أن السلّم نفسه يظهر داخل CNN مُشرَف عليها مدرَّبة على ImageNet، باستخدام عرض بصري بالـ deconvolution للطبقات الوسيطة.

TierالمستوىLayersالطبقاتWhat the filters respond toما تستجيب له الـ filtersReceptive field, roughlyالحقل الاستقبالي تقريبًا
Low levelالمستوى المنخفضFirst convolution layersطبقات الـ convolution الأولىOriented edges, bars, blobs, colour opponentsحواف موجّهة، وقضبان، وبقع، وتضادّات لونية3 x 3 to 11 x 11 pixels (the first kernel size)من 3 x 3 إلى 11 x 11 بكسلًا (حجم الـ kernel الأول)
Mid levelالمستوى المتوسطMiddle layersالطبقات الوسطىCurves, corners, eyes, wheels, tusks, chair legsمنحنيات، وزوايا، وعيون، وعجلات، وأنياب، وأرجل كراسٍtens of pixelsعشرات البكسلات
High levelالمستوى العاليDeepest layersأعمق الطبقاتWhole faces, cars, elephants, chairsوجوه، وسيارات، وفيلة، وكراسٍ كاملةmost of the imageمعظم الصورة
The three tiersالمستويات الثلاثة

The mechanism in action: slide 24الآلية أثناء العمل: الشريحة 24

Slide 24 shows a network of the pattern [CONV, RELU, CONV, RELU, POOL] repeated three times and then a fully connected layer, run on a photo of a car. Each column is the activation maps of one layer. Read them left to right and the hierarchy appears live: the first columns look like edge-filtered copies of the car, the middle columns are sparse and blotchy, and the last columns are tiny grids that no longer resemble the photo at all.

تعرض الشريحة 24 شبكة من النمط [CONV, RELU, CONV, RELU, POOL] مكررًا ثلاث مرات ثم طبقة متصلة بالكامل (fully connected)، تعمل على صورة سيارة. كل عمود هو الـ activation maps لطبقة واحدة. اقرأها من اليسار إلى اليمين وسيظهر التسلسل الهرمي حيًّا: الأعمدة الأولى تبدو نسخًا من السيارة مرّت عبر فلتر حواف، والأعمدة الوسطى متناثرة وبقعية، والأعمدة الأخيرة شبكات صغيرة لم تعد تشبه الصورة إطلاقًا.

Block 1الكتلة 1
full sizeالحجم الكامل

Two convs with ReLU, then pool: edges and colour blobs.

طبقتا conv مع ReLU، ثم pool: حواف وبقع لونية.

pool halvespool يقسم على اثنين
Block 2الكتلة 2
half sizeنصف الحجم

Same pattern on the smaller maps: corners, wheels, parts.

النمط نفسه على الخرائط الأصغر: زوايا وعجلات وأجزاء.

pool halvespool يقسم على اثنين
Block 3الكتلة 3
quarter sizeربع الحجم

Coarse maps whose units see most of the image.

خرائط خشنة ترى وحداتها معظم الصورة.

flattenتسطيح
FC
class scoresدرجات الفئات

car, truck, airplane, ship, horse; car wins.

car وtruck وairplane وship وhorse، والفائز car.

CONV-RELU-CONV-RELU-POOL three times, then FCCONV-RELU-CONV-RELU-POOL ثلاث مرات، ثم FC

The ReLU after each conv keeps only positive responses, which is why the columns after it are darker. Each POOL halves the Feature map and, because the next block's k x k window now covers twice as many original pixels, pushes the receptive field outward. Two pools have already halved the maps twice, so the third block works on maps one quarter the width of the input, and the third pool leaves the fully connected layer maps one eighth the width; that is why the last units can see a whole car. The Fully connected layer at the end reads every unit of the final maps at once and produces one score per class. On the slide, car scores highest, well above truck, then airplane, ship and horse.

الـ ReLU بعد كل conv لا تُبقي إلا الاستجابات الموجبة، ولهذا تكون الأعمدة التي تليها أغمق. وكل POOL يقسم feature map على اثنين، ولأن نافذة k x k في الكتلة التالية تغطي الآن ضعف عدد البكسلات الأصلية، فإنه يدفع الحقل الاستقبالي إلى الخارج. وقد قسم الـ pool الأول والثاني الخرائط على اثنين مرتين، فتعمل الكتلة الثالثة على خرائط عرضها ربع عرض المدخل، ويترك الـ pool الثالث للطبقة المتصلة بالكامل خرائط عرضها ثُمن عرض المدخل؛ ولهذا تستطيع الوحدات الأخيرة رؤية سيارة كاملة. وتقرأ fully connected layer في النهاية كل وحدة من الخرائط الأخيرة دفعة واحدة وتُنتج درجة واحدة لكل فئة. وفي الشريحة تحصل car على أعلى درجة، أعلى بكثير من truck، ثم airplane وship وhorse.

A pulse runs down the 16-layer chain; chips shrink after each pool, and the FC bars grow with car reaching full widthنبضة تجري عبر سلسلة من 16 طبقة؛ تصغر الرقائق بعد كل pool، وتنمو أشرطة الـ FC حتى يبلغ شريط car العرض الكامل

Why this matters on an embedded deviceلماذا يهمّ هذا على جهاز مدمج

The hierarchy explains a pattern you will meet throughout this course. Early layers have few parameters (a 5 x 5 x 3 filter is 75 weights) but large activation maps; late layers have many parameters but tiny maps. So SRAM pressure comes from the front of the network and flash pressure from the back, and pruning or quantizing them calls for different budgets. Transfer learning on the edge uses the hierarchy directly: the edge and part detectors are generic, so you freeze the low tiers and retrain only the top.

يشرح التسلسل الهرمي نمطًا ستقابله طوال هذا المقرر. الطبقات الأولى لها معاملات قليلة (filter بحجم 5 x 5 x 3 يساوي 75 وزنًا) لكن activation maps كبيرة؛ والطبقات الأخيرة لها معاملات كثيرة لكن خرائط صغيرة جدًا. لذا يأتي الضغط على SRAM من مقدمة الشبكة، ويأتي الضغط على flash من مؤخرتها، ويحتاج الـ pruning أو الـ quantization لكل منهما إلى ميزانية مختلفة. ويستخدم الـ transfer learning على الحافة (edge) هذا التسلسل الهرمي مباشرة: كاشفات الحواف والأجزاء عامة، فتجمّد الطبقات الدنيا وتعيد تدريب العليا فقط.

Recall

Name the three tiers of the feature hierarchy with one example each, and say what property of deep layers makes the top tier possible.سمِّ المستويات الثلاثة للتسلسل الهرمي للخصائص مع مثال واحد لكل منها، واذكر ما خاصية الطبقات العميقة التي تجعل المستوى الأعلى ممكنًا.

Edges (oriented bars), object parts (eyes, wheels, tusks), whole objects (faces, cars, elephants). The receptive field grows with depth and pooling, so only deep units see enough of the image to match an object.
حواف (قضبان موجّهة)، وأجزاء أجسام (عيون، عجلات، أنياب)، وأجسام كاملة (وجوه، سيارات، فيلة). الحقل الاستقبالي يكبر مع العمق ومع الـ pooling، فلا ترى إلا الوحدات العميقة ما يكفي من الصورة لمطابقة جسم.

Quick checkاختبار سريع

In the feature hierarchy, what do the deepest convolution layers respond to?في التسلسل الهرمي للخصائص، ماذا تستجيب له أعمق طبقات الـ convolution؟

Open the ConvNetJS CIFAR-10 demo and read its first conv block. It prints "conv (32x32x16), filter size 5x5x3, stride 1, parameters: 16x5x5x3+16 = 1216". That one line is a complete exam answer, and it is worth rebuilding by hand.

افتح عرض ConvNetJS CIFAR-10 واقرأ أول كتلة conv فيه. إنه يطبع «conv (32x32x16), filter size 5x5x3, stride 1, parameters: 16x5x5x3+16 = 1216». هذا السطر الواحد إجابة امتحان كاملة، ويستحق أن تعيد بناءه يدويًا.

Worked exampleمثال محلول

The ConvNetJS first conv layerأول طبقة conv في ConvNetJS

  1. Weightsالأوزان

    16 filters, each 5 x 5 and 3 deep to match the RGB input: 16 x 5 x 5 x 3 = 1200 weights.
    16 filter، كل منها 5 x 5 وعمقه 3 ليطابق مدخل RGB: 16 x 5 x 5 x 3 = 1200 من الـ weights.
  2. Biasesالـ biases

    One Bias per filter, so 16.
    bias واحد لكل filter، أي 16.
  3. Why the map stays 32 x 32لماذا تبقى الخريطة 32 x 32

    The demo's layer definition uses pad 2: (32 + 2·2 - 5)/1 + 1 = 32. With Padding equal to (F - 1)/2, a stride-1 conv keeps its size.
    تعريف الطبقة في العرض يستخدم pad 2: (32 + 2·2 - 5)/1 + 1 = 32. فعندما يساوي الـ padding القيمة (F - 1)/2، تحافظ conv بخطوة 1 على حجمها.
  4. Resultالنتيجة

    1200 + 16 = 1216 parameters, output 32 x 32 x 16, which is 16,384 activations for one image.
    1200 + 16 = 1216 معاملًا، والمخرج 32 x 32 x 16، أي 16,384 قيمة activation لصورة واحدة.

The ConvNetJS CIFAR-10 demoعرض ConvNetJS على CIFAR-10

Datasetمجموعة البيانات
CIFAR-10: 60,000 colour images of 32 x 32, 10 classes, 50,000 train and 10,000 test (Krizhevsky)CIFAR-10: 60,000 صورة ملوّنة بحجم 32 x 32، و10 فئات، و50,000 للتدريب و10,000 للاختبار (Krizhevsky)
Classesالفئات
airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truckairplane (طائرة)، automobile (سيارة)، bird (طائر)، cat (قطة)، deer (غزال)، dog (كلب)، frog (ضفدع)، horse (حصان)، ship (سفينة)، truck (شاحنة)
Accuracy quoted on the pageالدقة المذكورة في الصفحة
state of the art "about 90%", humans "about 94%" (2014 figures; current models exceed 99%)أفضل نتيجة وقتها «نحو 90%»، والبشر «نحو 94%» (أرقام 2014؛ والنماذج الحالية تتجاوز 99%)
Augmentationزيادة البيانات (augmentation)
random flips and random shifts of up to 2 pxقلب عشوائي (flips) وإزاحات عشوائية حتى 2 px
Optimizerالمُحسِّن (optimizer)
Adadelta, batch size 4, L2 decay 0.0001Adadelta، وحجم الدفعة (batch size) 4، وL2 decay قدره 0.0001

The whole demo network is small enough to count in full. Two things to watch: every conv filter is as deep as the channels feeding it, and the three pooling layers contribute nothing to the total while cutting the activations by four each time.

شبكة العرض كلها صغيرة بما يكفي لعدّها كاملة. انتبه لأمرين: كل filter في conv عمقه يساوي عدد القنوات الداخلة إليه، وطبقات الـ pooling الثلاث لا تضيف شيئًا إلى المجموع بينما تقلّص الـ activations بأربع مرات في كل مرة.

LayerالطبقةOutputالمخرجParametersالمعاملاتNoteملاحظة
inputالمدخل (input)32 x 32 x 332 x 32 x 300Raw CIFAR-10 imageصورة CIFAR-10 خام
conv, 16 filters 5x5x3, pad 2conv، 16 filter بحجم 5x5x3، pad 232 x 32 x 1632 x 32 x 1616 x 5 x 5 x 3 + 16 = 121616 x 5 x 5 x 3 + 16 = 1216The count printed on slide 25العدد المطبوع في الشريحة 25
max pool 2x2, stride 2max pool 2x2، stride 216 x 16 x 1616 x 16 x 1600Activations cut by 4xتنقص الـ activations بأربع مرات
conv, 20 filters 5x5x16, pad 2conv، 20 filter بحجم 5x5x16، pad 216 x 16 x 2016 x 16 x 2020 x 5 x 5 x 16 + 20 = 802020 x 5 x 5 x 16 + 20 = 8020Depth of the filter equals the input channelsعمق الـ filter يساوي عدد قنوات المدخل
max pool 2x2, stride 2max pool 2x2، stride 28 x 8 x 208 x 8 x 2000
conv, 20 filters 5x5x20, pad 2conv، 20 filter بحجم 5x5x20، pad 28 x 8 x 208 x 8 x 2020 x 5 x 5 x 20 + 20 = 1002020 x 5 x 5 x 20 + 20 = 10020
max pool 2x2, stride 2max pool 2x2، stride 24 x 4 x 204 x 4 x 2000
softmax, 10 classessoftmax، 10 فئات1010320 x 10 + 10 = 3210320 x 10 + 10 = 3210The only layer whose count depends on image sizeالطبقة الوحيدة التي يعتمد عدد معاملاتها على حجم الصورة
Totalالمجموع22,46622,466Three pools contribute nothingطبقات الـ pool الثلاث لا تساهم بشيء
Every ConvNetJS layer, output shape and parametersكل طبقات ConvNetJS، مع شكل المخرج وعدد المعاملات

The total is 22,466 parameters. The softmax layer is the only one whose count depends on the image size, because it reads the flattened 4 x 4 x 20 = 320 activations; every conv layer's count depends only on its filter shape, which is Weight sharing at work.

المجموع 22,466 معاملًا. وطبقة الـ softmax هي الوحيدة التي يعتمد عدد معاملاتها على حجم الصورة، لأنها تقرأ الـ activations المسطّحة وعددها 4 x 4 x 20 = 320؛ أما عدد معاملات كل طبقة conv فيعتمد على شكل الـ filter فقط، وهذا هو weight sharing أثناء العمل.

CNN Explainer as retrieval practiceCNN Explainer كتمرين استرجاع

CNN Explainer (Wang et al., IEEE VIS 2020) runs a network the authors call Tiny VGG on ten classes: lifeboat, ladybug, pizza, bell pepper, school bus, koala, espresso, red panda, orange and sport car. Its training code uses 3 x 3 convolutions with 10 filters and no padding ("valid"), and 2 x 2 max pools with stride 2. The input is 64 x 64 x 3. Before you look at the table, chain the shapes yourself: a valid conv subtracts 2, a pool halves.

يشغّل CNN Explainer (Wang et al., IEEE VIS 2020) شبكة يسمّيها مؤلفوها Tiny VGG على عشر فئات: lifeboat وladybug وpizza وbell pepper وschool bus وkoala وespresso وred panda وorange وsport car. ويستخدم كود التدريب الخاص به convolutions بحجم 3 x 3 مع 10 filters ودون padding («valid»)، وmax pools بحجم 2 x 2 وخطوة 2. والمدخل 64 x 64 x 3. قبل أن تنظر إلى الجدول، تتبّع الأشكال بنفسك: الـ conv من نوع valid تطرح 2، والـ pool يقسم على اثنين.

Recall

Chain the CNN Explainer shapes from 64x64x3 to the second pool.تتبّع أشكال CNN Explainer من 64x64x3 حتى الـ pool الثاني.

64 - 3 + 1 = 62, 62 - 3 + 1 = 60, pool 60/2 = 30, 30 - 3 + 1 = 28, 28 - 3 + 1 = 26, pool 26/2 = 13. All with 10 channels. Flatten: 13 x 13 x 10 = 1690.
64 - 3 + 1 = 62، 62 - 3 + 1 = 60، ثم pool: 60/2 = 30، 30 - 3 + 1 = 28، 28 - 3 + 1 = 26، ثم pool: 26/2 = 13. وكلها بـ 10 قنوات. وبعد التسطيح (flatten): 13 x 13 x 10 = 1690.
LayerالطبقةShape formulaصيغة الشكلOutputالمخرجParametersالمعاملات
inputالمدخل (input)64 x 64 x 364 x 64 x 300
conv_1_1, 10 filters 3x3, validconv_1_1، 10 filters بحجم 3x3، valid64 - 3 + 164 - 3 + 162 x 62 x 1062 x 62 x 1010 x 3 x 3 x 3 + 10 = 28010 x 3 x 3 x 3 + 10 = 280
conv_1_2, 10 filters 3x3, validconv_1_2، 10 filters بحجم 3x3، valid62 - 3 + 162 - 3 + 160 x 60 x 1060 x 60 x 1010 x 3 x 3 x 10 + 10 = 91010 x 3 x 3 x 10 + 10 = 910
max_pool_1, 2x2, stride 2max_pool_1، 2x2، stride 2(60 - 2)/2 + 1(60 - 2)/2 + 130 x 30 x 1030 x 30 x 1000
conv_2_1, 10 filters 3x3, validconv_2_1، 10 filters بحجم 3x3، valid30 - 3 + 130 - 3 + 128 x 28 x 1028 x 28 x 10910910
conv_2_2, 10 filters 3x3, validconv_2_2، 10 filters بحجم 3x3، valid28 - 3 + 128 - 3 + 126 x 26 x 1026 x 26 x 10910910
max_pool_2, 2x2, stride 2max_pool_2، 2x2، stride 2(26 - 2)/2 + 1(26 - 2)/2 + 113 x 13 x 1013 x 13 x 1000
flatten, dense 10, softmaxflatten، ثم dense 10، ثم softmax13 x 13 x 10 = 169013 x 13 x 10 = 169010101690 x 10 + 10 = 16,9101690 x 10 + 10 = 16,910
Totalالمجموع19,92019,920
Tiny VGG, layer by layerTiny VGG طبقةً طبقة

The pattern repeats: 19,920 parameters, of which the two pools contribute 0 while each removes three quarters of the activations. The dense layer holds 16,910 of the total because it multiplies the image-dependent 1690 by the ten classes. Click any activation map in the live page and it animates the window that produced it, which is the pooling and convolution arithmetic of this lecture rendered one cell at a time.

النمط يتكرر: 19,920 معاملًا، يساهم فيها الـ pool الاثنان بـ 0، بينما يزيل كل منهما ثلاثة أرباع الـ activations. وتحمل الطبقة الكثيفة (dense) 16,910 من المجموع لأنها تضرب العدد 1690 المعتمد على حجم الصورة في الفئات العشر. انقر أي activation map في الصفحة الحية وستعرض حركيًا النافذة التي أنتجتها، وهذا هو حساب الـ pooling والـ convolution في هذه المحاضرة معروضًا خليةً خلية.

Recall

How many parameters does the ConvNetJS first conv layer hold, and why does the map stay 32x32?كم معاملًا تحمل أول طبقة conv في ConvNetJS، ولماذا تبقى الخريطة 32x32؟

16 x 5 x 5 x 3 + 16 = 1216. The demo pads by 2, so (32 + 4 - 5)/1 + 1 = 32.
16 x 5 x 5 x 3 + 16 = 1216. والعرض يضيف padding بمقدار 2، لذا (32 + 4 - 5)/1 + 1 = 32.

Quick checkاختبار سريع

In the ConvNetJS CIFAR-10 demo the first conv layer has 16 filters of 5x5x3. How many parameters does it hold?في عرض ConvNetJS على CIFAR-10، أول طبقة conv فيها 16 filter بحجم 5x5x3. كم معاملًا تحمل؟

Quick checkاختبار سريع

In CNN Explainer, conv_1_2 outputs 60x60x10. What does max_pool_1 with a 2x2 window and stride 2 output?في CNN Explainer، مخرج conv_1_2 هو 60x60x10. ما مخرج max_pool_1 بنافذة 2x2 وخطوة 2؟

Recapالخلاصة

If you remember nothing elseإن لم تتذكر شيئاً آخر فتذكّر هذا

  • Pooling summarizes a window in each activation map independently: spatial size drops, channel count stays, 224x224x64 becomes 112x112x64.يلخّص الـ pooling نافذة داخل كل activation map على حدة: يصغر الحجم المكاني ويبقى عدد القنوات كما هو، فيصبح 224x224x64 هو 112x112x64.
  • W2 = (W1 - F)/S + 1, H2 = (H1 - F)/S + 1, depth C unchanged, parameters 0.W2 = (W1 - F)/S + 1 وH2 = (H1 - F)/S + 1، والعمق C لا يتغير، وعدد المعاملات 0.
  • On the slide's 4x4 slice, F = 2 and S = 2 give max [[6,8],[3,4]] and mean [[3.25,5.25],[2,2]].على شريحة 4x4 في الشريحة 22، مع F = 2 وS = 2 يعطي max النتيجة [[6,8],[3,4]] ويعطي mean النتيجة [[3.25,5.25],[2,2]].
  • Max pooling adds approximate invariance to small shifts; 'max is always better' is a heuristic, and many modern networks use strided convolutions or global average pooling instead.يضيف max pooling ثباتًا تقريبيًا أمام الإزاحات الصغيرة؛ وعبارة «max أفضل دائمًا» قاعدة تجريبية لا قانون، وكثير من الشبكات الحديثة تستخدم بدلًا منه strided convolutions أو global average pooling.
  • Filters form a hierarchy: edges in early layers, object parts in the middle, whole objects deep, because receptive fields grow with depth and pooling.تشكّل الـ filters تسلسلًا هرميًا: حواف في الطبقات الأولى، وأجزاء أجسام في الوسط، وأجسام كاملة في العمق، لأن الحقل الاستقبالي يكبر مع العمق ومع الـ pooling.
  • CONV-RELU-CONV-RELU-POOL repeated three times then FC turns an image into class scores; car beats truck, airplane, ship, horse.تكرار CONV-RELU-CONV-RELU-POOL ثلاث مرات ثم طبقة FC يحوّل الصورة إلى درجات للفئات؛ وتتفوق car على truck وairplane وship وhorse.
  • ConvNetJS first layer: 16 x 5 x 5 x 3 + 16 = 1216 parameters; CNN Explainer shapes: 64, 62, 60, 30, 28, 26, 13.الطبقة الأولى في ConvNetJS: 16 x 5 x 5 x 3 + 16 = 1216 معاملًا؛ وأشكال CNN Explainer هي: 64، 62، 60، 30، 28، 26، 13.

Sourcesالمصادر