Grad-CAM: Sehen, worauf das Modell schaut
Visualisieren Sie, welche Pixel eine Entscheidung beeinflussen.
Grad-CAM: Sehen, worauf das Modell schaut ist eine kostenlose Deep Learning Academy-Lektion auf CoddyKit. Dies ist Lektion 3 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des Deep Learning Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der Deep Learning Academy-Kurs umfasst insgesamt 4 Lektionen.
Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.
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. 🎯
Häufig gestellte Fragen
Ist die Lektion „Grad-CAM: Sehen, worauf das Modell schaut“ kostenlos?
Ja — der vollständige Text von „Grad-CAM: Sehen, worauf das Modell schaut“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des Deep Learning Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der Deep Learning Academy-Kurs umfasst insgesamt 4 Lektionen.
Was lerne ich in „Grad-CAM: Sehen, worauf das Modell schaut“?
Visualisieren Sie, welche Pixel eine Entscheidung beeinflussen. Du übst Deep Learning Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.
Brauche ich Erfahrung, um Deep Learning Academy zu starten?
Keine Vorkenntnisse erforderlich. Deep Learning Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 3 von 4.
Wie lange dauert die Lektion „Grad-CAM: Sehen, worauf das Modell schaut“?
Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.
Kann ich in dieser Deep Learning Academy-Lektion Code schreiben und ausführen?
Ja. Jede Deep Learning Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.
Alle Lektionen in diesem Kurs
- Precision, Recall, F1 und ROC-AUC
- Konfusionsmatrizen und Fehleranalyse
- Grad-CAM: Sehen, worauf das Modell schaut
- Konfidenz kalibrieren