Saliency Maps
Saliency Maps(顕著性マップ)がどのようにニューラルネットワークの判断を説明するかを解説します。モデルの予測を可視化する方法を学び、Ultralytics Platformを使用して透明性の高いAIを構築しましょう。
Saliency maps are a powerful visual tool used in explainable AI (XAI) to shed light on the internal decision-making processes of complex neural networks. Essentially acting as heatmaps, they highlight the specific pixels or regions of an input image that most heavily influence a model's prediction. By revealing "where" a model is looking, saliency maps help researchers and engineers interpret the behavior of deep convolutional neural networks (CNNs), ensuring that the system is learning the correct features rather than relying on dataset artifacts or background noise. You can read more about the mathematical foundations of this process on the Wikipedia saliency map page.
Link to this sectionSaliency mapsの仕組み#
Saliency mapを生成するための基本的なアプローチは、ネットワーク層全体にわたるbackpropagationとgradientsに大きく依存しています。model training中にモデルのウェイトを更新するためにこれらの勾配を使用するのではなく、アルゴリズムは入力画像そのものに対する予測クラススコアの勾配を計算します。PyTorch autograd documentationで説明されているように、カラーチャネル全体でこれらの勾配の絶対最大値をとることで、変更した場合に出力スコアを劇的に変化させるピクセルに対応するマップが作成されます。最新のアプローチではこれを生成AIにまで拡張しており、ノイズ勾配を追跡するためのdiffusion model saliency mapsが可能になっています。
Link to this section実社会での応用#
Saliency mapsはモデルのロジックを直接視覚的に検証できるため、リスクの高いcomputer visionのシナリオにおいて不可欠です。
- 医療診断: AI in healthcareにおいて、アルゴリズムがスキャナーの透かしではなく、真の生理学的組織の異常に基づいて腫瘍を検出していることを確認することは、患者の安全のために非常に重要です。consistency in XAI medical imagingに関する最近の研究で詳述されているように、Saliency mapsはこの視覚的証明を提供します。
- 自律走行: 操舵角を予測したり一時停止標識を識別したりするautonomous vehiclesにおいて、Saliency mapsの分析は、モデルが不要な風景に気を取られることなく、正しく道路に焦点を合わせているかを検証することで、エンジニアが障害をデバッグするのに役立ちます。
Link to this section関連用語の区別#
deep learning (DL)における役割を正しく理解するために、Saliency mapsをAI用語集内の他の概念と区別することを強く推奨します。
- Saliency MapsとClass Activation Mapping (CAM) の比較: 基本的なSaliency mapsは生ピクセルレベルで重要度を計算しますが、Grad-CAMのようなCAM techniquesは、ネットワークの最終畳み込み層内における高レベルのfeature mapsのレベルで重要度を分析します。新しいベンチマークでは、データセット全体にわたるevaluate visual explanationsやCAMの評価方法の改良が続けられています。
- Saliency Mapsとメカニスティック解釈可能性 (Mechanistic Interpretability) の比較: Saliency mappingは、モデルが「どこ」を見ているかを示すだけのポストホック(事後)手法です。対照的に、Mechanistic Interpretabilityはさらに深く掘り下げ、特定のニューロンやアルゴリズム回路がどのように、そしてなぜその焦点位置を計算したのかをリバースエンジニアリングします。
- Saliency MapsとExplainable AI (XAI) の比較: XAIはAIを透明にするための広範な包括的分野ですが、Saliency mapsはそのツールキットの中の特定のツールに過ぎません。これはしばしば、重要なGoogle Cloud explainability techniqueとして取り上げられます。この分野は急速に進化しており、生のピクセルから、概念データをマッピングする堅牢なhuman-aligned taxonomy for explanationsへと移行しています。
Link to this sectionコードによるSaliencyの抽出#
Understanding how a neural network attributes importance can be done programmatically using deep learning frameworks like PyTorch. The following snippet demonstrates the fundamental math behind extracting a basic saliency map (gradient-based attribution) from a pre-trained image classification model.
import torch
from torchvision.models import resnet18
# Load a pre-trained model in evaluation mode
model = resnet18(weights="DEFAULT").eval()
# Create a dummy image tensor and explicitly require gradients
input_image = torch.randn(1, 3, 224, 224, requires_grad=True)
# Forward pass: get predictions for the input image
output = model(input_image)
# Backward pass: compute gradients for the highest scoring class
output[0, output.argmax()].backward()
# Saliency map is the maximum absolute gradient across the 3 color channels
saliency_map, _ = torch.max(input_image.grad.data.abs(), dim=1)
print(f"Generated Saliency Map Shape: {saliency_map.shape}")object detectionやbounding boxesの描画を含む高度なワークフローでは、Ultralytics Platformのようなツールが、開発者がデータセットにシームレスにアノテーションを付け、実験を監視し、最先端のUltralytics YOLO26のようなモデルからの出力を視覚化するのに役立ちます。model deploymentと並行して視覚的推論を継続的に評価することで、チームはより信頼性が高く透明なAIシステムを構築およびスケールさせることができます。






