Grad-CAM: انظر إلى ما يركّز عليه النموذج
صوّر البكسلات التي تؤثر في القرار
Grad-CAM: انظر إلى ما يركّز عليه النموذج درس مجاني في Deep Learning Academy على CoddyKit. هذا هو الدرس 3 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Deep Learning Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Deep Learning Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Open the Black Box
A CNN can be right for the wrong reason. Grad-CAM reveals which pixels actually drove a prediction, so you can trust or question it.
Heatmaps Over the Image
Grad-CAM paints a heatmap on top of the input. Warm regions are where the model focused; cool regions it ignored. 🔥
Gradients Carry Importance
It traces the gradient of the chosen class score back to a convolutional layer, measuring how much each feature map mattered.
Pick a Late Conv Layer
The best maps come from the last convolutional layer, where features are rich yet still spatial enough to localize.
Weight the Feature Maps
Average the gradients to get a weight per feature map, then combine the maps with those weights into one coarse map.
Keep Only the Positive
A ReLU over the combined map keeps regions that push the class up, discarding pixels that argue against it.
cam = torch.relu((weights * activations).sum(dim=0))Upsample to Pixel Size
The map is small, so you upsample it to the image resolution before overlaying it for a clear visual.
Catch Shortcut Learning
If the heatmap lights up the background instead of the object, your model learned a shortcut, not the real signal.
Debug Misclassifications
Run Grad-CAM on wrong predictions to see what misled the model. The focus region often explains the error instantly.
Build Stakeholder Trust
Clear visual evidence of where a model looks makes it far easier to explain and defend in real deployments.
A Window, Not a Proof
Grad-CAM is an approximate visualization, not exact math. Treat it as a strong hint, then confirm with other checks. 🪟
overlay = heatmap * 0.4 + image * 0.6Quick Check
Think about why Grad-CAM is most useful when read alongside model predictions.
Recap
Use Grad-CAM to turn gradients into a heatmap over the image, exposing what drove a prediction and catching shortcut learning. 🎯
تعلم Python مع معلم ذكاء اصطناعي — مجانًا
اكتب وقم بتشغيل أكوادك الفعلية في المتصفح، واحصل على مساعدة فورية من معلم ذكاء اصطناعي متاح 24/7، واستمر من حيث توقفت على الويب أو في التطبيق.
- الدورات
- 30
- الدروس
- 120
الأسئلة الشائعة
هل درس «Grad-CAM: انظر إلى ما يركّز عليه النموذج» مجاني؟
نعم — نص درس «Grad-CAM: انظر إلى ما يركّز عليه النموذج» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Deep Learning Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Deep Learning Academy 4 دروس في المجموع.
ماذا ستتعلم في «Grad-CAM: انظر إلى ما يركّز عليه النموذج»؟
صوّر البكسلات التي تؤثر في القرار تتمرن على Deep Learning Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Deep Learning Academy؟
لا تُشترط خبرة سابقة. Deep Learning Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 3 من أصل 4.
كم من الوقت يستغرق درس «Grad-CAM: انظر إلى ما يركّز عليه النموذج»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Deep Learning Academy هذا؟
نعم. كل درس في Deep Learning Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- Precision وRecall وF1 وROC-AUC
- مصفوفات الالتباس وتحليل الأخطاء
- Grad-CAM: انظر إلى ما يركّز عليه النموذج
- معايرة الثقة