πŸŽ‰ 75% of content is free forever β€” Unlock Premium from $10/mo β†’
CW
Search courses…
πŸ’Ό Servicesℹ️ Aboutβœ‰οΈ ContactView Pricing Plansfrom $10

Saliency Detection

Computer VisionSaliency Detection🟒 Free Lesson

Advertisement

Saliency Detection

Module: Computer Vision | Difficulty: Intermediate

Saliency Map

KL Divergence Loss

NSS (Normalized Saliency)

AUC (Area Under ROC)

import torch
import torch.nn as nn

class SaliencyNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.backbone = nn.Sequential(
            nn.Conv2d(3, 64, 3, padding=1), nn.ReLU(True),
            nn.Conv2d(64, 128, 3, 2, 1), nn.ReLU(True),
            nn.Conv2d(128, 256, 3, 2, 1), nn.ReLU(True),
        )
        self.head = nn.Sequential(
            nn.Conv2d(256, 128, 3, padding=1), nn.ReLU(True),
            nn.ConvTranspose2d(128, 64, 4, 2, 1), nn.ReLU(True),
            nn.ConvTranspose2d(64, 1, 4, 2, 1), nn.Sigmoid(),
        )
    
    def forward(self, x):
        feat = self.backbone(x)
        return self.head(feat)

Key Takeaways

  • Saliency detection predicts where humans look in images
  • KL divergence and NSS are standard evaluation metrics
  • Saliency models improve image compression and advertisement placement

Need Expert Computer Vision Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement